|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.connecterra.util.event.EventReceiver
public class EventReceiver
An event receiver manages the accumulation and delivery of events to an event
processor. Many threads may post events through the event receiver, which
delivers them one at a time to the event processor. The event processor may
therefore rely on its always being executed by a single thread. The thread
that handles events is managed by a Scheduler
instance
associated with the event receiver.
Field Summary | |
---|---|
static int |
ALWAYS_QUEUE
|
static int |
BLOCK
|
static int |
DROP
|
static int |
THROW
|
Constructor Summary | |
---|---|
EventReceiver(String name,
EventProcessor eventProcessor,
com.connecterra.util.event.Scheduler scheduler,
int eventLimit)
Constructs a new event receiver for the specified event processor, using the specified scheduler to run the task that delivers events. |
Method Summary | |
---|---|
EventProcessor |
getEventProcessor()
|
void |
receiveEvent(Object event)
This is the same as EventReceiver.receiveEvent(java.lang.Object) called with the ALWAYS_QUEUE
argument, with the exceptions which cannot happen not declared. |
void |
receiveEventOrBlock(Object event)
This is the same as EventReceiver.receiveEvent(java.lang.Object) called with the BLOCK argument,
with the exceptions which cannot happen not declared. |
boolean |
receiveEventOrDrop(Object event)
This is the same as EventReceiver.receiveEvent(java.lang.Object) called with the DROP argument,
with the exceptions which cannot happen not declared. |
void |
receiveEventOrThrow(Object event)
This is the same as EventReceiver.receiveEvent(java.lang.Object) called with the THROW argument,
with the exceptions which cannot happen not declared. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALWAYS_QUEUE
public static final int DROP
public static final int THROW
public static final int BLOCK
Constructor Detail |
---|
public EventReceiver(String name, EventProcessor eventProcessor, com.connecterra.util.event.Scheduler scheduler, int eventLimit)
name
- used to identify this queue in log messages and other
user-visible contextseventProcessor
- the object to which events should be deliveredscheduler
- the schedulers on which the event delivery task should be
queued.eventLimit
- the high water mark for the queue. See
EventReceiver.receiveEvent(Object, int)
for more information. This
value must be greater than or equal to -1. -1 or 0 is treated
as no limit.Method Detail |
---|
public EventProcessor getEventProcessor()
EventProcessor
used to create this event receiver.public void receiveEvent(Object event)
EventReceiver.receiveEvent(java.lang.Object)
called with the ALWAYS_QUEUE
argument, with the exceptions which cannot happen not declared.
public boolean receiveEventOrDrop(Object event)
EventReceiver.receiveEvent(java.lang.Object)
called with the DROP argument,
with the exceptions which cannot happen not declared.
public void receiveEventOrThrow(Object event) throws QueueFullException
EventReceiver.receiveEvent(java.lang.Object)
called with the THROW argument,
with the exceptions which cannot happen not declared.
QueueFullException
public void receiveEventOrBlock(Object event) throws InterruptedException
EventReceiver.receiveEvent(java.lang.Object)
called with the BLOCK argument,
with the exceptions which cannot happen not declared.
InterruptedException
public String toString()
toString
in class Object
|
Documentation is available at ${DOCSWEBROOT} Copyright 2007 BEA Systems Inc. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |