|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.naming.config.XmlConfigurator
Configure an in-memory JNDI implementation using an XML configuration file.
Multiple named contexts can be configured, and names configured in the file
can be made relative to a base name. Use the "base" attribute of the context
element in the xml config to specify a base name and use the "name" attribute
to specify an external name for the context, which will be its key in
ContextBindings. Configurations added using
loadConfiguration(java.io.InputStream) add / update data for contexts already defined.
To destroy contexts already defined, use either
destroyInitialContext(), which destroys the "anonymous" context
(what new InitialContext() returns); or destroyAll(), which destroys
all defined contexts (named or "anonymous").
| Constructor Summary | |
XmlConfigurator()
|
|
| Method Summary | |
static void |
destroyAll()
Destroys all named contexts as well as "anonymous" context. |
static void |
destroyInitialContext()
Destroys "anonymous" initial context, destoying subcontexts recursively. |
static void |
loadConfiguration(java.io.InputStream inputFile)
Loads xml configuration data from inputFile. |
protected static void |
makeContexts(Config.Naming naming)
Creates naming contexts based on the configuration data in the input Config.Naming structure. |
protected static Config.Naming |
parseFile(java.io.InputStream inputFile)
Parses input file, returning a Config.Naming structure. |
protected static void |
setSystemProperties()
Sets System JNDI properties. |
static void |
setupInitialContext()
Sets up initial context using org.apache.naming.NamingContextFactory. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public XmlConfigurator()
| Method Detail |
public static void setupInitialContext()
throws javax.naming.NamingException
org.apache.naming.NamingContextFactory.
Also creates "env" subcontext in "java:comp" namespace.
javax.naming.NamingException - if a NamingException occurs.
public static void destroyInitialContext()
throws javax.naming.NamingException
javax.naming.NamingException - if a NamingException occurs
public static void destroyAll()
throws javax.naming.NamingException
javax.naming.NamingException - if a naming exception occursprotected static void setSystemProperties()
protected static Config.Naming parseFile(java.io.InputStream inputFile)
throws ParseException
Config.Naming structure.
inputFile - file to be parsed
ParseException - if an error occurs parsing the file
protected static void makeContexts(Config.Naming naming)
throws javax.naming.NamingException
Config.Naming structure.
Uses update semantics -- i.e., contexts / entries that already exist are updated with the data in the input configuration.
naming - Config.Naming structure containing the context
configuration data
javax.naming.NamingException - if a NamingException occurs
public static void loadConfiguration(java.io.InputStream inputFile)
throws javax.naming.NamingException,
ParseException
inputFile. Uses update
semantics -- i.e., does not clear and create new context(s) and
bindings, but adds to current definitions, overwriting previous
configuration when contexts or bindings already exist. To clear existing
configuration, use destroyInitialContext() or destroyAll().
inputFile - input xml configuration file
javax.naming.NamingException - if a NamingException occurs.
ParseException - if an error occurs parsing the configuration file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||