Package org.ros.internal.node.client
Class Registrar
java.lang.Object
org.ros.internal.node.client.Registrar
- All Implemented Interfaces:
ServiceManagerListener,TopicParticipantManagerListener
public class Registrar
extends Object
implements TopicParticipantManagerListener, ServiceManagerListener
Manages topic, and service registrations of a
SlaveServer with the
MasterServer.- Author:
- kwc@willowgarage.com (Ken Conley), damonkohler@google.com (Damon Kohler)
-
Constructor Summary
ConstructorsConstructorDescriptionRegistrar(MasterClient masterClient, ScheduledExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionvoidonPublisherAdded(DefaultPublisher<?> publisher) Called when a newPublisheris added.voidonPublisherRemoved(DefaultPublisher<?> publisher) Called when a newPublisheris removed.voidonServiceServerAdded(DefaultServiceServer<?, ?> serviceServer) Called when a newServiceServeris added.voidonServiceServerRemoved(DefaultServiceServer<?, ?> serviceServer) Called when a newServiceServeris added.voidonSubscriberAdded(DefaultSubscriber<?> subscriber) Called when aSubscriberis added.voidonSubscriberRemoved(DefaultSubscriber<?> subscriber) Called when aSubscriberis removed.voidsetRetryDelay(long delay, TimeUnit unit) Failed registration actions are retried periodically until they succeed.voidshutdown()Shuts down theRegistrar.voidstart(NodeIdentifier nodeIdentifier)
-
Constructor Details
-
Registrar
- Parameters:
masterClient- aMasterClientfor communicating with the ROS masterexecutorService- aScheduledExecutorServiceto be used for all asynchronous operations
-
-
Method Details
-
setRetryDelay
Failed registration actions are retried periodically until they succeed. This method adjusts the delay between successive retry attempts for any particular registration action.- Parameters:
delay- the delay in units ofunitbetween retriesunit- the unit ofdelay
-
onPublisherAdded
Description copied from interface:TopicParticipantManagerListenerCalled when a newPublisheris added.- Specified by:
onPublisherAddedin interfaceTopicParticipantManagerListener- Parameters:
publisher- thePublisherthat was added
-
onPublisherRemoved
Description copied from interface:TopicParticipantManagerListenerCalled when a newPublisheris removed.- Specified by:
onPublisherRemovedin interfaceTopicParticipantManagerListener- Parameters:
publisher- thePublisherthat was removed
-
onSubscriberAdded
Description copied from interface:TopicParticipantManagerListenerCalled when aSubscriberis added.- Specified by:
onSubscriberAddedin interfaceTopicParticipantManagerListener- Parameters:
subscriber- theSubscriberthat was added
-
onSubscriberRemoved
Description copied from interface:TopicParticipantManagerListenerCalled when aSubscriberis removed.- Specified by:
onSubscriberRemovedin interfaceTopicParticipantManagerListener- Parameters:
subscriber- theSubscriberthat was removed
-
onServiceServerAdded
Description copied from interface:ServiceManagerListenerCalled when a newServiceServeris added.- Specified by:
onServiceServerAddedin interfaceServiceManagerListener- Parameters:
serviceServer- theServiceServerthat was added
-
onServiceServerRemoved
Description copied from interface:ServiceManagerListenerCalled when a newServiceServeris added.- Specified by:
onServiceServerRemovedin interfaceServiceManagerListener- Parameters:
serviceServer- theServiceServerthat was added
-
start
- Parameters:
nodeIdentifier- theNodeIdentifierfor theSlaveServerthisRegistraris responsible for
-
shutdown
public void shutdown()Shuts down theRegistrar.No further registration requests will be accepted. All queued registration jobs have up to
SHUTDOWN_TIMEOUTSHUTDOWN_TIMEOUT_UNITSto complete before being canceled.Calling
shutdown()more than once has no effect.
-