javax.infobus
Interface InfoBusDataConsumer

All Known Implementing Classes:
InfoBusDataConsumerProxy

public abstract 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.


Method Summary
 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.
 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.
 
Methods inherited from interface java.beans.PropertyChangeListener
propertyChange
 

Method Detail

dataItemAvailable

public 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:

Parameters:
event - the InfoBus event for the availability of the data item

dataItemRevoked

public 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:

Parameters:
event - the InfoBus event for the revocation of the data item