javax.naming.spi
Class DirectoryManager

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.naming.spi.NamingManager sample code for javax.naming.spi.NamingManager definition code for javax.naming.spi.NamingManager 
      extended by javax.naming.spi.DirectoryManager

public class DirectoryManager
extends NamingManager sample code for javax.naming.spi.NamingManager definition code for javax.naming.spi.NamingManager

This class contains methods for supporting DirContext implementations.

This class is an extension of NamingManager. It contains methods for use by service providers for accessing object factories and state factories, and for getting continuation contexts for supporting federation.

DirectoryManager is safe for concurrent access by multiple threads.

Except as otherwise noted, a Name, Attributes, or environment parameter passed to any method is owned by the caller. The implementation will not modify the object or keep a reference to it, although it may keep a reference to a clone or copy.

Since:
1.3
See Also:
DirObjectFactory sample code for javax.naming.spi.DirObjectFactory definition code for javax.naming.spi.DirObjectFactory , DirStateFactory sample code for javax.naming.spi.DirStateFactory definition code for javax.naming.spi.DirStateFactory

Field Summary
 
Fields inherited from class javax.naming.spi.NamingManager sample code for javax.naming.spi.NamingManager definition code for javax.naming.spi.NamingManager
CPE sample code for javax.naming.spi.NamingManager.CPE definition code for javax.naming.spi.NamingManager.CPE
 
Method Summary
static DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext getContinuationDirContext sample code for javax.naming.spi.DirectoryManager.getContinuationDirContext(javax.naming.CannotProceedException) definition code for javax.naming.spi.DirectoryManager.getContinuationDirContext(javax.naming.CannotProceedException) (CannotProceedException sample code for javax.naming.CannotProceedException definition code for javax.naming.CannotProceedException  cpe)
          Creates a context in which to continue a DirContext operation.
static Object sample code for java.lang.Object definition code for java.lang.Object getObjectInstance sample code for javax.naming.spi.DirectoryManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) definition code for javax.naming.spi.DirectoryManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) (Object sample code for java.lang.Object definition code for java.lang.Object  refInfo, Name sample code for javax.naming.Name definition code for javax.naming.Name  name, Context sample code for javax.naming.Context definition code for javax.naming.Context  nameCtx, Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment, Attributes sample code for javax.naming.directory.Attributes definition code for javax.naming.directory.Attributes  attrs)
          Creates an instance of an object for the specified object, attributes, and environment.
static DirStateFactory.Result sample code for javax.naming.spi.DirStateFactory.Result definition code for javax.naming.spi.DirStateFactory.Result getStateToBind sample code for javax.naming.spi.DirectoryManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) definition code for javax.naming.spi.DirectoryManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) (Object sample code for java.lang.Object definition code for java.lang.Object  obj, Name sample code for javax.naming.Name definition code for javax.naming.Name  name, Context sample code for javax.naming.Context definition code for javax.naming.Context  nameCtx, Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment, Attributes sample code for javax.naming.directory.Attributes definition code for javax.naming.directory.Attributes  attrs)
          Retrieves the state of an object for binding when given the original object and its attributes.
 
Methods inherited from class javax.naming.spi.NamingManager sample code for javax.naming.spi.NamingManager definition code for javax.naming.spi.NamingManager
getContinuationContext sample code for javax.naming.spi.NamingManager.getContinuationContext(javax.naming.CannotProceedException) definition code for javax.naming.spi.NamingManager.getContinuationContext(javax.naming.CannotProceedException) , getInitialContext sample code for javax.naming.spi.NamingManager.getInitialContext(java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getInitialContext(java.util.Hashtable) , getObjectInstance sample code for javax.naming.spi.NamingManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) , getStateToBind sample code for javax.naming.spi.NamingManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) , getURLContext sample code for javax.naming.spi.NamingManager.getURLContext(java.lang.String, java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getURLContext(java.lang.String, java.util.Hashtable) , hasInitialContextFactoryBuilder sample code for javax.naming.spi.NamingManager.hasInitialContextFactoryBuilder() definition code for javax.naming.spi.NamingManager.hasInitialContextFactoryBuilder() , setInitialContextFactoryBuilder sample code for javax.naming.spi.NamingManager.setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder) definition code for javax.naming.spi.NamingManager.setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder) , setObjectFactoryBuilder sample code for javax.naming.spi.NamingManager.setObjectFactoryBuilder(javax.naming.spi.ObjectFactoryBuilder) definition code for javax.naming.spi.NamingManager.setObjectFactoryBuilder(javax.naming.spi.ObjectFactoryBuilder)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Method Detail

getContinuationDirContext sample code for javax.naming.spi.DirectoryManager.getContinuationDirContext(javax.naming.CannotProceedException) definition code for javax.naming.spi.DirectoryManager.getContinuationDirContext(javax.naming.CannotProceedException)

public static DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext  getContinuationDirContext(CannotProceedException sample code for javax.naming.CannotProceedException definition code for javax.naming.CannotProceedException  cpe)
                                            throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Creates a context in which to continue a DirContext operation. Operates just like NamingManager.getContinuationContext(), only the continuation context returned is a DirContext.

Parameters:
cpe - The non-null exception that triggered this continuation.
Returns:
A non-null DirContext object for continuing the operation.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception occurred.
See Also:
NamingManager.getContinuationContext(CannotProceedException) sample code for javax.naming.spi.NamingManager.getContinuationContext(javax.naming.CannotProceedException) definition code for javax.naming.spi.NamingManager.getContinuationContext(javax.naming.CannotProceedException)

getObjectInstance sample code for javax.naming.spi.DirectoryManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable<?, ?>, javax.naming.directory.Attributes) definition code for javax.naming.spi.DirectoryManager.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable<?, ?>, javax.naming.directory.Attributes)

public static Object sample code for java.lang.Object definition code for java.lang.Object  getObjectInstance(Object sample code for java.lang.Object definition code for java.lang.Object  refInfo,
                                       Name sample code for javax.naming.Name definition code for javax.naming.Name  name,
                                       Context sample code for javax.naming.Context definition code for javax.naming.Context  nameCtx,
                                       Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment,
                                       Attributes sample code for javax.naming.directory.Attributes definition code for javax.naming.directory.Attributes  attrs)
                                throws Exception sample code for java.lang.Exception definition code for java.lang.Exception 
Creates an instance of an object for the specified object, attributes, and environment.

This method is the same as NamingManager.getObjectInstance except for the following differences:

Service providers that implement the DirContext interface should use this method, not NamingManager.getObjectInstance().

Parameters:
refInfo - The possibly null object for which to create an object.
name - The name of this object relative to nameCtx. Specifying a name is optional; if it is omitted, name should be null.
nameCtx - The context relative to which the name parameter is specified. If null, name is relative to the default initial context.
environment - The possibly null environment to be used in the creation of the object factory and the object.
attrs - The possibly null attributes associated with refInfo. This might not be the complete set of attributes for refInfo; you might be able to read more attributes from the directory.
Returns:
An object created using refInfo and attrs; or refInfo if an object cannot be created by a factory.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception was encountered while attempting to get a URL context, or if one of the factories accessed throws a NamingException.
Exception sample code for java.lang.Exception definition code for java.lang.Exception - If one of the factories accessed throws an exception, or if an error was encountered while loading and instantiating the factory and object classes. A factory should only throw an exception if it does not want other factories to be used in an attempt to create an object. See DirObjectFactory.getObjectInstance().
Since:
1.3
See Also:
NamingManager.getURLContext(java.lang.String, java.util.Hashtable) sample code for javax.naming.spi.NamingManager.getURLContext(java.lang.String, java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getURLContext(java.lang.String, java.util.Hashtable) , DirObjectFactory sample code for javax.naming.spi.DirObjectFactory definition code for javax.naming.spi.DirObjectFactory , DirObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) sample code for javax.naming.spi.DirObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) definition code for javax.naming.spi.DirObjectFactory.getObjectInstance(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes)

getStateToBind sample code for javax.naming.spi.DirectoryManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable<?, ?>, javax.naming.directory.Attributes) definition code for javax.naming.spi.DirectoryManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable<?, ?>, javax.naming.directory.Attributes)

public static DirStateFactory.Result sample code for javax.naming.spi.DirStateFactory.Result definition code for javax.naming.spi.DirStateFactory.Result  getStateToBind(Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                                                    Name sample code for javax.naming.Name definition code for javax.naming.Name  name,
                                                    Context sample code for javax.naming.Context definition code for javax.naming.Context  nameCtx,
                                                    Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment,
                                                    Attributes sample code for javax.naming.directory.Attributes definition code for javax.naming.directory.Attributes  attrs)
                                             throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Retrieves the state of an object for binding when given the original object and its attributes.

This method is like NamingManager.getStateToBind except for the following differences:

Service providers that implement the DirContext interface should use this method, not NamingManager.getStateToBind().

See NamingManager.getStateToBind() for a description of how the list of state factories to be tried is determined.

The object returned by this method is owned by the caller. The implementation will not subsequently modify it. It will contain either a new Attributes object that is likewise owned by the caller, or a reference to the original attrs parameter.

Parameters:
obj - The non-null object for which to get state to bind.
name - The name of this object relative to nameCtx, or null if no name is specified.
nameCtx - The context relative to which the name parameter is specified, or null if name is relative to the default initial context.
environment - The possibly null environment to be used in the creation of the state factory and the object's state.
attrs - The possibly null Attributes that is to be bound with the object.
Returns:
A non-null DirStateFactory.Result containing the object and attributes to be bound. If no state factory returns a non-null answer, the result will contain the object (obj) itself with the original attributes.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If a naming exception was encountered while using the factories. A factory should only throw an exception if it does not want other factories to be used in an attempt to create an object. See DirStateFactory.getStateToBind().
Since:
1.3
See Also:
DirStateFactory sample code for javax.naming.spi.DirStateFactory definition code for javax.naming.spi.DirStateFactory , DirStateFactory.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) sample code for javax.naming.spi.DirStateFactory.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) definition code for javax.naming.spi.DirStateFactory.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable, javax.naming.directory.Attributes) , NamingManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) sample code for javax.naming.spi.NamingManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable) definition code for javax.naming.spi.NamingManager.getStateToBind(java.lang.Object, javax.naming.Name, javax.naming.Context, java.util.Hashtable)