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.
|
default URI |
poll()
Get the location URI of the next entry from the queue without blocking.
|
ServiceURL |
pollService()
Get the next entry from the queue without blocking.
|
default URI |
take()
Get the location URI of the next entry from the queue, blocking until one is available or the thread is
interrupted.
|
ServiceURL |
takeService()
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 otherwisedefault URI 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 finisheddefault URI 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 entryServiceURL pollService()
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 finishedServiceURL takeService() 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 © 2017 JBoss by Red Hat. All rights reserved.