|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.excalibur.event.impl.AbstractQueue
Provides the base functionality for the other Queue
types.
Field Summary | |
protected static Object[] |
EMPTY_ARRAY
An empty array used as a return value when the Queue is empty |
protected long |
m_timeout
The number of milliseconds to wait |
Constructor Summary | |
AbstractQueue()
|
Method Summary | |
protected void |
block(Object lock)
Encapsulates the logic to block the Queue for the amount
of time specified by the timeout. |
int |
canAccept()
Default for canAccept() |
boolean |
isFull()
Check to see if the Queue is full. |
int |
maxSize()
Default maxSize to -1 which is unbounded |
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 Object[] EMPTY_ARRAY
protected long m_timeout
Constructor Detail |
public AbstractQueue()
Method Detail |
public int canAccept()
canAccept
in interface Sink
public int maxSize()
maxSize
in interface Sink
public boolean isFull()
Queue
is full. The method uses the
maxSize
and size
methods to determine
whether the queue is full.
isFull
in interface Sink
public void setTimeout(long millis)
Queue
in milliseconds. The
default timeout is 0, which means that we don't wait at all.
setTimeout
in interface Source
millis
- The number of milliseconds to block waiting for events to be enqueuedprotected void block(Object lock)
Queue
for the amount
of time specified by the timeout.
lock
- The object used as the mutex.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |