|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ros.internal.node.CountDownRegistrantListener<Publisher<T>> org.ros.node.topic.CountDownPublisherListener<T>
public class CountDownPublisherListener<T>
A PublisherListener
which uses separate CountDownLatch
instances for all signals.
Method Summary | ||
---|---|---|
void |
awaitNewSubscriber()
Wait for the requested number of shutdowns. |
|
boolean |
awaitNewSubscriber(long timeout,
java.util.concurrent.TimeUnit unit)
Wait for the requested number of new subscribers within the given time period. |
|
void |
awaitShutdown()
Wait for for shutdown. |
|
boolean |
awaitShutdown(long timeout,
java.util.concurrent.TimeUnit unit)
Wait for shutdown within the given time period. |
|
static
|
newDefault()
|
|
static
|
newFromCounts(int masterRegistrationSuccessCount,
int masterRegistrationFailureCount,
int masterUnregistrationSuccessCount,
int masterUnregistrationFailureCount,
int newSubscriberCount)
|
|
void |
onNewSubscriber(Publisher<T> publisher,
SubscriberIdentifier subscriberIdentifier)
A Subscriber has connected to the Publisher . |
|
void |
onShutdown(Publisher<T> publisher)
The Publisher has been shut down. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.ros.internal.node.RegistrantListener |
---|
onMasterRegistrationFailure, onMasterRegistrationSuccess, onMasterUnregistrationFailure, onMasterUnregistrationSuccess |
Method Detail |
---|
public static <T> CountDownPublisherListener<T> newDefault()
public static <T> CountDownPublisherListener<T> newFromCounts(int masterRegistrationSuccessCount, int masterRegistrationFailureCount, int masterUnregistrationSuccessCount, int masterUnregistrationFailureCount, int newSubscriberCount)
masterRegistrationSuccessCount
- the number of successful master registrations to wait formasterRegistrationFailureCount
- the number of failing master registrations to wait formasterUnregistrationSuccessCount
- the number of successful master unregistrations to wait formasterUnregistrationFailureCount
- the number of failing master unregistrations to wait fornewSubscriberCount
- the number of new subscribers to wait forpublic void onNewSubscriber(Publisher<T> publisher, SubscriberIdentifier subscriberIdentifier)
PublisherListener
Subscriber
has connected to the Publisher
.
onNewSubscriber
in interface PublisherListener<T>
publisher
- the Publisher
that the Subscriber
connected tosubscriberIdentifier
- the SubscriberIdentifier
of the new Subscriber
public void onShutdown(Publisher<T> publisher)
PublisherListener
Publisher
has been shut down.
onShutdown
in interface PublisherListener<T>
publisher
- the Publisher
that was shut downpublic void awaitNewSubscriber() throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean awaitNewSubscriber(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- the maximum time to waitunit
- the TimeUnit
of the timeout
argument
true
if the requested number of new subscribers connect
within the time period false
otherwise.
java.lang.InterruptedException
public void awaitShutdown() throws java.lang.InterruptedException
java.lang.InterruptedException
public boolean awaitShutdown(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
timeout
- the maximum time to waitunit
- the TimeUnit
of the timeout
argument
true
if shutdown happened within the time period,
false
otherwise
java.lang.InterruptedException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |