|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.ros.internal.node.topic.DefaultTopicParticipant
org.ros.internal.node.topic.DefaultSubscriber<T>
public class DefaultSubscriber<T>
Default implementation of a Subscriber.
| Field Summary |
|---|
| Fields inherited from interface org.ros.node.topic.Subscriber |
|---|
TOPIC_MESSAGE_TYPE_WILDCARD |
| Method Summary | ||
|---|---|---|
void |
addMessageListener(MessageListener<T> listener)
|
|
void |
addPublisher(PublisherIdentifier publisherIdentifier,
java.net.InetSocketAddress address)
|
|
void |
addSubscriberListener(SubscriberListener<T> listener)
Add a new lifecycle listener to the subscriber. |
|
boolean |
getLatchMode()
|
|
int |
getQueueLimit()
|
|
java.util.Collection<java.lang.String> |
getSupportedProtocols()
|
|
static
|
newDefault(NodeIdentifier nodeIdentifier,
TopicDeclaration description,
java.util.concurrent.ScheduledExecutorService executorService,
MessageDeserializer<S> deserializer)
|
|
void |
removeMessageListener(MessageListener<T> listener)
|
|
void |
removeSubscriberListener(SubscriberListener<T> listener)
Remove a lifecycle listener from the subscriber. |
|
void |
setQueueLimit(int limit)
|
|
void |
shutdown()
Shuts down and unregisters the Subscriber using the default timeout
for SubscriberListener.onShutdown(Subscriber) callbacks. |
|
void |
shutdown(long timeout,
java.util.concurrent.TimeUnit unit)
Shuts down and unregisters the Subscriber. |
|
void |
signalOnMasterRegistrationFailure()
Signal all SubscriberListeners that the Subscriber has
failed to register with the master. |
|
void |
signalOnMasterRegistrationSuccess()
Signal all SubscriberListeners that the Subscriber has
successfully registered with the master. |
|
void |
signalOnMasterUnregistrationFailure()
Signal all SubscriberListeners that the Subscriber has
failed to unregister with the master. |
|
void |
signalOnMasterUnregistrationSuccess()
Signal all SubscriberListeners that the Subscriber has
successfully unregistered with the master. |
|
void |
signalOnNewPublisher(PublisherIdentifier publisherIdentifier)
Signal all SubscriberListeners that a new Publisher has
connected. |
|
SubscriberDeclaration |
toDefinition()
|
|
SubscriberIdentifier |
toIdentifier()
|
|
java.lang.String |
toString()
|
|
void |
updatePublishers(java.util.Collection<PublisherIdentifier> publisherIdentifiers)
Updates the list of Publishers for the topic that this
Subscriber is interested in. |
|
| Methods inherited from class org.ros.internal.node.topic.DefaultTopicParticipant |
|---|
getTopicDeclaration, getTopicDeclarationAsList, getTopicDeclarationHeader, getTopicMessageType, getTopicName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.ros.internal.node.topic.TopicParticipant |
|---|
getTopicMessageType, getTopicName |
| Method Detail |
|---|
public static <S> DefaultSubscriber<S> newDefault(NodeIdentifier nodeIdentifier,
TopicDeclaration description,
java.util.concurrent.ScheduledExecutorService executorService,
MessageDeserializer<S> deserializer)
public SubscriberIdentifier toIdentifier()
public SubscriberDeclaration toDefinition()
public java.util.Collection<java.lang.String> getSupportedProtocols()
public boolean getLatchMode()
getLatchMode in interface Subscriber<T>true if the Publisher of this Subscriber's
topic is latched, false otherwisepublic void addMessageListener(MessageListener<T> listener)
addMessageListener in interface Subscriber<T>listener - this MessageListener will be called for every new message
receivedpublic void removeMessageListener(MessageListener<T> listener)
removeMessageListener in interface Subscriber<T>listener - the MessageListener to remove
public void addPublisher(PublisherIdentifier publisherIdentifier,
java.net.InetSocketAddress address)
public void updatePublishers(java.util.Collection<PublisherIdentifier> publisherIdentifiers)
Publishers for the topic that this
Subscriber is interested in.
publisherIdentifiers - Collection of PublisherIdentifiers for the
subscribed topic
public void shutdown(long timeout,
java.util.concurrent.TimeUnit unit)
SubscriberSubscriber. using the default
timeout Shutdown is delayed by at most the specified timeout to allow
SubscriberListener.onShutdown(Subscriber) callbacks to complete.
SubscriberListener.onShutdown(Subscriber) callbacks are executed in
separate threads.
shutdown in interface Subscriber<T>public void shutdown()
SubscriberSubscriber using the default timeout
for SubscriberListener.onShutdown(Subscriber) callbacks.
SubscriberListener.onShutdown(Subscriber) callbacks are executed in
separate threads.
shutdown in interface Subscriber<T>Subscriber.shutdown(long, TimeUnit)public void addSubscriberListener(SubscriberListener<T> listener)
Subscriber
addSubscriberListener in interface Subscriber<T>listener - The listener to add.public void removeSubscriberListener(SubscriberListener<T> listener)
SubscriberNothing will happen if the given listener is not registered.
removeSubscriberListener in interface Subscriber<T>listener - The listener to remove.public void signalOnMasterRegistrationSuccess()
SubscriberListeners that the Subscriber has
successfully registered with the master.
Each listener is called in a separate thread.
signalOnMasterRegistrationSuccess in class DefaultTopicParticipantpublic void signalOnMasterRegistrationFailure()
SubscriberListeners that the Subscriber has
failed to register with the master.
Each listener is called in a separate thread.
signalOnMasterRegistrationFailure in class DefaultTopicParticipantpublic void signalOnMasterUnregistrationSuccess()
SubscriberListeners that the Subscriber has
successfully unregistered with the master.
Each listener is called in a separate thread.
signalOnMasterUnregistrationSuccess in class DefaultTopicParticipantpublic void signalOnMasterUnregistrationFailure()
SubscriberListeners that the Subscriber has
failed to unregister with the master.
Each listener is called in a separate thread.
signalOnMasterUnregistrationFailure in class DefaultTopicParticipantpublic void signalOnNewPublisher(PublisherIdentifier publisherIdentifier)
SubscriberListeners that a new Publisher has
connected.
Each listener is called in a separate thread.
public java.lang.String toString()
toString in class java.lang.Objectpublic void setQueueLimit(int limit)
setQueueLimit in interface Subscriber<T>limit - the maximum number of incoming messages to queue (i.e. buffer)public int getQueueLimit()
getQueueLimit in interface Subscriber<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||