public interface ServicesQueue extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
void |
await()
Wait for a queue entry to become available.
|
void |
await(long time,
TimeUnit unit)
Wait for a certain amount of time for a queue entry to become available.
|
void |
close()
Cancel any in-progress discovery for this queue.
|
boolean |
isFinished()
Query whether this queue is finished (all services have been read).
|
boolean |
isReady()
Query whether there is a value ready to be read.
|
URI |
poll()
Get the next entry from the queue without blocking.
|
URI |
take()
Get the next entry from the queue, blocking until one is available or the thread is interrupted.
|
default ServicesQueue |
withTimeout(long time,
TimeUnit unit)
Create a version of this queue which has an absolute timeout, relative to when this method is called.
|
void await()
throws InterruptedException
poll() will return a value (or
null if all services have been read) and take() will return without blocking.InterruptedException - if the calling thread was interrupted while waiting for the next entryvoid await(long time,
TimeUnit unit)
throws InterruptedException
time - the amount of time to waitunit - the unit of time (must not be null)InterruptedException - if the calling thread was interrupted while waiting for the next entryboolean isReady()
true if the queue has a value, false otherwiseURI poll()
null if there is no entry ready, or if
the queue is finished (all services have been read). Use isFinished() to distinguish the cases.null if the queue is not ready or is finishedURI take() throws InterruptedException
null if the queue is finished (all services have been read).null if the queue is finishedInterruptedException - if the calling thread was interrupted while waiting for the next entryboolean isFinished()
true if the queue is finished, false otherwisevoid close()
close in interface AutoCloseabledefault ServicesQueue withTimeout(long time, TimeUnit unit)
time - the timeout timeunit - the timeout unit (must not be null)null)Copyright © 2016 JBoss by Red Hat. All rights reserved.