org.enhydra.barracuda.core.event
Interface EventGateway

All Known Implementing Classes:
ApplicationGateway, DefaultEventGateway

public interface EventGateway

An EventGateway simply represents a gateway to a set of event handlers within a system. Gateways are heirarchical in that they may contain other EventGateways, and may have a parent gateway. Invoking register on a gateway should cause it to a) register all known enties that are interested in receiving events from the EventBroker b) invoke register for any gateways it contains Invoking deregister has the opposite effect.


Method Summary
 void add(EventGateway eg)
          Add an event gateway to this one
 void deregister(EventBroker eb)
          Ask all interested parties to de-register with the EventBroker
 void deregisterLocalEventInterests(EventBroker eb)
          Deregister any local interests in the EventBroker
 List getChildren()
          Get a list of child gateways
 EventGateway getParent()
          Get the parent event gateway.
 void register(EventBroker eb)
          Ask all interested parties to register with the EventBroker
 void registerLocalEventAliases(EventBroker eb)
          Register any local event aliases in the EventBroker
 void registerLocalEventInterests(EventBroker eb)
          Register any local interests in the EventBroker
 void remove(EventGateway eg)
          Remove an event gateway from this one
 void setParent(EventGateway eg)
          Set the parent event gateway.
 void specifyLocalEventAliases(Class event)
          Rather than overriding the registerLocalEventAliases method, you can just invoke this method instead for type of event you want to manually alias.
 void specifyLocalEventInterests(ListenerFactory factory)
          Rather than overriding the registerLocalEventInterests method, you can just invoke this method instead for each interest you'd like to register.
 void specifyLocalEventInterests(ListenerFactory factory, Class event)
          Rather than overriding the registerLocalEventInterests method, you can just invoke this method instead for each interest you'd like to register.
 

Method Detail

setParent

public void setParent(EventGateway eg)
Set the parent event gateway. Null indicates its the root.

Parameters:
eg - the parent event gateway

getParent

public EventGateway getParent()
Get the parent event gateway. Returns null if it's the root.

Returns:
the parent event gateway

add

public void add(EventGateway eg)
Add an event gateway to this one

Parameters:
eg - the event gateway to be added

remove

public void remove(EventGateway eg)
Remove an event gateway from this one

Parameters:
eg - the event gateway to be removed

getChildren

public List getChildren()
Get a list of child gateways

Returns:
a list of child gateways

register

public void register(EventBroker eb)
Ask all interested parties to register with the EventBroker

Parameters:
eb - the event broker this gateway should use to register for events

deregister

public void deregister(EventBroker eb)
Ask all interested parties to de-register with the EventBroker

Parameters:
eb - the event broker this gateway should use to de-register for events

registerLocalEventInterests

public void registerLocalEventInterests(EventBroker eb)
Register any local interests in the EventBroker

Parameters:
eb - the event broker this gateway should use to register for local events

deregisterLocalEventInterests

public void deregisterLocalEventInterests(EventBroker eb)
Deregister any local interests in the EventBroker

Parameters:
eb - the event broker this gateway should use to de-register for local events

registerLocalEventAliases

public void registerLocalEventAliases(EventBroker eb)
Register any local event aliases in the EventBroker

Parameters:
eb - the event broker this gateway should use to register aliases for local events

specifyLocalEventInterests

public void specifyLocalEventInterests(ListenerFactory factory)
Rather than overriding the registerLocalEventInterests method, you can just invoke this method instead for each interest you'd like to register. The gateway will keep track of all factories specified, and register/deregister when appropriate (so you don't have to worry about it). Notice that this method registers just the listener id (not for a specific class of event). The only real reason for using the registerLocalEventInterests method would be if you actually need access to the EventBroker. Note that if the event class is not an instance of BaseEvent, the request is just silently ignored (unlike the event broker, which throws an exception).

Parameters:
factory - the factory we wish to register with the event broker

specifyLocalEventInterests

public void specifyLocalEventInterests(ListenerFactory factory,
                                       Class event)
Rather than overriding the registerLocalEventInterests method, you can just invoke this method instead for each interest you'd like to register. The gateway will keep track of all factories specified, and register/deregister when appropriate (so you don't have to worry about it). The only real reason for using the registerLocalEventInterests method would be if you actually need access to the EventBroker. Note that if the event class is not an instance of BaseEvent, the request is just silently ignored (unlike the event broker, which throws an exception).

Parameters:
factory - the factory we wish to register with the event broker
event - the class of events we are interested in

specifyLocalEventAliases

public void specifyLocalEventAliases(Class event)
Rather than overriding the registerLocalEventAliases method, you can just invoke this method instead for type of event you want to manually alias. The only real reason for using the registerLocalEventAliases method would be if you actually need access to the EventBroker. Note that if the event class is not an instance of BaseEvent, the request is just silently ignored (unlike the event broker, which throws an exception).

Parameters:
event - the class of events we are interested in registering aliases for


Copyright © 2003 BarracudaMVC.org All Rights Reserved.