org.apache.directory.server.core.invocation
Class InvocationStack

java.lang.Object
  extended byorg.apache.directory.server.core.invocation.InvocationStack

public final class InvocationStack
extends java.lang.Object

Keeps track of recursive Invocations. This stack assumes an invocation occurs in the same thread since it is called first, so we manages stacks for each invocation in ThreadLocal-like manner. You can just use getInstance() to get current invocation stack.

Using InvocationStack, you can find out current effective JNDI Context or detect infinite recursions.

Version:
$Rev: 434579 $, $Date: 2006-08-25 02:19:11 +0200 (Fri, 25 Aug 2006) $
Author:
Apache Directory Project

Method Summary
static InvocationStack getInstance()
          Returns the invocation stack of current thread.
 boolean isEmpty()
          Returns true if the stack is empty false otherwise.
 Invocation peek()
          Returns the latest invocation.
 Invocation pop()
          Pops the latest invocation from this stack.
 void push(Invocation invocation)
          Pushes the specified invocation to this stack.
 Invocation[] toArray()
          Returns an array of Invocations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static InvocationStack getInstance()
Returns the invocation stack of current thread.


toArray

public Invocation[] toArray()
Returns an array of Invocations. 0th element is the latest invocation.


peek

public Invocation peek()
Returns the latest invocation.


isEmpty

public boolean isEmpty()
Returns true if the stack is empty false otherwise.


push

public void push(Invocation invocation)
Pushes the specified invocation to this stack.


pop

public Invocation pop()
Pops the latest invocation from this stack. This stack is released automatically if you pop all items from this stack.