Public Member Functions | |
LinkedQueueSynchroBuffer () | |
void | push (Object object) |
Object | take () |
void | push (Collection collection) |
void | setSynchroBufferListener (SynchroBufferListener listener) |
void | enable () |
void | disable () |
void | close () |
Private Attributes | |
SynchroBufferListener | listener = null |
LinkedQueue | buffer = new LinkedQueue() |
Thread | postman = new Thread(new Postman()) |
Static Private Attributes | |
final Logger | LOGGER = Logger.getLogger(LinkedQueueSynchroBuffer.class) |
|
The constructor. |
|
Close the input (head) end of the queue. It cannot be opened again. In this class, this is not implemented currently. |
|
Disable the listener. Pushed object are kept in the buffer and delivered when the listener is enabled. In this class, this is not implemented, if starting and stopping the listener input is required, use take() instead, as this gives full control to the consumer as to when it takes an element. |
|
Enable the listener. The listener is disabled by default. In this class, it should only be called once after the listener has been set to start receiving elements. |
|
Push a collection of objects into the buffer.
|
|
Push an object into the buffer.
|
|
Set the buffer consumer listener.
|
|
Atempt to take an object from the end buffer. There is a chance this was interrupted and null is returned.
|
|
The buffer. |
|
The single listener to which elements must be delivered. |
|
For logging. |
|
The thread to run to delivery to the listener. |