|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.excalibur.event.impl.AbstractQueue
public abstract class AbstractQueue
Provides the base functionality for the other Queue types.
| Field Summary | |
|---|---|
protected static java.lang.Object[] |
EMPTY_ARRAY
An empty array used as a return value when the Queue is empty |
protected org.apache.excalibur.event.DequeueInterceptor |
m_interceptor
|
protected org.apache.excalibur.event.EnqueuePredicate |
m_predicate
|
protected long |
m_timeout
The number of milliseconds to wait |
| Fields inherited from interface org.apache.excalibur.event.Queue |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractQueue()
|
|
| Method Summary | |
|---|---|
protected void |
block(java.lang.Object lock)
Encapsulates the logic to block the Queue for the amount
of time specified by the timeout. |
int |
canAccept()
Default for canAccept() |
org.apache.excalibur.event.DequeueInterceptor |
getDequeueInterceptor()
Return the dequeue executable for this sink. |
org.apache.excalibur.event.EnqueuePredicate |
getEnqueuePredicate()
Return the EnqueuePredicate that is already set for this Queue. |
boolean |
isFull()
Check to see if the Queue is full. |
int |
maxSize()
Default maxSize to -1 which is unbounded |
void |
setDequeueInterceptor(org.apache.excalibur.event.DequeueInterceptor executable)
Set the dequeue executable for this sink. |
void |
setEnqueuePredicate(org.apache.excalibur.event.EnqueuePredicate predicate)
Set the EnqueuePredicate to limit entries into this Queue. |
void |
setTimeout(long millis)
Set the timeout for the Queue in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.excalibur.event.Source |
|---|
dequeue, dequeue, dequeueAll, size |
| Methods inherited from interface org.apache.excalibur.event.Sink |
|---|
enqueue, enqueue, prepareEnqueue, size, tryEnqueue |
| Field Detail |
|---|
protected static final java.lang.Object[] EMPTY_ARRAY
protected long m_timeout
protected org.apache.excalibur.event.EnqueuePredicate m_predicate
protected org.apache.excalibur.event.DequeueInterceptor m_interceptor
| Constructor Detail |
|---|
public AbstractQueue()
| Method Detail |
|---|
public int canAccept()
canAccept in interface org.apache.excalibur.event.Sinkpublic int maxSize()
maxSize in interface org.apache.excalibur.event.Sinkpublic boolean isFull()
Queue is full. The method uses the
maxSize and size methods to determine
whether the queue is full.
isFull in interface org.apache.excalibur.event.Sinkpublic void setTimeout(long millis)
Queue in milliseconds. The
default timeout is 0, which means that we don't wait at all.
setTimeout in interface org.apache.excalibur.event.Sourcemillis - The number of milliseconds to block waiting for events to be enqueuedprotected void block(java.lang.Object lock)
Queue for the amount
of time specified by the timeout.
lock - The object used as the mutex.public void setEnqueuePredicate(org.apache.excalibur.event.EnqueuePredicate predicate)
setEnqueuePredicate in interface org.apache.excalibur.event.Queuepublic org.apache.excalibur.event.EnqueuePredicate getEnqueuePredicate()
getEnqueuePredicate in interface org.apache.excalibur.event.Queuepublic void setDequeueInterceptor(org.apache.excalibur.event.DequeueInterceptor executable)
setDequeueInterceptor in interface org.apache.excalibur.event.Queueexecutable - The dequeue executable for this sink.public org.apache.excalibur.event.DequeueInterceptor getDequeueInterceptor()
getDequeueInterceptor in interface org.apache.excalibur.event.QueueDequeueInterceptor
The dequeue executable for this sink.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||