All Packages Class Hierarchy This Package Previous Next Index
Class javax.infobus.InfoBusMemberSupport
java.lang.Object
|
+----javax.infobus.InfoBusMemberSupport
- public class InfoBusMemberSupport
- extends Object
- implements InfoBusMember
Implements the methods of the InfoBusMember interface with the
functionality specified by the InfoBus protocol. Encapsulates an
InfoBus property, plus PropertyChangeSupport and VetoableChangeSupport
objects to ensure the property is bound and constrained.
- Version:
- $Revision: 1.14 $ $Date: 04 Mar 1998 16:41:52 $
- See Also:
- InfoBusMember
-
m_infoBus
-
-
m_propSupport
-
-
m_sourceRef
-
-
m_vetoSupport
-
-
InfoBusMemberSupport(InfoBusMember)
- Creates a new InfoBusMemberSupport object.
-
addInfoBusPropertyListener(PropertyChangeListener)
- Adds a PropertyChangeListener that will be alerted whenever the
InfoBusMember's setInfoBus method is called and not vetoed.
-
addInfoBusVetoableListener(VetoableChangeListener)
- Adds a VetoableChangeListener to the list of listeners that will
be alerted whenever the InfoBusMember's setInfoBus method is called.
-
getInfoBus()
- Returns the InfoBus which is currently assigned to the InfoBusMemberSupport's
InfoBus property.
-
joinInfoBus(Component)
- Attempts to obtain a default bus and join it.
-
joinInfoBus(String)
- Attempts to obtain a named bus and join it.
-
leaveInfoBus()
- Calls the leave method on the InfoBus to which this InfoBusMemberSupport
is attached, effectively setting the InfoBus property to null.
-
removeInfoBusPropertyListener(PropertyChangeListener)
- Removes a PropertyChangeListener from the list of listeners
requesting notification of an InfoBus change.
-
removeInfoBusVetoableListener(VetoableChangeListener)
- Removes a VetoableChangeListener from the list of listeners that will
be alerted whenever the InfoBusMember's setInfoBus method is called.
-
setInfoBus(InfoBus)
- Attempts to set the InfoBus property and register with the InfoBus.
m_infoBus
protected InfoBus m_infoBus
m_propSupport
protected PropertyChangeSupport m_propSupport
m_vetoSupport
protected VetoableChangeSupport m_vetoSupport
m_sourceRef
protected InfoBusMember m_sourceRef
InfoBusMemberSupport
public InfoBusMemberSupport(InfoBusMember member)
- Creates a new InfoBusMemberSupport object. The member parameter
allows the parent of InfoBusMemberSupport to implement the
InfoBusMember interface and have the parent -- instead of
the InfoBusMemberSupport object -- specified in all PropertyChangeEvents
and on the InfoBus itself. If member is null, the InfoBusMemberSupport
object is specified in these cases.
- Parameters:
- member - used as the "source" of PropertyChangeEvents
issued by the InfoBusMemberSupport. If null, the InfoBusMemberSupport object
is used as the "source."
setInfoBus
public synchronized void setInfoBus(InfoBus newInfoBus) throws PropertyVetoException
- Attempts to set the InfoBus property and register with the InfoBus.
First, it checks with
any registered VetoableChangeListeners, and rethrows the
PropertyVetoException if the attempt is denied. If successful,
it sends notification to all registered PropertyChangeListeners.
- Parameters:
- newInfoBus - the InfoBus that will be assigned to the InfoBus property
if the action is not vetoed
- Throws: PropertyVetoException
- if one or more of the
VetoableChangeListeners reject the proposed change of InfoBus
getInfoBus
public InfoBus getInfoBus()
- Returns the InfoBus which is currently assigned to the InfoBusMemberSupport's
InfoBus property.
- Returns:
- the current value of the InfoBus property
joinInfoBus
public synchronized void joinInfoBus(String busName) throws InfoBusMembershipException, PropertyVetoException
- Attempts to obtain a named bus and join it.
- Parameters:
- busName - the name of the bus that the InfoBusMemberSupport should
join
- Throws: InfoBusMembershipException
- if joinInfoBus is called
when the InfoBus property is already set
- Throws: PropertyVetoException
- if a VetoableChangeListener is
registered and rejects the attempt to set the InfoBus property
joinInfoBus
public synchronized void joinInfoBus(Component component) throws InfoBusMembershipException, PropertyVetoException
- Attempts to obtain a default bus and join it.
- Parameters:
- component - the Component on which the default bus should be based
- Throws: InfoBusMembershipException
- if joinInfoBus is called
when the InfoBus property is already set
- Throws: PropertyVetoException
- if a VetoableChangeListener is
registered and rejects the attempt to set the InfoBus property
leaveInfoBus
public synchronized void leaveInfoBus() throws InfoBusMembershipException, PropertyVetoException
- Calls the leave method on the InfoBus to which this InfoBusMemberSupport
is attached, effectively setting the InfoBus property to null.
This method should be called when the holder of the
InfoBusMemberSupport is shutting down or finalizing to release unneeded
resources.
- Throws: InfoBusMembershipException
- if the InfoBus property
is already set to null
- Throws: PropertyVetoException
- if a VetoableChangeListener refuses to
allow the InfoBus to be set to null
addInfoBusVetoableListener
public void addInfoBusVetoableListener(VetoableChangeListener vcl)
- Adds a VetoableChangeListener to the list of listeners that will
be alerted whenever the InfoBusMember's setInfoBus method is called.
Any of these listeners can veto the setInfoBus action by
throwing a PropertyVetoException.
- Parameters:
- vcl - the VetoableChangeListener to be added
removeInfoBusVetoableListener
public void removeInfoBusVetoableListener(VetoableChangeListener vcl)
- Removes a VetoableChangeListener from the list of listeners that will
be alerted whenever the InfoBusMember's setInfoBus method is called.
- Parameters:
- vcl - the VetoableChangeListener to be removed
addInfoBusPropertyListener
public void addInfoBusPropertyListener(PropertyChangeListener pcl)
- Adds a PropertyChangeListener that will be alerted whenever the
InfoBusMember's setInfoBus method is called and not vetoed.
- Parameters:
- pcl - the PropertyChangeListener to be added
removeInfoBusPropertyListener
public void removeInfoBusPropertyListener(PropertyChangeListener pcl)
- Removes a PropertyChangeListener from the list of listeners
requesting notification of an InfoBus change.
- Parameters:
- pcl - the PropertyChangeListener to be removed
All Packages Class Hierarchy This Package Previous Next Index