|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.firebirdsql.pool.BlockingStack
Object stack that implements a blocking LIFO (last-in-first-out) stack. The implementation will block when the list is empty.
Nested Class Summary | |
protected class |
BlockingStack.Node
Container class for objects in the stack. |
Field Summary | |
protected BlockingStack.Node |
top
Actual top of the stack. |
protected java.lang.Object |
topLock
|
protected int |
waiting
Number of threads waiting for an object. |
Constructor Summary | |
BlockingStack()
|
Method Summary | |
protected java.lang.Object |
extract()
|
boolean |
isEmpty()
Checks to see if the stack is empty. |
java.lang.Object |
peek()
Return, but do not remove, the object at the top of the stack. |
java.lang.Object |
pop()
Return and remove the object at the top of the stack. |
java.lang.Object |
pop(long msec)
Return and remove the object at the top of the stack only if it is available within the specified number of milliseconds, otherwise return null. |
void |
push(java.lang.Object item)
Push an object onto the stack. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected BlockingStack.Node top
protected int waiting
protected java.lang.Object topLock
Constructor Detail |
public BlockingStack()
Method Detail |
public boolean isEmpty()
public java.lang.Object peek()
protected java.lang.Object extract()
public java.lang.Object pop() throws java.lang.InterruptedException
java.lang.InterruptedException
public java.lang.Object pop(long msec) throws java.lang.InterruptedException
msec
- to wait for an object before returning null.
java.lang.InterruptedException
public void push(java.lang.Object item) throws java.lang.InterruptedException
item
- to be pushed onto the stack.
java.lang.InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |