public class EventQueueAdapter extends AbstractEventHandler
QueueAdapter
that provides access to a
queue of RSB Event
s instead of directly to the payload data. It can
also be directly registered as handler in an rsb.Listener instance and used
for receiving and storing dispatched events.Constructor and Description |
---|
EventQueueAdapter()
Creates an adapter with a preset unlimited queue inside.
|
EventQueueAdapter(BlockingQueue<Event> queue)
Creates an adapter with the given queue implementation.
|
EventQueueAdapter(int capacity,
boolean discardOldest)
Creates an adapter with a preset queue inside that is limited to
capacity elements. |
Modifier and Type | Method and Description |
---|---|
BlockingQueue<Event> |
getQueue()
Provides access to the queue filled by this queue adapter.
|
void |
handleEvent(Event event)
Shall implement the real handling logic for an event.
|
internalNotify
public EventQueueAdapter()
public EventQueueAdapter(int capacity, boolean discardOldest)
capacity
elements.capacity
- capacity of the internal queuediscardOldest
- if true
, remove older events if the queue is
full, otherwise block until space is available on insertspublic EventQueueAdapter(BlockingQueue<Event> queue)
queue
- The queue this adapter should fill.public void handleEvent(Event event)
AbstractEventHandler
handleEvent
in class AbstractEventHandler
event
- the event to handlepublic BlockingQueue<Event> getQueue()
Copyright © 2018 CoR-Lab. All rights reserved.