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

Variable Index

 o m_infoBus
 o m_propSupport
 o m_sourceRef
 o m_vetoSupport

Constructor Index

 o InfoBusMemberSupport(InfoBusMember)
Creates a new InfoBusMemberSupport object.

Method Index

 o addInfoBusPropertyListener(PropertyChangeListener)
Adds a PropertyChangeListener that will be alerted whenever the InfoBusMember's setInfoBus method is called and not vetoed.
 o addInfoBusVetoableListener(VetoableChangeListener)
Adds a VetoableChangeListener to the list of listeners that will be alerted whenever the InfoBusMember's setInfoBus method is called.
 o getInfoBus()
Returns the InfoBus which is currently assigned to the InfoBusMemberSupport's InfoBus property.
 o joinInfoBus(Component)
Attempts to obtain a default bus and join it.
 o joinInfoBus(String)
Attempts to obtain a named bus and join it.
 o leaveInfoBus()
Calls the leave method on the InfoBus to which this InfoBusMemberSupport is attached, effectively setting the InfoBus property to null.
 o removeInfoBusPropertyListener(PropertyChangeListener)
Removes a PropertyChangeListener from the list of listeners requesting notification of an InfoBus change.
 o removeInfoBusVetoableListener(VetoableChangeListener)
Removes a VetoableChangeListener from the list of listeners that will be alerted whenever the InfoBusMember's setInfoBus method is called.
 o setInfoBus(InfoBus)
Attempts to set the InfoBus property and register with the InfoBus.

Variables

 o m_infoBus
 protected InfoBus m_infoBus
 o m_propSupport
 protected PropertyChangeSupport m_propSupport
 o m_vetoSupport
 protected VetoableChangeSupport m_vetoSupport
 o m_sourceRef
 protected InfoBusMember m_sourceRef

Constructors

 o 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."

Methods

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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