All Packages Class Hierarchy This Package Previous Next Index
Interface org.webmacro.broker.ResourceListener
- public interface ResourceListener
- extends EventListener
Common interface for both ResourceProvider and ResourceConsumer. All
ResourceListeners have a set of types which they listen for.
-
destroy()
- Called when the RequestBroker is shutting down.
-
getTypes()
- Get a list of the types that this ResourceListener is interested
in.
-
init(ResourceBroker)
- Called whent he ResourceBroker is starting up.
getTypes
public abstract String[] getTypes()
- Get a list of the types that this ResourceListener is interested
in. This method will be called when the ResourceListener is
registered with a ResourceBroker. The ResourceBroker will only
forward events matching one of the listed types to the Listener.
Note that this method should return the same list each time its
called by the ResourceBroker. If you wish to change the list of
types your listener is intersted in, you should remove it from
all ResourceBrokers, change the list, and then re-add it.
- See Also:
- ResourceProvider, ResourceConsumer
init
public abstract void init(ResourceBroker broker) throws InitException
- Called whent he ResourceBroker is starting up. You can initialize
your provider at this point. If initialization failed for some
reason you can throw an exception.
- Parameters:
- broker - the resoruce broker initializing the listener
- Throws: InitException
- cannot initialize the listener
destroy
public abstract void destroy()
- Called when the RequestBroker is shutting down. The ResourceListener
should save its persistent state and shut down as well.
All Packages Class Hierarchy This Package Previous Next Index