All Packages Class Hierarchy This Package Previous Next Index
Class java.naming.spi.NamingManager
java.lang.Object
|
+----java.naming.spi.NamingManager
- public class NamingManager
- extends Object
The NamingManager class contains methods for creating context objects
and objects referred to by location information in the directory.
-
InitialContextFactoryProperty
- The name of the system or environment property containing the class name
of the initial context factory.
-
ObjectFactoryProperty
- The name of the system or environment property containing a colon-separated
list of class names of object factories to use for getObjectInstance().
-
getContinuationContext(Object, Properties)
- Creates a context in which to continue a context operation.
-
getInitialContext(Properties)
- Creates an initial context using the specified environment
properties.
-
getObjectInstance(Object, Properties)
- Creates an instance of an object for the specified object
and environment.
-
getURLContext(String, String, Properties)
- Creates a context for resolving the given URL.
-
hasInitialContextFactoryBuilder()
- Determines whether an initial context factory builder has
been set.
-
setInitialContextFactoryBuilder(InitialContextFactoryBuilder)
- Sets the InitialContextFactory builder to be builder.
-
setObjectFactoryBuilder(ObjectFactoryBuilder)
- The ObjectFactoryBuilder determines the policy used when
trying to load object factories.
ObjectFactoryProperty
public static final String ObjectFactoryProperty
- The name of the system or environment property containing a colon-separated
list of class names of object factories to use for getObjectInstance().
Its value is "jndi.objectFactories".
InitialContextFactoryProperty
public static final String InitialContextFactoryProperty
- The name of the system or environment property containing the class name
of the initial context factory. Its value is "jndi.initialContextFactory".
setObjectFactoryBuilder
public static synchronized void setObjectFactoryBuilder(ObjectFactoryBuilder builder) throws NamingException
- The ObjectFactoryBuilder determines the policy used when
trying to load object factories. The default policy is:
1. If object is a Reference, use information in the
reference to load its object factory.
2. Use any object factories specified in the "jndi.objectFactories"
property (an ordered, colon (':') separated factory class names).
setObjectFactoryBuilder() overrides this policy by installing
its own ObjectFactoryBuilder. Subsequent object factories will
be loaded and created using the installed builder.
- Parameters:
- builder - The factory builder to install.
- Throws: SecurityException
- Factory builder cannot be installed
for security reasons.
getObjectInstance
public static Object getObjectInstance(Object refInfo,
Properties environment) throws Exception
- Creates an instance of an object for the specified object
and environment.
If an object factory builder has been installed, use it to
create a factory for creating the object.
Otherwise, if 'obj' is a Reference or Referenceable, use information
in the reference to create a factory for creating the object.
Otherwise, use the specified object factories in the system property
"jndi.objectFactories" (a colon separated list of factory class names).
If cannot create object using any of these mechanisms, return
object passed in.
- Parameters:
- obj - The object for which to create an object.
- environment - Environment properties to be used in the creation
of the object factory and the object.
getURLContext
public static Context getURLContext(String scheme,
String url,
Properties environment) throws NamingException
- Creates a context for resolving the given URL.
The factory that creates the resulting context has the naming
convention ContextFactory (e.g. "ftpContextFactory" for
the "ftp" scheme-id).
- Parameters:
- scheme - The scheme-id of the URL.
- url - The URL that will be resolved by the resulting context.
- Returns:
- A context for resolving url; null if factory for creating
the context is not found.
getInitialContext
public static Context getInitialContext(Properties environment) throws NamingException
- Creates an initial context using the specified environment
properties. If an InitialContextFactoryBuilder has been installed,
it is used to create the factory for creating the initial context.
Otherwise, the class specified in the system property
"jndi.initialContextFactory" is used.
- Parameters:
- environment - Environment properties used when
creating the context.
- Returns:
- An initial context.
setInitialContextFactoryBuilder
public static synchronized void setInitialContextFactoryBuilder(InitialContextFactoryBuilder builder) throws NamingException
- Sets the InitialContextFactory builder to be builder.
- Parameters:
- builder - The initial context factory builder to install.
- Throws: SecurityException
- builder cannot be installed for security
reasons.
- See Also:
- hasInitialContextFactoryBuilder
hasInitialContextFactoryBuilder
public static boolean hasInitialContextFactoryBuilder() throws NamingException
- Determines whether an initial context factory builder has
been set.
- Returns:
- true if an initial context factory builder has
been set; false otherwise.
getContinuationContext
public static Context getContinuationContext(Object targetObj,
Properties environment) throws NamingException
- Creates a context in which to continue a context operation.
- Parameters:
- targetObj - Object containing information for
constructing continuation context object
- environment - Environment properties to use when
constructing context
- Returns:
- A Context object for continuing context operations.
All Packages Class Hierarchy This Package Previous Next Index