public class Registrar extends java.lang.Object implements TopicParticipantManagerListener, ServiceManagerListener
SlaveServer
with the
MasterServer
.Constructor and Description |
---|
Registrar(MasterClient masterClient,
java.util.concurrent.ScheduledExecutorService executorService) |
Modifier and Type | Method and Description |
---|---|
void |
onPublisherAdded(DefaultPublisher<?> publisher)
Called when a new
Publisher is added. |
void |
onPublisherRemoved(DefaultPublisher<?> publisher)
Called when a new
Publisher is removed. |
void |
onServiceServerAdded(DefaultServiceServer<?,?> serviceServer)
Called when a new
ServiceServer is added. |
void |
onServiceServerRemoved(DefaultServiceServer<?,?> serviceServer)
Called when a new
ServiceServer is added. |
void |
onSubscriberAdded(DefaultSubscriber<?> subscriber)
Called when a
Subscriber is added. |
void |
onSubscriberRemoved(DefaultSubscriber<?> subscriber)
Called when a
Subscriber is removed. |
void |
setRetryDelay(long delay,
java.util.concurrent.TimeUnit unit)
Failed registration actions are retried periodically until they succeed.
|
void |
shutdown()
Shuts down the
Registrar . |
void |
start(NodeIdentifier nodeIdentifier)
|
public Registrar(MasterClient masterClient, java.util.concurrent.ScheduledExecutorService executorService)
masterClient
- a MasterClient
for communicating with the ROS masterexecutorService
- a ScheduledExecutorService
to be used for all asynchronous
operationspublic void setRetryDelay(long delay, java.util.concurrent.TimeUnit unit)
delay
- the delay in units of unit
between retriesunit
- the unit of delay
public void onPublisherAdded(DefaultPublisher<?> publisher)
TopicParticipantManagerListener
Publisher
is added.onPublisherAdded
in interface TopicParticipantManagerListener
publisher
- the Publisher
that was addedpublic void onPublisherRemoved(DefaultPublisher<?> publisher)
TopicParticipantManagerListener
Publisher
is removed.onPublisherRemoved
in interface TopicParticipantManagerListener
publisher
- the Publisher
that was removedpublic void onSubscriberAdded(DefaultSubscriber<?> subscriber)
TopicParticipantManagerListener
Subscriber
is added.onSubscriberAdded
in interface TopicParticipantManagerListener
subscriber
- the Subscriber
that was addedpublic void onSubscriberRemoved(DefaultSubscriber<?> subscriber)
TopicParticipantManagerListener
Subscriber
is removed.onSubscriberRemoved
in interface TopicParticipantManagerListener
subscriber
- the Subscriber
that was removedpublic void onServiceServerAdded(DefaultServiceServer<?,?> serviceServer)
ServiceManagerListener
ServiceServer
is added.onServiceServerAdded
in interface ServiceManagerListener
serviceServer
- the ServiceServer
that was addedpublic void onServiceServerRemoved(DefaultServiceServer<?,?> serviceServer)
ServiceManagerListener
ServiceServer
is added.onServiceServerRemoved
in interface ServiceManagerListener
serviceServer
- the ServiceServer
that was addedpublic void start(NodeIdentifier nodeIdentifier)
nodeIdentifier
- the NodeIdentifier
for the SlaveServer
this
Registrar
is responsible forpublic void shutdown()
Registrar
.
No further registration requests will be accepted. All queued registration
jobs have up to SHUTDOWN_TIMEOUT
SHUTDOWN_TIMEOUT_UNITS
to complete before being canceled.
Calling shutdown()
more than once has no effect.