Package org.apache.naming
Class NamingContext
java.lang.Object
org.apache.naming.NamingContext
- All Implemented Interfaces:
Context
Catalina JNDI Context implementation.
- Author:
- Remy Maucherat
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final HashMap<String,NamingEntry> Bindings in this Context.Environment.protected final StringName of the associated Catalina Context.protected static final NameParserName parser for this context.protected static final StringManagerThe string manager for this package.Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES -
Constructor Summary
ConstructorsConstructorDescriptionNamingContext(Hashtable<String, Object> env, String name) Builds a naming context.NamingContext(Hashtable<String, Object> env, String name, HashMap<String, NamingEntry> bindings) Builds a naming context. -
Method Summary
Modifier and TypeMethodDescriptionaddToEnvironment(String propName, Object propVal) voidvoidprotected voidBinds a name to an object.protected booleanThrows a naming exception is Context is not writable.voidclose()composeName(String name, String prefix) composeName(Name name, Name prefix) createSubcontext(String name) createSubcontext(Name name) voiddestroySubcontext(String name) voiddestroySubcontext(Name name) Hashtable<?,?> booleangetNameParser(String name) getNameParser(Name name) protected booleanlistBindings(String name) listBindings(Name name) protected ObjectRetrieves the named object.lookupLink(String name) lookupLink(Name name) voidvoidremoveFromEnvironment(String propName) voidvoidvoidsetExceptionOnFailedWrite(boolean exceptionOnFailedWrite) voidvoid
-
Field Details
-
nameParser
Name parser for this context. -
env
Environment. -
sm
The string manager for this package. -
bindings
Bindings in this Context. -
name
Name of the associated Catalina Context.
-
-
Constructor Details
-
NamingContext
Builds a naming context.- Parameters:
env- The environment to use to construct the naming contextname- The name of the associated Catalina Context
-
NamingContext
public NamingContext(Hashtable<String, Object> env, String name, HashMap<String, NamingEntry> bindings) Builds a naming context.- Parameters:
env- The environment to use to construct the naming contextname- The name of the associated Catalina Contextbindings- The initial bindings for the naming context
-
-
Method Details
-
getExceptionOnFailedWrite
public boolean getExceptionOnFailedWrite() -
setExceptionOnFailedWrite
public void setExceptionOnFailedWrite(boolean exceptionOnFailedWrite) -
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext
-
addToEnvironment
- Specified by:
addToEnvironmentin interfaceContext
-
removeFromEnvironment
- Specified by:
removeFromEnvironmentin interfaceContext
-
getEnvironment
- Specified by:
getEnvironmentin interfaceContext
-
close
- Specified by:
closein interfaceContext- Throws:
NamingException
-
getNameInNamespace
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
lookup
Retrieves the named object.- Parameters:
name- the name of the object to look upresolveLinks- If true, the links will be resolved- Returns:
- the object bound to name
- Throws:
NamingException- if a naming exception is encountered
-
bind
Binds a name to an object. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.- Parameters:
name- the name to bind; may not be emptyobj- the object to bind; possibly nullrebind- if true, then perform a rebind (ie, overwrite)- Throws:
NameAlreadyBoundException- if name is already boundInvalidAttributesException- if object did not supply all mandatory attributesNamingException- if a naming exception is encountered
-
isWritable
protected boolean isWritable()- Returns:
trueif writing is allowed on this context.
-
checkWritable
Throws a naming exception is Context is not writable.- Returns:
trueif the Context is writable- Throws:
NamingException- if the Context is not writable andexceptionOnFailedWriteistrue
-