public class DefaultPushInRouteConfigurator extends AbstractActivatable implements PushInRouteConfigurator
PushInRouteConfigurator
.Activatable.State
Constructor and Description |
---|
DefaultPushInRouteConfigurator(Scope scope)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
activate()
Activates all resources that belong to a specific object.
|
void |
addConnector(InPushConnector connector)
Adds a connector which will subsequently be used for for sending events.
|
void |
deactivate()
Deactivate all resources that are owned by a specific object in order to
correctly tear down.
|
void |
filterAdded(Filter filter)
Called in case a new filter was added and should be reflected by this
route.
|
boolean |
filterRemoved(Filter filter)
Called in a case a filter should be removed from the route.
|
Set<URI> |
getTransportUris()
Returns URIs describing the transports configured for this configurator.
|
void |
handlerAdded(Handler handler,
boolean wait)
Called in case a
Handler was added to the participant for which
the route is being configured. |
boolean |
handlerRemoved(Handler handler,
boolean wait)
Called in case a
Handler was remove from the participant for
which the route is being configured. |
boolean |
isActive()
Tells whether this class is currently active or not.
|
boolean |
removeConnector(InPushConnector connector)
Removes a connector, which will not receive events for sending
afterwards.
|
void |
setEventReceivingStrategy(EventReceivingStrategy strategy)
Defines the
EventReceivingStrategy to use by the configurator. |
close
public DefaultPushInRouteConfigurator(Scope scope)
scope
- the scope events are received onpublic void activate() throws RSBException
Activatable
activate
in interface Activatable
RSBException
- generic error related to RSBpublic void deactivate() throws RSBException
Activatable
deactivate
in interface Activatable
RSBException
- generic error related to RSBpublic void filterAdded(Filter filter)
InRouteConfigurator
filterAdded
in interface InRouteConfigurator<InPushConnector>
filter
- the added filterpublic boolean filterRemoved(Filter filter)
InRouteConfigurator
filterRemoved
in interface InRouteConfigurator<InPushConnector>
filter
- the filter to removetrue
if the filter was already active and was
removed now, else false
public void handlerAdded(Handler handler, boolean wait) throws InterruptedException
PushInRouteConfigurator
Handler
was added to the participant for which
the route is being configured. This method should incorporate that
handler into the route.handlerAdded
in interface PushInRouteConfigurator
handler
- the added handlerwait
- if true
, this method must wait with returning
until the handler is fully active and can receive the next
event. Otherwise it might return earlier.InterruptedException
- interrupted while waiting for the handler to be fully removedpublic boolean handlerRemoved(Handler handler, boolean wait) throws InterruptedException
PushInRouteConfigurator
Handler
was remove from the participant for
which the route is being configured. This method should remove that
handler from the route.handlerRemoved
in interface PushInRouteConfigurator
handler
- the removed handlerwait
- if true
, this method must wait with returning
until the handler is fully removed and will not receive any
more events.. Otherwise it might return earlier.true
if the handler was already available and is now
removed, else false
InterruptedException
- interrupted while waiting for the handler to be fully removedpublic void addConnector(InPushConnector connector)
RouteConfigurator
Activatable.activate()
.addConnector
in interface RouteConfigurator<InPushConnector>
connector
- connector to addpublic boolean removeConnector(InPushConnector connector)
RouteConfigurator
Activatable.activate()
.removeConnector
in interface RouteConfigurator<InPushConnector>
connector
- the connector to removetrue
if the connector was previously installed and
hence remove now, else false
public boolean isActive()
Activatable
isActive
in interface Activatable
true
if activepublic void setEventReceivingStrategy(EventReceivingStrategy strategy)
PushInRouteConfigurator
EventReceivingStrategy
to use by the configurator.
Must be called directly after construction before any other method was
called.setEventReceivingStrategy
in interface PushInRouteConfigurator
strategy
- the new strategypublic Set<URI> getTransportUris()
RouteConfigurator
getTransportUris
in interface RouteConfigurator<InPushConnector>
null
Copyright © 2018 CoR-Lab. All rights reserved.