public interface EventAsyncConsumer extends EventConsumer
Title: Framework Support Library
Description: Defines an asynchronous Event Consumer wrapping an instance of the EventListener
.
Copyright: Copyright (c) 2010
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the underlying event queue.
|
int |
getCurrentDepth()
Returns the current number of events in the underlying queue.
|
DeliveryMode |
getDeliveryMode()
Returns a delivery mode of the underlying queue.
|
long |
getDeliverySpinWait()
Returns a delivery delay of the underlying queue.
|
FlowControlMode |
getFlowControlMode()
Returns a flow control mode of the underlying queue.
|
int |
getMaxDepth()
Returns a maximum depth of the underlying queue.
|
NotificationListener |
getNotificationListener()
Returns a notification listener associated with the underlying queue.
|
boolean |
isStarted()
Checks if the underlying event queue is started.
|
boolean |
isSuspended()
Checks if the underlying event queue is suspended.
|
ImmutableEventDatagram |
receive()
Returns a next available event in the event queue.
|
ImmutableEventDatagram |
receive(long waitTime)
Returns a next available event from the underlying queue.
|
ImmutableEventDatagram |
receive(java.lang.String eventSelector)
Returns a next event matching the specified event selector from the underlying queue.
|
ImmutableEventDatagram |
receive(java.lang.String eventSelector,
long waitTime)
Returns a next event matching the specified event selector from the underlying queue.
|
ImmutableEventDatagram |
receiveNoWait()
Returns a next event if one is immediately available or
null if there are none available. |
ImmutableEventDatagram |
receiveNoWait(java.lang.String eventSelector)
Returns a next event matching the specified event selector if one is available or
null if there are no matching
events found. |
void |
resume()
Resumes the underlying event queue.
|
void |
setDeliveryMode(DeliveryMode deliveryMode)
Sets a delivery mode of the underlying queue.
|
void |
setDeliverySpinWait(long deliverySpinWait)
Sets a delivery delay of the underlying queue.
|
void |
setFlowControlMode(FlowControlMode flowControlMode)
Sets a flow contol mode of the underlying queue.
|
void |
setMaxDepth(int maxDepth)
Sets a maximum depth of the underlying queue.
|
void |
setNotificationListener(NotificationListener notificationListener)
Sets a notification listener associated with the underlying queue.
|
void |
start()
Starts the underlying event queue.
|
void |
stop()
Stops the underlying event queue.
|
void |
stopDelayed(long timeout)
Performs a delayed stop of the underlying event queue.
|
void |
suspend()
Suspends the underlying event queue.
|
getCurrentState, getEventFilter, getEventListener, getEventSelector, getName, matchesEventId, setEventListener, setEventSelector
NotificationListener getNotificationListener()
void setNotificationListener(NotificationListener notificationListener)
notificationListener
- the associated notification listener to be set.int getMaxDepth()
void setMaxDepth(int maxDepth)
maxDepth
- the maximum depth of the underlying queue to be set.FlowControlMode getFlowControlMode()
void setFlowControlMode(FlowControlMode flowControlMode)
flowControlMode
- the flow control mode of the underlying queue to be set.DeliveryMode getDeliveryMode()
void setDeliveryMode(DeliveryMode deliveryMode) throws IllegalQueueStateException
deliveryMode
- the delivery mode of the underlying queue to be set.IllegalQueueStateException
- if the underlying event queue is not stopped.long getDeliverySpinWait()
void setDeliverySpinWait(long deliverySpinWait)
deliverySpinWait
- the delivery delay of the underlying queue.void start()
void stop()
void stopDelayed(long timeout)
timeout
- the wait time (in milliseconds) for processing of all events in the queue before stopping the delivery thread.boolean isStarted()
true
if the underlying event queue is started, false
otherwise.void suspend()
void resume()
boolean isSuspended()
true
if the underlying event queue is suspended, false
otherwise.void clear()
int getCurrentDepth()
ImmutableEventDatagram receive() throws EventQueueInterruptException
EventQueueInterruptException
ImmutableEventDatagram receive(long waitTime) throws EventQueueInterruptException
waitTime
- the specified waiting time interval.null
if the time interval has elapsed.EventQueueInterruptException
ImmutableEventDatagram receiveNoWait()
null
if there are none available.null
if there are no matching events.ImmutableEventDatagram receive(java.lang.String eventSelector) throws SelectorFormatException, EventQueueInterruptException
eventSelector
- The event selector allows to specify almost any conditions on event
properties' values which should be satisfied for an event to be consumed.
See EventDispatcher
for details.SelectorFormatException
EventQueueInterruptException
ImmutableEventDatagram receive(java.lang.String eventSelector, long waitTime) throws SelectorFormatException, EventQueueInterruptException
eventSelector
- The event selector allows to specify almost any conditions on event
properties' values which should be satisfied for an event to be consumed.
See EventDispatcher
for details.waitTime
- the specified waiting time interval.null
if the time interval has elapsed.SelectorFormatException
EventQueueInterruptException
ImmutableEventDatagram receiveNoWait(java.lang.String eventSelector) throws SelectorFormatException
null
if there are no matching
events found.eventSelector
- The event selector allows to specify almost any conditions on event
properties' values which should be satisfied for an event to be consumed.
See EventDispatcher
for details.null
if there are no matching events.SelectorFormatException
Copyright © 2015-2024 StreamScape Technologies. All rights reserved.