|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.util.concurrent.BatchSynchQueueBase.SynchRecordImpl<E>
public class BatchSynchQueueBase.SynchRecordImpl<E>
A SynchRecordImpl is used by a BatchSynchQueue
to pair together a producer with its data. This allows
the producer of data to be identified so that it can be unblocked when its data is consumed or sent errors when
its data cannot be consumed.
Field Summary | |
---|---|
(package private) E |
element
The data element associated with this item. |
(package private) BooleanLatch |
latch
A boolean latch that determines when the producer for this data item will be allowed to continue. |
Constructor Summary | |
---|---|
BatchSynchQueueBase.SynchRecordImpl(E e)
Create a new synch record. |
Method Summary | |
---|---|
E |
getElement()
Gets the data element contained by this record. |
void |
inError(Exception e)
Tells the synch queue to raise an exception with this elements producer. |
void |
releaseImmediately()
Immediately releases the producer of this data record. |
void |
reQueue()
Tells the synch queue to put this element back onto the queue instead of releasing its producer. |
void |
waitForConsumer()
Waits until the producer is given permission to proceded by a consumer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
BooleanLatch latch
E element
Constructor Detail |
---|
public BatchSynchQueueBase.SynchRecordImpl(E e)
e
- The data element that the record encapsulates.Method Detail |
---|
public void waitForConsumer()
public E getElement()
getElement
in interface SynchRecord<E>
public void releaseImmediately()
releaseImmediately
in interface SynchRecord<E>
public void reQueue()
SynchRef.unblockProducers()
method or
the releaseImmediately()
method.
This method will raise a runtime exception AlreadyUnblockedException
if the producer for this
element has already been unblocked.
reQueue
in interface SynchRecord<E>
public void inError(Exception e)
SynchRef.unblockProducers()
method or the
releaseImmediately()
method. The exception will be wrapped in a SynchException
before it is
raised on the producer.
This method is unusual in that it accepts an exception as an argument. This is non-standard but is used
because the exception is to be passed onto a different thread.
This method will raise a runtime exception AlreadyUnblockedException
if the producer for this
element has already been unblocked.
inError
in interface SynchRecord<E>
e
- The exception to raise on the producer.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |