org.apache.ldap.server.invocation
Class Invocation

java.lang.Object
  extended byorg.apache.ldap.server.invocation.Invocation
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
Add, Delete, GetMatchedDN, GetSuffix, HasEntry, IsSuffix, List, ListSuffixes, Lookup, LookupWithAttrIds, Modify, ModifyMany, ModifyRN, Move, MoveAndModifyRN, Search

public abstract class Invocation
extends java.lang.Object
implements java.io.Serializable

Represents a method invocation on BackingStores. You can perform any BackingStore calls by invoking JndiProvider.invoke(Invocation).

This class is abstract, and developers should extend this class to represent the actual method invocations.

Version:
$Rev: 159467 $, $Date: 2005-03-30 02:38:30 -0500 (Wed, 30 Mar 2005) $
Author:
Apache Directory Project
See Also:
Serialized Form

Field Summary
protected  java.util.Stack contextStack
           
protected  java.lang.Object returnValue
           
 
Constructor Summary
protected Invocation()
          Creates a new instance.
 
Method Summary
protected abstract  java.lang.Object doExecute(BackingStore store)
          Implement this method to invoke the appropriate operation on the specified store.
 void execute(BackingStore store)
          Executes this invocation on the specified store.
 java.util.Stack getContextStack()
          Gets the context stack in which this invocation occurs.
 java.lang.Object getReturnValue()
          Returns the returnValue object for this invocation.
 void setContextStack(java.util.Stack contextStack)
          Sets the context stack in which this invocation occurs.
 void setReturnValue(java.lang.Object returnValue)
          Sets the returnValue object for this invocation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

returnValue

protected transient java.lang.Object returnValue

contextStack

protected transient java.util.Stack contextStack
Constructor Detail

Invocation

protected Invocation()
Creates a new instance. This constructor does nothing.

Method Detail

getReturnValue

public java.lang.Object getReturnValue()
Returns the returnValue object for this invocation.


setReturnValue

public void setReturnValue(java.lang.Object returnValue)
Sets the returnValue object for this invocation.


getContextStack

public java.util.Stack getContextStack()
Gets the context stack in which this invocation occurs. The context stack is a stack of LdapContexts.

Returns:
a stack of LdapContexts in which the invocation occurs

setContextStack

public void setContextStack(java.util.Stack contextStack)
Sets the context stack in which this invocation occurs. The context stack is a stack of LdapContexts.

Parameters:
contextStack - a stack of LdapContexts in which the invocation occurs

execute

public void execute(BackingStore store)
             throws javax.naming.NamingException
Executes this invocation on the specified store. The default implementation calls an abstract method doExecute(BackingStore) and sets the returnValue property of this invocation to its return value.

Throws:
javax.naming.NamingException - if the operation failed

doExecute

protected abstract java.lang.Object doExecute(BackingStore store)
                                       throws javax.naming.NamingException
Implement this method to invoke the appropriate operation on the specified store. Returned value will be set as the returnValue proeprty of this invocation.

Throws:
javax.naming.NamingException - if the operation failed