All Packages Class Hierarchy This Package Previous Next Index
Interface javax.infobus.InfoBusDataConsumer
- public interface InfoBusDataConsumer
- extends InfoBusEventListener
InfoBus users that seek data from InfoBusDataProducers do so by
implementing the InfoBusDataConsumer interface. Implementers can
request DataItems of a specific name and also register with their
InfoBus to receive announcements of data availability from producers.
An InfoBusDataConsumer must track the InfoBus property of the
InfoBusMember that obtained the bus for them, so that if the
setInfoBus method is called with a new InfoBus, the producer will
know to register with the new bus and deregister with the old. This
is the only bound property that the InfoBus protocol requires
InfoBusDataConsumers to track. The base interface, InfoBusEventListener,
extends java.beans.PropertyChangeListener to accomplish this, which in
turn requires InfoBusDataConsumers to implement a propertyChange() method.
- Version:
- $Revision: 1.8 $ $Date: 24 Feb 1998 17:04:32 $
-
dataItemAvailable(InfoBusItemAvailableEvent)
- This method is called by the InfoBus class on behalf of a
data producer that is announcing the availability of a new
data item by name.
-
dataItemRevoked(InfoBusItemRevokedEvent)
- This method is called by the InfoBus class on behalf of a data
producer that is revoking the availability of a previously announced
data item.
dataItemAvailable
public abstract void dataItemAvailable(InfoBusItemAvailableEvent event)
- This method is called by the InfoBus class on behalf of a
data producer that is announcing the availability of a new
data item by name. A consumer that obtains a DataItem from
a producer should be prepared to release it when the producer
announces that the item is being revoked via
InfoBusDataConsumer.dataItemRevoked().
The suggested implementation of dataItemAvailable:
- Check the data item name (obtained via
event.getDataItemName()) to see if the item is wanted.
If not, return.
- Get a reference to the DataItem by calling the
findDataItem() method on the InfoBus instance this consumer has
joined, passing event.getSource() as the argument for the
producer and this for the consumer.
- If desired, set a DataItemChangeListener on the DataItem.
- Parameters:
- event - the InfoBus event for the availability of the data item
dataItemRevoked
public abstract void dataItemRevoked(InfoBusItemRevokedEvent event)
- This method is called by the InfoBus class on behalf of a data
producer that is revoking the availability of a previously announced
data item. A consumer that is using this data item should release
it upon receiving this notification.
The suggested implementation of dataItemRevoked:
- check the data item name (obtained via event.getDataItemName())
to see if this is an item held by this consumer. If not, return.
- remove any change listeners set on this DataItem.
- release all references to the DataItem held by this consumer.
- Parameters:
- event - the InfoBus event for the revocation of the data item
All Packages Class Hierarchy This Package Previous Next Index