public class EventResult extends Object implements EventListener
Event
retrieval with an
EventListener
.
The getEventIterator(long)
and getEvents(long)
methods
will block until an event is delivered and then return the events. Note, that
only one of the methods can be called for an expected event delivery. Calling
the 'other' method will block until the next events are delivered.
Constructor and Description |
---|
EventResult(PrintWriter log)
Creates a new
EventResult . |
Modifier and Type | Method and Description |
---|---|
EventIterator |
getEventIterator(long wait)
Gets the events from the EventListener.
|
Event[] |
getEvents(long wait)
Gets the events from the EventListener.
|
void |
onEvent(EventIterator events)
Called when events are delivered.
|
public EventResult(PrintWriter log)
EventResult
.log
- log messages are written to this Logger
.public Event[] getEvents(long wait)
wait
milliseconds for the events.
If the events are not delivered within wait
time an empty
array is returned and a log message is written.
wait
- time in milliseconds to wait at most for Event
s.Event
s.public EventIterator getEventIterator(long wait)
wait
milliseconds for the events.
If the events are not delivered within wait
time
null
is returned and a log message is written.
wait
- time in milliseconds to wait at most for
EventIterator
.EventIterator
.public void onEvent(EventIterator events)
onEvent
in interface EventListener
events
- the events.Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.