|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Those InfoBusMembers which will also be Java Beans must implement the InfoBusBean interface to insure proper operation when used in Bean builder tools. InfoBusBean extends InfoBusMember to add a String property called infoBusName, which allows InfoBus membership to be easily manipulated in a Bean builder via a property page and is also serializable (which InfoBus objects are not). InfoBusMembers which are not usable as Beans can optionally implement the InfoBusBean interface to support this property.
InfoBusBeans preserve their infoBusName property for future use: if an InfoBusBean is serializable, it will serialize its infoBusName property. When an InfoBusBean voluntarily leaves an InfoBus by calling InfoBus.leave(), it retains its infoBusName property even though the infoBus property is reset to null. In all cases, when an InfoBusBean needs to join an InfoBus, it first checks its infoBusName property and attempts to use the one specified there as its first choice.
The setInfoBus method impacts the infoBusName property in a symmetric fashion: a successful call to setInfoBus will update the infoBusName to the name of the new bus.
An implementation of this interface is provided in the InfoBusBeanSupport class.
InfoBusMember
Field Summary | |
static java.lang.String |
USE_DEFAULT_INFOBUS
a reserved String, "-default", which indicates that the InfoBusBean should attempt to get and join its default InfoBus (NOTE cannot be used directly in InfoBus.get(String) ). |
Method Summary | |
java.lang.String |
getInfoBusName()
Returns the String which is currently assigned to the InfoBusBean's infoBusName property. |
void |
setInfoBusName(java.lang.String newBusName)
The setInfoBusName method must be a second means of setting the infoBus property: when setInfoBusName( newBusName ) is called, the InfoBusBean obtains the InfoBus specified by newBusName and then calls its own setInfoBus with the result. |
Methods inherited from interface javax.infobus.InfoBusMember |
addInfoBusPropertyListener,
addInfoBusVetoableListener,
getInfoBus,
removeInfoBusPropertyListener,
removeInfoBusVetoableListener,
setInfoBus |
Field Detail |
public static final java.lang.String USE_DEFAULT_INFOBUS
setInfoBusName(java.lang.String)
Method Detail |
public void setInfoBusName(java.lang.String newBusName) throws InfoBusMembershipException
The infoBusName and infoBus setter and getter methods must be synchronized so that calling either setter unambiguously updates both properties.
When setInfoBusName is called with the String "-default" (the constant InfoBusBean.USE_DEFAULT_INFOBUS), it indicates that the InfoBusBean should get its default InfoBus (for example, by InfoBus.get(Component) ) and use this for an immediate setInfoBus. If successful, the infoBusName property is updated to "-default" and will therefore be different from getInfoBus().getName(). Note that "-default" is a reserved String and is illegal as the name of an InfoBus object (InfoBus.getInfoBus("-default") will throw an IllegalArgumentException).
newBusName
- the name of an InfoBus which will be assigned to the
infoBus property if the action is not vetoedpublic java.lang.String getInfoBusName()
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |