All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface org.webmacro.broker.ResourceConsumer

public interface ResourceConsumer
extends ResourceListener
This class is a type of ResourceListener that is interested in hearing about new events (all ResourceListeners have a list of types, see ResourceListener for details.)

If you want to be notified when a resource is made available by the Broker, you can implement this interface and register. If you just want to have the Broker fill your orders, you don't need to implement this--you only need this if you want to be spontaneously notified when something happens.

Note that many consumers may be accessing a ResourceEvent at the same time you are. Ensure (in conjunction with the ResourceProvider) that all operations involving resources are thread safe.

See Also:
ResourceBroker, ResourceProvider, ResourceEvent, ResourceListener

Method Index

 o resourceAvailable(ResourceEvent)
Called whenever a resource matching one of the types you subscribed to becomes available.

Methods

 o resourceAvailable
 public abstract void resourceAvailable(ResourceEvent availableResource)
Called whenever a resource matching one of the types you subscribed to becomes available.

Thread Policy: The event you have been passed may be revoked at any time; it may already have been revoked by the time you look at it. But it was available at the time you were called, which implies that calls to get its value will never block (though if it has been revoked, may return null.). You MAY call the broker, and you MAY lock this or other ResourceEvents, providing you obey the thread policies of those classes.

Note that other consumers may already be accessing the resource, or may start accessing it while you are.


All Packages  Class Hierarchy  This Package  Previous  Next  Index