All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.infobus.InfoBusItemAvailableEvent

java.lang.Object
   |
   +----java.util.EventObject
           |
           +----javax.infobus.InfoBusEvent
                   |
                   +----javax.infobus.InfoBusItemAvailableEvent

public final class InfoBusItemAvailableEvent
extends InfoBusEvent
InfoBusItemAvailableEvent is sent when an InfoBusDataProducer wants to notify InfoBusDataConsumers that a named DataItem is available and will be returned on request.

The data producer causes this event to be distributed to consumers by calling InfoBus.fireItemAvailable().

Version:
$Revision: 1.8 $ $Date: 17 Feb 1998 18:45:46 $

Method Index

 o getDataFlavors()
Returns a reference to an array of DataFlavor objects that describe the formats the producer can provide, either in the data item itself or by way of Transferable.getTransferData().
 o getSourceAsProducer()
Returns the source of the InfoBusItemAvailableEvent, which is always an InfoBusDataProducer.
 o requestDataItem(InfoBusDataConsumer, DataFlavor[])
Sends an InfoBusItemRequestedEvent directly to the producer that announced the item's availability.

Methods

 o getDataFlavors
 public DataFlavor[] getDataFlavors()
Returns a reference to an array of DataFlavor objects that describe the formats the producer can provide, either in the data item itself or by way of Transferable.getTransferData(). This method allows a consumer to consider the type of information being announced as available before requesting a data item. If this method returns null, the producer did not specify the DataFlavors in announcing this data.

Returns:
an array of supported flavors or null if the producer is not specifying flavors
 o requestDataItem
 public Object requestDataItem(InfoBusDataConsumer consumer,
                               DataFlavor flavors[])
Sends an InfoBusItemRequestedEvent directly to the producer that announced the item's availability. Calling this method directly on announcement is more efficient than broadcasting a request event, and ensures that the item returned will be from the announcer rather than some other producer capable of creating an event with the requested name.

When flavors is not null, it specifies an array of flavors the consumer can use. The producer may decide not to return an item if it cannot provide it in one of these flavors.

Parameters:
consumer - the consumer making the request
flavors - the consumer's preferred DataFlavors for the item
Returns:
the data item named in the AvailableEvent, or null if the producer cannot fulfill the request
 o getSourceAsProducer
 public InfoBusDataProducer getSourceAsProducer()
Returns the source of the InfoBusItemAvailableEvent, which is always an InfoBusDataProducer.

Returns:
the source of this event.

All Packages  Class Hierarchy  This Package  Previous  Next  Index