|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.escot.Broker
|
+--org.escot.DefaultBroker
An implementation of the Broker interface that manages Ports that describe the interoperability characteristics of the beans it brokers.
| Field Summary | |
protected com.sun.java.util.collections.Map |
mBeanPortTable
|
protected com.sun.java.util.collections.Vector |
mBeans
|
protected org.escot.PortFactory |
mBuilder
|
protected com.sun.java.util.collections.Vector |
mEventBindings
|
protected com.sun.java.util.collections.Map |
mIdBeanTable
|
protected WireFactory |
mWireFactory
|
protected com.sun.java.util.collections.Vector |
mWires
A list of wires. |
| Fields inherited from class org.escot.Broker |
mBeanListeners, mBeanWiringListeners, mFeatureListeners, mWiringListeners |
| Constructor Summary | |
DefaultBroker()
|
|
| Method Summary | |
void |
addBean(Object bean)
Adds bean to the set of beans brokered by this Broker instance. |
void |
addBean(Object bean,
String id)
Adds bean to the set of beans brokered by this Broker instance. |
boolean |
addEventBinding(Object source,
Object target,
String eventSetName)
Binds target as a listener to source for the specified event. |
boolean |
canWire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
Returns whether the features may be connected. |
protected String |
createID(Object o)
|
protected String |
ensureUniqueID(Object o,
String id)
|
EventBinding |
findEventBinding(Object source,
Object target,
String eventSetName)
|
Wire |
findWire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
Returns the wire between a published property and subscribing property, or null if it does not exist. |
Object |
getBean(String id)
Returns the bean corresponding to the specified id. |
com.sun.java.util.collections.Collection |
getBeans()
Returns a Collection of the beans brokered by this Broker instance. |
com.sun.java.util.collections.Collection |
getEventBindings()
|
com.sun.java.util.collections.Collection |
getExplicitFeatures(Object bean)
Returns a Collection of dynamic EscotFeatures. |
EscotFeature |
getFeatureByName(Object bean,
String name)
Returns a EscotFeature corresponding to the specified name. |
FeatureDescriptor |
getFeatureDescriptor(Object bean,
String name)
Returns the FeatureDescriptor corresponding to the named feature for the specified bean. |
com.sun.java.util.collections.Collection |
getFeatures(Object bean)
Returns a Collection of EscotFeatures. |
String |
getID(Object bean)
Returns the id corresponding to the specified bean. |
protected org.escot.Port |
getPort(Object bean)
Returns the Port instance created for the bean. |
protected org.escot.Port |
getPort(String id)
|
com.sun.java.util.collections.Vector |
getWires()
Returns a Collection of Wires. |
com.sun.java.util.collections.Collection |
getWires(Object bean,
String featureName)
Returns a Collection of Wires involving the specified bean. |
boolean |
hasEventBinding(Object source,
Object target,
String eventSetName)
Returns whether target is bound as a listener to source for the specified event. |
protected void |
notifyFeatureAdded(FeatureEvent evt)
|
protected void |
notifyFeatureRemoved(FeatureEvent evt)
|
void |
removeAllBeans()
Removes all beans. |
void |
removeBean(Object bean)
Removes bean from the set of beans brokered by this Broker instance. |
void |
removeEventBinding(Object source,
Object target,
String eventSetName)
Removes binding of target as a listener to source for the specified event. |
void |
setID(Object bean,
String id)
|
protected void |
setPortFactory(org.escot.PortFactory builder)
Sets the PortBuilder, which builds a Port for each bean. |
protected void |
setWireFactory(WireFactory wf)
Sets the PortBuilder, which builds a Port for each bean. |
void |
setWires(com.sun.java.util.collections.Vector v)
For restoring the Broker state on load. |
protected void |
unwire(Object bean,
String featureName)
|
void |
unwire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
Disconnects a published property from a subscribing property. |
void |
unwire(Wire wire)
Disconnects the properties specified in the Wire. |
void |
unwireAll()
Disconnects everything. |
void |
wire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
Connects a published property to a subscribing property. |
protected void |
wire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName,
boolean addNonBrokeredBeans)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected com.sun.java.util.collections.Vector mBeans
protected com.sun.java.util.collections.Vector mWires
protected com.sun.java.util.collections.Vector mEventBindings
protected com.sun.java.util.collections.Map mIdBeanTable
protected org.escot.PortFactory mBuilder
protected WireFactory mWireFactory
protected com.sun.java.util.collections.Map mBeanPortTable
| Constructor Detail |
public DefaultBroker()
| Method Detail |
protected void setPortFactory(org.escot.PortFactory builder)
protected void setWireFactory(WireFactory wf)
protected org.escot.Port getPort(Object bean)
protected org.escot.Port getPort(String id)
public Object getBean(String id)
BrokergetBean in class Brokerorg.escot.Brokerpublic String getID(Object bean)
BrokergetID in class Brokerorg.escot.Broker
public void setID(Object bean,
String id)
public void addBean(Object bean)
BrokeraddBean in class Brokerorg.escot.Brokerbean - the bean to add.
public void addBean(Object bean,
String id)
BrokeraddBean in class Brokerorg.escot.Brokerbean - the bean to addid - an id to associate with the beanpublic void removeBean(Object bean)
BrokerremoveBean in class Brokerorg.escot.Brokerbean - the bean to removepublic void removeAllBeans()
BrokerremoveAllBeans in class Brokerpublic com.sun.java.util.collections.Collection getBeans()
BrokergetBeans in class Brokerprotected void notifyFeatureAdded(FeatureEvent evt)
protected void notifyFeatureRemoved(FeatureEvent evt)
public Wire findWire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
BrokerfindWire in class Brokerorg.escot.Broker
public boolean canWire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
BrokercanWire in class Brokerorg.escot.Brokerpublisher - a bean which publishes a propertypublisherPropName - name of a property of the publishersubscriber - a bean which subscribes to a propertysubscriberPropName - name of a property of the subscriber
public void wire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
throws WiringException
Brokerwire in class Brokerorg.escot.Brokerpublisher - a bean which publishes a propertypublisherPropName - name of a property of the publishersubscriber - a bean which subscribes to a propertysubscriberPropName - name of a property of the subscriber
protected void wire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName,
boolean addNonBrokeredBeans)
throws WiringException
addNonBrokeredBeans - if true, adds subscriber and publisher as beans if not brokered.
public void unwire(Object publisher,
String publisherPropName,
Object subscriber,
String subscriberPropName)
Brokerunwire in class Brokerorg.escot.Brokerpublisher - a bean which publishes a propertypublisherPropName - name of a property of the publishersubscriber - a bean which subscribes to a propertysubscriberPropName - name of a property of the subscriber
protected void unwire(Object bean,
String featureName)
public void unwire(Wire wire)
Brokerunwire in class Brokerpublic void unwireAll()
BrokerunwireAll in class Brokerpublic void setWires(com.sun.java.util.collections.Vector v)
public com.sun.java.util.collections.Vector getWires()
BrokergetWires in class Broker
public com.sun.java.util.collections.Collection getWires(Object bean,
String featureName)
BrokergetWires in class Broker
public EscotFeature getFeatureByName(Object bean,
String name)
throws IntrospectionException
BrokergetFeatureByName in class Broker
public FeatureDescriptor getFeatureDescriptor(Object bean,
String name)
throws IntrospectionException
BrokergetFeatureDescriptor in class Brokerpublic com.sun.java.util.collections.Collection getFeatures(Object bean)
BrokergetFeatures in class Brokerpublic com.sun.java.util.collections.Collection getExplicitFeatures(Object bean)
BrokergetExplicitFeatures in class Broker
protected String ensureUniqueID(Object o,
String id)
protected String createID(Object o)
public boolean addEventBinding(Object source,
Object target,
String eventSetName)
addEventBinding in class Broker
public void removeEventBinding(Object source,
Object target,
String eventSetName)
removeEventBinding in class Broker
public boolean hasEventBinding(Object source,
Object target,
String eventSetName)
hasEventBinding in class Broker
public EventBinding findEventBinding(Object source,
Object target,
String eventSetName)
public com.sun.java.util.collections.Collection getEventBindings()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||