public class InPushConnector extends AbstractConnector implements InPushConnector, EventHandler
Activatable.State
Constructor and Description |
---|
InPushConnector(Bus bus)
Creates a new push based connector for receiving events from a given
Bus instance. |
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
void |
addHandler(EventHandler handler)
Adds a handler which will be notified about newly received events.
|
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
protected Bus |
getBus() |
protected Scope |
getScope()
Returns the scope of this connector.
|
URI |
getTransportUri()
Return the URI describing this connector.
|
void |
handle(Event event)
The callback method.
|
boolean |
isActive()
Tells whether this class is currently active or not.
|
void |
notify(Filter filter,
FilterAction action)
Called in case a
Filter was changed. |
boolean |
removeHandler(EventHandler handler)
Removes a registered handler so that it won't be notified anymore.
|
void |
setQualityOfServiceSpec(QualityOfServiceSpec spec)
Sets the quality of service requirements on sending and receiving event
notifications.
|
void |
setScope(Scope scope)
Sets the scope this connector is working on.
|
close
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setQualityOfServiceSpec, setScope
deactivate, isActive
public void activate() throws RSBException
Activatable
activate
in interface Activatable
RSBException
- generic error related to RSBpublic void addHandler(EventHandler handler)
InPushConnector
Activatable.activate()
.addHandler
in interface InPushConnector
handler
- the handler to notifypublic boolean removeHandler(EventHandler handler)
InPushConnector
Activatable.deactivate()
.removeHandler
in interface InPushConnector
handler
- the handler to removetrue
if the given handler was removed, else
false
, i.e. in case that handler was never
registered.public void handle(Event event)
EventHandler
handle
in interface EventHandler
event
- the event to handlepublic void notify(Filter filter, FilterAction action)
FilterObserver
Filter
was changed.notify
in interface FilterObserver
filter
- the Filter
that changes, not null
action
- the action that was performed with this filter, not
null
public URI getTransportUri()
Connector
getTransportUri
in interface Connector
null
protected Bus getBus()
protected Scope getScope()
null
if not yet setpublic void setQualityOfServiceSpec(QualityOfServiceSpec spec)
Connector
spec
- new spec to applypublic void setScope(Scope scope)
Connector
Activatable.activate()
method of the connector is called.scope
- the scopepublic void deactivate() throws RSBException, InterruptedException
Activatable
RSBException
- generic error related to RSBInterruptedException
- interrupted while waiting for proper deactivation. Object
might be in an undefined state nowpublic boolean isActive()
Activatable
true
if activeCopyright © 2018 CoR-Lab. All rights reserved.