org.springframework.ldap
Interface ContextExecutor


public interface ContextExecutor

Interface for delegating an actual operation to be performed on an DirContext. For searches, use SearchExecutor in stead. A typical usage of this interface could be e.g.:

 ContextExecutor executor = new ContextExecutor(){
   public Object executeWithContext(DirContext ctx) throws NamingException{
     return ctx.lookup(dn);
   }
 };
 

Author:
Mattias Arthursson
See Also:
LdapTemplate.executeReadOnly(ContextExecutor), LdapTemplate.executeReadWrite(ContextExecutor)

Method Summary
 java.lang.Object executeWithContext(javax.naming.directory.DirContext ctx)
          Perform any operation on the context.
 

Method Detail

executeWithContext

java.lang.Object executeWithContext(javax.naming.directory.DirContext ctx)
                                    throws javax.naming.NamingException
Perform any operation on the context.

Parameters:
ctx - the DirContext to perform the operation on.
Returns:
any object resulting from the operation - might be null.
Throws:
javax.naming.NamingException - if the operation resulted in one.


Copyright 2002-2006. All Rights Reserved.