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 delaypublic void onPublisherAdded(DefaultPublisher<?> publisher)
TopicParticipantManagerListenerPublisher is added.onPublisherAdded in interface TopicParticipantManagerListenerpublisher - the Publisher that was addedpublic void onPublisherRemoved(DefaultPublisher<?> publisher)
TopicParticipantManagerListenerPublisher is removed.onPublisherRemoved in interface TopicParticipantManagerListenerpublisher - the Publisher that was removedpublic void onSubscriberAdded(DefaultSubscriber<?> subscriber)
TopicParticipantManagerListenerSubscriber is added.onSubscriberAdded in interface TopicParticipantManagerListenersubscriber - the Subscriber that was addedpublic void onSubscriberRemoved(DefaultSubscriber<?> subscriber)
TopicParticipantManagerListenerSubscriber is removed.onSubscriberRemoved in interface TopicParticipantManagerListenersubscriber - the Subscriber that was removedpublic void onServiceServerAdded(DefaultServiceServer<?,?> serviceServer)
ServiceManagerListenerServiceServer is added.onServiceServerAdded in interface ServiceManagerListenerserviceServer - the ServiceServer that was addedpublic void onServiceServerRemoved(DefaultServiceServer<?,?> serviceServer)
ServiceManagerListenerServiceServer is added.onServiceServerRemoved in interface ServiceManagerListenerserviceServer - 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.