All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class javax.infobus.InfoBusItemRequestedEvent

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

public final class InfoBusItemRequestedEvent
extends InfoBusEvent
This event is sent on behalf of a data consumer to find a named data item it would like to receive. The data consumer causes this event to be distributed to producers by calling one of the InfoBus findXXX methods.

A data producer can respond to this event by setting the data item field in this event with the requested DataItem object, using the setDataItem method. The InfoBus calls the getDataItem method on this event to get the data item to return to the data consumer via the InfoBus findXXX method that was originally called.

Version:
$Revision: 1.9 $ $Date: 17 Feb 1998 18:46:34 $

Method Index

 o getDataFlavors()
Exposes the DataFlavors that the consumer prefers, as a hint to producers that can supply data in more than one format.
 o getDataItem()
Allows the handler of the event to unpack a DataItem that was provided in response to the request.
 o getSourceAsConsumer()
Returns the source of the InfoBusItemRequestedEvent, which is always an InfoBusDataConsumer.
 o setDataItem(Object)
If the DataItem field in the event is currently null, sets that field to the value passed as item.

Methods

 o getDataFlavors
 public DataFlavor[] getDataFlavors()
Exposes the DataFlavors that the consumer prefers, as a hint to producers that can supply data in more than one format. If this method returns null, the consumer did not provide any DataFlavor preferences when it requested the event.

The consumer may specify MIME types in the order it prefers, including InfoBus and standard MIME types. A special MIME string x-InfoBus/AnyAccess indicates that a consumer will accept any type of InfoBus access interface available for the item. The producer is not required to consider the requested DataFlavors in supplying the data item.

Returns:
the consumer's preferred flavors, or null if unspecified
 o setDataItem
 public void setDataItem(Object item)
If the DataItem field in the event is currently null, sets that field to the value passed as item. A producer which has the data specified by the event's DataItem name can return that data by calling setDataItem with it.

This is a write-once method, and attempts to replace a non-null DataItem have no effect. The DataItemm field is null [writable] when this event is first delivered to a producer.

Parameters:
item - the value to set the DataItem field to
 o getDataItem
 public Object getDataItem()
Allows the handler of the event to unpack a DataItem that was provided in response to the request.

Returns:
the data item provided by a responding producer, or null if no producers provided data
 o getSourceAsConsumer
 public InfoBusDataConsumer getSourceAsConsumer()
Returns the source of the InfoBusItemRequestedEvent, which is always an InfoBusDataConsumer.

Returns:
the source of this event.

All Packages  Class Hierarchy  This Package  Previous  Next  Index