public class Listener extends Participant
Modifier and Type | Class and Description |
---|---|
protected class |
Listener.ListenerStateActive |
protected class |
Listener.ListenerStateInactive |
Modifier and Type | Field and Description |
---|---|
protected static java.util.logging.Logger |
LOG |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all network resources that belong to a specific object.
|
void |
addFilter(Filter filter) |
void |
addHandler(Handler handler,
boolean wait)
Register an event handler on this Listener to be notified about incoming
events.
|
void |
deactivate()
Deactivate all network resources that are owned by a specific object in
order to reactivate it.
|
java.util.Iterator<Filter> |
getFilterIterator() |
java.util.List<Filter> |
getFilters() |
java.util.Iterator<Handler> |
getHandlerIterator() |
java.util.List<Handler> |
getHandlers() |
boolean |
isActive()
Tells wether this class is currently active or not.
|
void |
removeHandler(Handler handler,
boolean wait)
Remove an event listener from this Listener.
|
void |
setErrorHandler(ErrorHandler handler)
Deprecated.
not yet designed
|
getId, getRouter, getScope, getTransportFactory
public void activate() throws InitializeException
RSBObject
InitializeException
public void deactivate()
RSBObject
public java.util.List<Filter> getFilters()
public java.util.Iterator<Filter> getFilterIterator()
public void addFilter(Filter filter)
public java.util.List<Handler> getHandlers()
public java.util.Iterator<Handler> getHandlerIterator()
public void addHandler(Handler handler, boolean wait)
handler
- the handler instance to be registeredwait
- if set to @c true, this method will return only after the
handler has completely been installed and will receive the
next available message. Otherwise it may return earlier.public void removeHandler(Handler handler, boolean wait) throws java.lang.InterruptedException
handler
- the listener instance to be removed.wait
- if set to @c true, this method will return only after the
handler has been completely removed from the event processing
and will not be called anymore from this listener.java.lang.InterruptedException
- thrown if the method is interrupted while waiting for the
handler to be removedpublic void setErrorHandler(ErrorHandler handler)
public boolean isActive()
RSBObject
true
if active