public class Listener extends Participant
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
void |
addFilter(Filter filter)
Activates the specified filter for this informer.
|
void |
addHandler(Handler handler,
boolean wait)
Register an event handler on this Listener to be notified about incoming
events.
|
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
Class<?> |
getDataType()
Returns the data type transfered by this participant.
|
Iterator<Filter> |
getFilterIterator()
Returns an iterator overall active filters on this listener.
|
List<Filter> |
getFilters()
Returns the filters currently being active on the listener.
|
Iterator<Handler> |
getHandlerIterator()
Returns an interator over all handlers attached to this listener.
|
List<Handler> |
getHandlers()
Returns a list of handlers attached to this listener.
|
String |
getKind()
Returns kind of participant in RSB terminology.
|
Set<URI> |
getTransportUris()
Returns URIs describing the transports configured for this participants.
|
boolean |
isActive()
Tells whether this class is currently active or not.
|
void |
removeHandler(Handler handler,
boolean wait)
Remove an event listener from this Listener.
|
getConfig, getId, getObserverManager, getScope, setObserverManager
close
public void activate() throws RSBException
Activatable
activate
in interface Activatable
activate
in class Participant
RSBException
- generic error related to RSBpublic void deactivate() throws RSBException, InterruptedException
Activatable
deactivate
in interface Activatable
deactivate
in class Participant
RSBException
- generic error related to RSBInterruptedException
- interrupted while waiting for proper deactivation. Object
might be in an undefined state nowpublic List<Filter> getFilters()
public Iterator<Filter> getFilterIterator()
public void addFilter(Filter filter)
filter
- the filter to activatepublic List<Handler> getHandlers()
public Iterator<Handler> getHandlerIterator()
public void addHandler(Handler handler, boolean wait) throws InterruptedException
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.InterruptedException
- if waiting for installation is wanted but interruptedpublic void removeHandler(Handler handler, boolean wait) throws 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.InterruptedException
- thrown if the method is interrupted while waiting for the
handler to be removedpublic boolean isActive()
Activatable
true
if activepublic String getKind()
Participant
getKind
in class Participant
public Class<?> getDataType()
Participant
getDataType
in class Participant
null
if not applicable for this type of
participantpublic Set<URI> getTransportUris()
Participant
getTransportUris
in class Participant
null
Copyright © 2018 CoR-Lab. All rights reserved.