Class NamingContext
java.lang.Object
org.eclipse.jetty.jndi.NamingContext
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceNaming Context Listener.Nested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap<String, Binding> protected Stringprotected NamingContextprotected NameParserstatic final Stringstatic final Stringstatic final StringFields inherited from interface Context
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
ConstructorsModifierConstructorDescriptionNamingContext(Hashtable<String, Object> env, String name, NamingContext parent, NameParser parser) ConstructorprotectedNamingContext(Hashtable<String, Object> env, String name, NamingContext parent, NameParser parser, ConcurrentMap<String, Binding> bindings) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBinding(Name name, Object obj) Add a name to object binding to this Context.voidaddListener(NamingContext.Listener listener) addToEnvironment(String propName, Object propVal) Add an environment setting to this ContextvoidBind a name (as a String) to an objectvoidBind a name to an objectvoidclose()Do nothingcomposeName(String name, String prefix) Join two names together.composeName(Name name, Name prefix) Join two names together.createSubcontext(String name) Create a Context as a child of this onecreateSubcontext(Name name) Create a context as a child of this onevoiddestroySubcontext(String name) voiddestroySubcontext(Name name) dump()voiddump(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.getBinding(String name) Get a name to object binding from this ContextgetBinding(Name name) Get a name to object binding from this ContextGet the environment of this Context.getName()Getter for _nameGet the full name of this Context node by visiting it's ancestors back to root.getNameParser(String name) Return a NameParser for this Context.getNameParser(Name name) Return a NameParser for this Context.Getter for _parentbooleanbooleanisLocked()List all names bound at Context named by NameList all names bound at Context named by NamelistBindings(String name) List all Bindings at NamelistBindings(Name name) List all Bindings present at Context named by NameLookup binding of an object by nameLookup a binding by namelookupLink(String name) Lookup link bound to namelookupLink(Name name) Lookup link bound to namevoidOverwrite or create a binding from Name to ObjectvoidOverwrite or create a bindingvoidremoveBinding(Name name) removeFromEnvironment(String propName) Remove a property from this Context's environment.booleanremoveListener(NamingContext.Listener listener) voidNot supportedvoidNot supportedfinal voidvoidsetNameParser(NameParser parser) shallowCopy(Hashtable<String, Object> env) toCanonicalName(Name name) Remove leading or trailing empty components from name.toString()voidNot supported.voidNot supported.
-
Field Details
-
DEEP_BINDING
- See Also:
-
LOCK_PROPERTY
- See Also:
-
UNLOCK_PROPERTY
- See Also:
-
_env
-
_bindings
-
_parent
-
_name
-
_parser
-
-
Constructor Details
-
NamingContext
public NamingContext(Hashtable<String, Object> env, String name, NamingContext parent, NameParser parser) Constructor- Parameters:
env- environment properties which are copied into this Context's environmentname- relative name of this contextparent- immediate ancestor Context (can be null)parser- NameParser for this Context
-
NamingContext
protected NamingContext(Hashtable<String, Object> env, String name, NamingContext parent, NameParser parser, ConcurrentMap<String, Binding> bindings)
-
-
Method Details
-
shallowCopy
-
isDeepBindingSupported
public boolean isDeepBindingSupported() -
getName
-
getParent
-
setNameParser
-
setEnv
-
bind
Bind a name to an object- Specified by:
bindin interfaceContext- Parameters:
name- Name of the objectobj- object to bind- Throws:
NamingException- if an error occurs
-
bind
Bind a name (as a String) to an object- Specified by:
bindin interfaceContext- Parameters:
name- aStringvalueobj- anObjectvalue- Throws:
NamingException- if an error occurs
-
createSubcontext
Create a context as a child of this one- Specified by:
createSubcontextin interfaceContext- Parameters:
name- aNamevalue- Returns:
- a
Contextvalue - Throws:
NamingException- if an error occurs
-
createSubcontext
Create a Context as a child of this one- Specified by:
createSubcontextin interfaceContext- Parameters:
name- aStringvalue- Returns:
- a
Contextvalue - Throws:
NamingException- if an error occurs
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Parameters:
name- name of subcontext to remove- Throws:
NamingException- if an error occurs
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Parameters:
name- name of subcontext to remove- Throws:
NamingException- if an error occurs
-
lookup
Lookup a binding by name- Specified by:
lookupin interfaceContext- Parameters:
name- name of bound object- Throws:
NamingException- if an error occurs
-
lookup
Lookup binding of an object by name- Specified by:
lookupin interfaceContext- Parameters:
name- name of bound object- Returns:
- object bound to name
- Throws:
NamingException- if an error occurs
-
lookupLink
Lookup link bound to name- Specified by:
lookupLinkin interfaceContext- Parameters:
name- name of link binding- Returns:
- LinkRef or plain object bound at name
- Throws:
NamingException- if an error occurs
-
lookupLink
Lookup link bound to name- Specified by:
lookupLinkin interfaceContext- Parameters:
name- name of link binding- Returns:
- LinkRef or plain object bound at name
- Throws:
NamingException- if an error occurs
-
list
List all names bound at Context named by Name- Specified by:
listin interfaceContext- Parameters:
name- aNamevalue- Returns:
- a
NamingEnumerationvalue - Throws:
NamingException- if an error occurs
-
list
List all names bound at Context named by Name- Specified by:
listin interfaceContext- Parameters:
name- aNamevalue- Returns:
- a
NamingEnumerationvalue - Throws:
NamingException- if an error occurs
-
listBindings
List all Bindings present at Context named by Name- Specified by:
listBindingsin interfaceContext- Parameters:
name- aNamevalue- Returns:
- a
NamingEnumerationvalue - Throws:
NamingException- if an error occurs
-
listBindings
List all Bindings at Name- Specified by:
listBindingsin interfaceContext- Parameters:
name- aStringvalue- Returns:
- a
NamingEnumerationvalue - Throws:
NamingException- if an error occurs
-
rebind
Overwrite or create a binding- Specified by:
rebindin interfaceContext- Parameters:
name- aNamevalueobj- anObjectvalue- Throws:
NamingException- if an error occurs
-
rebind
Overwrite or create a binding from Name to Object- Specified by:
rebindin interfaceContext- Parameters:
name- aStringvalueobj- anObjectvalue- Throws:
NamingException- if an error occurs
-
unbind
Not supported.- Specified by:
unbindin interfaceContext- Parameters:
name- aStringvalue- Throws:
NamingException- if an error occurs
-
unbind
Not supported.- Specified by:
unbindin interfaceContext- Parameters:
name- aStringvalue- Throws:
NamingException- if an error occurs
-
rename
Not supported- Specified by:
renamein interfaceContext- Parameters:
oldName- aNamevaluenewName- aNamevalue- Throws:
NamingException- if an error occurs
-
rename
Not supported- Specified by:
renamein interfaceContext- Parameters:
oldName- aNamevaluenewName- aNamevalue- Throws:
NamingException- if an error occurs
-
composeName
Join two names together. These are treated as CompoundNames.- Specified by:
composeNamein interfaceContext- Parameters:
name- aNamevalueprefix- aNamevalue- Returns:
- a
Namevalue - Throws:
NamingException- if an error occurs
-
composeName
Join two names together. These are treated as CompoundNames.- Specified by:
composeNamein interfaceContext- Parameters:
name- aNamevalueprefix- aNamevalue- Returns:
- a
Namevalue - Throws:
NamingException- if an error occurs
-
close
Do nothing- Specified by:
closein interfaceContext- Throws:
NamingException- if an error occurs
-
getNameParser
Return a NameParser for this Context.- Specified by:
getNameParserin interfaceContext- Parameters:
name- aNamevalue- Returns:
- a
NameParservalue
-
getNameParser
Return a NameParser for this Context.- Specified by:
getNameParserin interfaceContext- Parameters:
name- aNamevalue- Returns:
- a
NameParservalue
-
getNameInNamespace
Get the full name of this Context node by visiting it's ancestors back to root. NOTE: if this Context has a URL namespace then the URL prefix will be missing- Specified by:
getNameInNamespacein interfaceContext- Returns:
- the full name of this Context
- Throws:
NamingException- if an error occurs
-
addToEnvironment
Add an environment setting to this Context- Specified by:
addToEnvironmentin interfaceContext- Parameters:
propName- name of the property to addpropVal- value of the property to add- Returns:
- propVal or previous value of the property
- Throws:
NamingException- if an error occurs
-
removeFromEnvironment
Remove a property from this Context's environment.- Specified by:
removeFromEnvironmentin interfaceContext- Parameters:
propName- name of property to remove- Returns:
- value of property or null if it didn't exist
- Throws:
NamingException- if an error occurs
-
getEnvironment
Get the environment of this Context.- Specified by:
getEnvironmentin interfaceContext- Returns:
- a copy of the environment of this Context.
-
addBinding
Add a name to object binding to this Context.- Parameters:
name- aNamevalueobj- anObjectvalue- Throws:
NameAlreadyBoundException- if name already bound
-
getBinding
-
getBinding
-
removeBinding
-
toCanonicalName
-
isLocked
public boolean isLocked() -
dump
-
dump
Description copied from interface:DumpableDump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-
addListener
-
removeListener
-
toString
-