javax.naming.spi
public class NamingManager extends Object
Field Summary | |
---|---|
static String | CPE
The environment property into which getContinuationContext() stores the
value of the CannotProceedException parameter. |
Method Summary | |
---|---|
static Context | getContinuationContext(CannotProceedException cpe)
Creates a context in which the context operation must be continued.
|
static Context | getInitialContext(Hashtable<?,?> environment)
Creates the initial context. |
static Object | getObjectInstance(Object refInfo, Name name, Context nameCtx, Hashtable<?,?> environment) Creates an object for the specified name context, environment and referencing context object. If the builder factory is set by {@link #setObjectFactoryBuilder(ObjectFactoryBuilder)}, the call is delegated to that factory. |
static Object | getStateToBind(Object obj, Name name, Context nameCtx, Hashtable<?,?> environment)
Get the object state for binding.
|
static Context | getURLContext(String scheme, Hashtable<?,?> environment) Creates the URL context for the given URL scheme id. |
static boolean | hasInitialContextFactoryBuilder()
Checks if the initial context factory builder has been set.
|
static void | setInitialContextFactoryBuilder(InitialContextFactoryBuilder builder)
Sets the initial context factory builder.
|
static void | setObjectFactoryBuilder(ObjectFactoryBuilder builder)
Sets the initial object factory builder.
|
Parameters: cpe the exception that triggered this continuation. This method obtains the environment ({@link CannotProceedException#getEnvironment()} and sets the environment property {@link #CPE} = cpe.
Returns: a non null context for continuing the operation
Throws: NamingException if the naming problems have occured
Parameters: environment the properties, used to create the context.
Returns: the created context
Throws: NoInitialContextException if the initial builder is not set, the property Context.INITIAL_CONTEXT_FACTORY is missing of the class, named by this property, cannot be instantiated. NamingException if throws by the context factory
Creates an object for the specified name context, environment and referencing context object.
If the builder factory is set by {@link #setObjectFactoryBuilder(ObjectFactoryBuilder)}, the call is delegated to that factory. Otherwise, the object is created using the following rules:
The object factory must be public and have the public parameterless constructor.
Parameters: refInfo the referencing object, for which the new object must be created (can be null). If not null, it is usually an instance of the {@link Reference} or {@link Referenceable}. name the name of the object. The name is relative to the nameCtx naming context. The value of this parameter can be null if the name is not specified. nameCtx the naming context, in which scope the name of the new object is specified. If this parameter is null, the name is specified in the scope of the initial context. environment contains additional information for creating the object. This paramter can be null if there is no need to provide any additional information.
Returns: the created object. If the creation fails, in some cases the parameter refInfo may be returned.
Throws: NamingException if the attempt to name the new object has failed Exception if the object factory throws it. The object factory only throws an exception if it does not want other factories to be used to create the object.
Parameters: obj the object, for that the binding state must be retrieved. Cannot be null. name the name of this object, related to the nameCtx. Can be null if not specified. nameCtx the naming context, to that the object name is related. Can be null if the name is related to the initial default context. environment the properties for creating the object state. Can be null if no properties are provided.
Returns: the object state for binding, may be null if no changes are returned by the factory
Throws: NamingException
Creates the URL context for the given URL scheme id.
The class name of the factory that creates the context has the naming pattern scheme-idURLContextFactory. For instance, the factory for the "ftp" scheme should be named "ftpURLContextFactory". The Context.URL_PKG_PREFIXES environment property contains the colon-separated list of the possible package prefixes. The package name is constructed by concatenating the package prefix with the scheme id.
If the factory class cannot be found in the specified packages, the system will try to use the default internal factory for the given scheme.
After the factory is instantiated, its method {@link ObjectFactory#getObjectInstance(Object, Name, Context, Hashtable)} is called to create and return the object instance.
Parameters: scheme the url scheme that must be supported by the given context environment the properties for creating the factory and context (may be null)
Returns: the created context
Throws: NamingException if thrown by the factory when creating the context.
Returns: true if the builder has been set
See Also: setInitialContextFactoryBuilder
Parameters: builder the builder to set
Throws: SecurityException if the builder cannot be installed due security restrictions. NamingException if the builder cannot be installed due other reasons IllegalStateException if setting the builder repeatedly
See Also: hasInitialContextFactoryBuilder
Parameters: builder the builder to set
Throws: SecurityException if the builder cannot be installed due security restrictions. NamingException if the builder cannot be installed due other reasons IllegalStateException if setting the builder repeatedly