|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Sealable Queue may be sealed to prevent further elements from being added.
Once sealed, the Queue will also behave in a non-blocking fashion. Removal
operations that might have blocked on an empty Queue are expected to return
immediately. Unless otherwise specified, implementations can be expected
to be unsealed when first created. Add opertions to a SealedQueue should throw
a SealedQueueException
.
Implementations of this class are expected to be derived from Blocking Queues,
such as OrderedBlockingQueue
, and not from non-Blocking Queues, like
OrderedQueue
.
Method Summary | |
boolean |
isSealed()
Determines if the Queue is sealed. |
void |
seal()
Seals the Queue. |
void |
unseal()
Unseals the Queue. |
Methods inherited from interface net.sf.zig_project.gpl.common.queue.Queue |
clear, contains, elements, isEmpty, remove |
Method Detail |
public void seal()
public boolean isSealed()
public void unseal()
This method is provided as it improves flexibility with a minimum if additional difficulty. That is, reliance on this method may not be a good design. For example, if another thread is currently blocking in a remove operation, no guarantees are made that it will return immediately if the Queue is quickly sealed and then unsealed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |