|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.ubik.mcast.EventConsumer
public class EventConsumer
Helper class that encasulates AsyncEventListeners and
SyncEventListeners, grouping them by "event type". This
class implements the dispatching of remote events to the encapsulated
listeners.
AsyncEventListener,
SyncEventListener,
DomainName| Constructor Summary | |
|---|---|
EventConsumer(java.lang.String domain)
Creates an instance of this class with the given domain. |
|
EventConsumer(java.lang.String node,
java.lang.String domain)
Creates an instance of this class, with the given node identifier, and the given domain. |
|
| Method Summary | |
|---|---|
protected boolean |
contains(java.util.List listeners,
AsyncEventListener listener)
|
boolean |
containsAsyncListener(AsyncEventListener listener)
Returns true if the passed in listener is held within this instance. |
boolean |
containsSyncListener(SyncEventListener listener)
Returns true if the given listener is contained
by this instance. |
int |
getCount()
Returns the number of listeners within this instance. |
DomainName |
getDomainName()
Returns the object that represents this instance's domain name. |
java.lang.String |
getNode()
Returns the node identifier of this instance. |
boolean |
hasSyncListener(java.lang.String evtType)
Checks if a SyncEventListener exists for the given event type |
protected boolean |
matchesAll(DomainName dn,
java.lang.String node)
|
protected boolean |
matchesThis(DomainName dn,
java.lang.String node)
|
protected void |
onAsyncEvent(RemoteEvent evt)
|
protected java.lang.Object |
onSyncEvent(RemoteEvent evt)
|
void |
registerAsyncListener(java.lang.String evtType,
AsyncEventListener listener)
Registers the given listener with the given "logical" event type. |
void |
registerSyncListener(java.lang.String evtType,
SyncEventListener listener)
Registers the given listener with the given "logical" event type. |
void |
unregisterListener(AsyncEventListener listener)
Removes the given listener from this instance. |
void |
unregisterListener(SyncEventListener listener)
Removes the given listener from this instance. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public EventConsumer(java.lang.String node,
java.lang.String domain)
public EventConsumer(java.lang.String domain)
throws java.net.UnknownHostException
java.net.UnknownHostException| Method Detail |
|---|
public java.lang.String getNode()
public DomainName getDomainName()
DomainName
public void registerAsyncListener(java.lang.String evtType,
AsyncEventListener listener)
evtType - a logical event type.listener - an AsyncEventListener.
public void registerSyncListener(java.lang.String evtType,
SyncEventListener listener)
throws ListenerAlreadyRegisteredException
evtType - a logical event type.listener - a SyncEventListener.
ListenerAlreadyRegisteredExceptionpublic void unregisterListener(SyncEventListener listener)
listener - the SyncEventListener to remove.public void unregisterListener(AsyncEventListener listener)
listener - the AsyncEventListener to remove.public boolean containsAsyncListener(AsyncEventListener listener)
true if the passed in listener is held within this instance.
listener - an AsyncEventListener
true if the passed in listener is held within this instance.public boolean hasSyncListener(java.lang.String evtType)
SyncEventListener exists for the given event type
evtType - the type of event for which to perform the check.
true if a SyncEventListener exists
for the given event type.public boolean containsSyncListener(SyncEventListener listener)
true if the given listener is contained
by this instance.
listener - a SyncEventListener.
true if the given listener is contained
by this instance.public int getCount()
protected void onAsyncEvent(RemoteEvent evt)
protected boolean matchesAll(DomainName dn,
java.lang.String node)
protected boolean matchesThis(DomainName dn,
java.lang.String node)
protected java.lang.Object onSyncEvent(RemoteEvent evt)
protected boolean contains(java.util.List listeners,
AsyncEventListener listener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||