E
- The type of event.public final class JABufferedEventsQueue<E> extends Object implements BufferedEventsQueue<E>
Constructor and Description |
---|
JABufferedEventsQueue(EventQueue<ArrayList<E>> eventQueue)
Create a BufferedEventsQueue.
|
JABufferedEventsQueue(ThreadManager threadManager,
boolean autonomous)
Create a BufferedEventsQueue.
|
Modifier and Type | Method and Description |
---|---|
boolean |
dispatchEvents()
The dispatchEvents method processes any events in the queue.
|
EventQueue<ArrayList<E>> |
getEventQueue()
Returns the event queue.
|
boolean |
isEmpty()
The isEmpty method returns true when there are no pending events,
though the results may not always be correct due to concurrency issues.
|
void |
putBufferedEvents(ArrayList<E> bufferedEvents)
The putBufferedEvents method adds events to be processed.
|
void |
send(BufferedEventsDestination<E> destination,
E event)
Buffer the event for subsequent sending.
|
void |
sendPendingEvents()
Send any pending events.
|
void |
setActiveEventProcessor(EventProcessor<E> eventProcessor)
Specifies the object which will process the dispatched events.
|
void |
setInitialBufferCapacity(int initialBufferCapacity)
Set the initial capacity for buffered outgoing events.
|
public JABufferedEventsQueue(EventQueue<ArrayList<E>> eventQueue)
eventQueue
- Handles the actual dispatching of buffered events.public JABufferedEventsQueue(ThreadManager threadManager, boolean autonomous)
threadManager
- Provides a thread for processing dispatched events.autonomous
- Inhibits the acquireControl operation when true.public void setInitialBufferCapacity(int initialBufferCapacity)
setInitialBufferCapacity
in interface BufferedEventsQueue<E>
initialBufferCapacity
- The initial capacity for buffered outgoing events.public void send(BufferedEventsDestination<E> destination, E event)
send
in interface BufferedEventsQueue<E>
destination
- Buffered events receiver.event
- The event to be sent.public void sendPendingEvents()
sendPendingEvents
in interface BufferedEventsQueue<E>
public void putBufferedEvents(ArrayList<E> bufferedEvents)
putBufferedEvents
in interface BufferedEventsDestination<E>
bufferedEvents
- The events to be processed.public void setActiveEventProcessor(EventProcessor<E> eventProcessor)
setActiveEventProcessor
in interface EventDispatcher<E>
eventProcessor
- Processes the dispatched events.public boolean isEmpty()
isEmpty
in interface EventDispatcher<E>
public boolean dispatchEvents()
dispatchEvents
in interface EventDispatcher<E>
public EventQueue<ArrayList<E>> getEventQueue()
getEventQueue
in interface BufferedEventsQueue<E>
Copyright © 2012. All Rights Reserved.