public abstract class AbstractContext extends Object implements Context, NestedContextFactory, Serializable
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| Modifier | Constructor and Description |
|---|---|
protected |
AbstractContext(String nameInNamespace) |
|
AbstractContext(String nameInNamespace,
ContextAccess contextAccess) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBinding(Context context,
String name,
Object value,
boolean rebind)
Binds the specified value to the specified name within the specified context.
|
protected abstract boolean |
addBinding(String name,
Object value,
boolean rebind) |
protected void |
addDeepBinding(Name name,
Object value,
boolean rebind,
boolean createIntermediateContexts) |
Object |
addToEnvironment(String propName,
Object propVal) |
void |
bind(Name name,
Object obj) |
void |
bind(String name,
Object obj) |
void |
close() |
Name |
composeName(Name name,
Name prefix) |
String |
composeName(String name,
String prefix) |
Context |
createSubcontext(Name name) |
Context |
createSubcontext(String name) |
protected Context |
createSubcontextTree(String path,
Name name,
Object value)
Creates a context tree which will be rooted at the specified path and contain a single entry located down
a path specified by the name.
|
void |
destroySubcontext(Name name) |
void |
destroySubcontext(String name) |
protected Object |
faultLookup(String stringName,
Name parsedName)
When a value can not be found within this context, this method is called as a last ditch effort befrore
thowing a null pointer exception.
|
protected Object |
getBinding(String name)
Gets the object bound to the name.
|
protected abstract Map<String,Object> |
getBindings()
Gets a map of the bindings for the current node (i.e., no names with slashes).
|
protected ContextAccess |
getContextAccess() |
protected Object |
getDeepBinding(String name)
Gets the object bound to the name.
|
Hashtable |
getEnvironment()
Always returns a new (empty) Hashtable.
|
String |
getNameInNamespace()
Gets the name of this context withing the global namespace.
|
protected Name |
getNameInNamespace(Name path)
Gets the name of a path withing the global namespace context.
|
protected String |
getNameInNamespace(String path)
Gets the name of a path withing the global namespace context.
|
protected NameParser |
getNameParser()
A parser that can turn Strings into javax.naming.Name objects.
|
NameParser |
getNameParser(Name name) |
NameParser |
getNameParser(String name) |
protected Name |
getParsedNameInNamespace()
Gets the name of this context withing the global namespace.
|
protected static int |
getSize(Context context) |
protected static boolean |
isEmpty(Context context) |
protected NamingEnumeration<NameClassPair> |
list() |
NamingEnumeration<NameClassPair> |
list(Name name) |
NamingEnumeration<NameClassPair> |
list(String name) |
protected NamingEnumeration<Binding> |
listBindings() |
NamingEnumeration<Binding> |
listBindings(Name name) |
NamingEnumeration<Binding> |
listBindings(String name) |
Object |
lookup(Name name) |
Object |
lookup(String name) |
protected Object |
lookup(String stringName,
Name parsedName)
Finds the specified entry.
|
protected Context |
lookupFinalContext(Name name) |
Object |
lookupLink(Name name) |
Object |
lookupLink(String name) |
void |
rebind(Name name,
Object obj) |
void |
rebind(String name,
Object obj) |
protected abstract boolean |
removeBinding(String name,
boolean removeNotEmptyContext)
Removes the binding from the context.
|
protected void |
removeDeepBinding(Name name,
boolean pruneEmptyContexts) |
protected void |
removeDeepBinding(Name name,
boolean pruneEmptyContexts,
boolean removeNotEmptyContext) |
Object |
removeFromEnvironment(String propName) |
void |
rename(Name oldName,
Name newName) |
void |
rename(String oldName,
String newName) |
void |
unbind(Name name) |
void |
unbind(String name) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateNestedSubcontext, isNestedSubcontextprotected AbstractContext(String nameInNamespace)
public AbstractContext(String nameInNamespace, ContextAccess contextAccess)
public void close()
throws NamingException
close in interface ContextNamingExceptionprotected ContextAccess getContextAccess()
protected Object getDeepBinding(String name)
name - the nameprotected Object getBinding(String name) throws NamingException
name - the nameNamingException - on errorprotected Object lookup(String stringName, Name parsedName) throws NamingException
stringName - the string version of the name; maybe nullparsedName - the parsed name; may be nullNamingException - if no value is bound to that name or if a problem occurs during the lookupprotected Object faultLookup(String stringName, Name parsedName)
stringName - the string version of the name; will not be nullparsedName - the parsed name; will not be nullprotected Context lookupFinalContext(Name name) throws NamingException
NamingExceptionprotected abstract Map<String,Object> getBindings() throws NamingException
NamingException - if a problem occurs while getting the bindignsprotected void addDeepBinding(Name name, Object value, boolean rebind, boolean createIntermediateContexts) throws NamingException
NamingExceptionprotected void addBinding(Context context, String name, Object value, boolean rebind) throws NamingException
context - the context to add the binding toname - the binding namevalue - the value to bindrebind - if true, this method will replace any exsiting binding, otherwise a NamingException will be thrownNamingException - if a problem occurs while (re)bindingprotected abstract boolean addBinding(String name, Object value, boolean rebind) throws NamingException
NamingExceptionprotected Context createSubcontextTree(String path, Name name, Object value) throws NamingException
path - the path to the context that will contains this contextname - the name under which the value should be boundvalue - the valueNamingException - if a problem occurs while creating the subcontext treeprotected abstract boolean removeBinding(String name, boolean removeNotEmptyContext) throws NamingException
name - name under which the value should be boundremoveNotEmptyContext - ??? TODO figure this outNamingException - if a problem occurs during the bind such as a value already being boundprotected void removeDeepBinding(Name name, boolean pruneEmptyContexts) throws NamingException
NamingExceptionprotected void removeDeepBinding(Name name, boolean pruneEmptyContexts, boolean removeNotEmptyContext) throws NamingException
NamingExceptionprotected static boolean isEmpty(Context context) throws NamingException
NamingExceptionprotected static int getSize(Context context) throws NamingException
NamingExceptionpublic Hashtable getEnvironment()
getEnvironment in interface Contextpublic Object addToEnvironment(String propName, Object propVal) throws NamingException
addToEnvironment in interface ContextNamingExceptionpublic Object removeFromEnvironment(String propName) throws NamingException
removeFromEnvironment in interface ContextNamingExceptionpublic String getNameInNamespace()
getNameInNamespace in interface Contextprotected Name getParsedNameInNamespace()
protected String getNameInNamespace(String path)
path - path to extendprotected Name getNameInNamespace(Name path) throws NamingException
path - path to extendNamingException - on errorprotected NameParser getNameParser()
public NameParser getNameParser(Name name)
getNameParser in interface Contextpublic NameParser getNameParser(String name)
getNameParser in interface Contextpublic Name composeName(Name name, Name prefix) throws NamingException
composeName in interface ContextNamingExceptionpublic String composeName(String name, String prefix) throws NamingException
composeName in interface ContextNamingExceptionpublic Object lookup(String name) throws NamingException
lookup in interface ContextNamingExceptionpublic Object lookup(Name name) throws NamingException
lookup in interface ContextNamingExceptionpublic Object lookupLink(String name) throws NamingException
lookupLink in interface ContextNamingExceptionpublic Object lookupLink(Name name) throws NamingException
lookupLink in interface ContextNamingExceptionpublic void bind(String name, Object obj) throws NamingException
bind in interface ContextNamingExceptionpublic void bind(Name name, Object obj) throws NamingException
bind in interface ContextNamingExceptionpublic void rebind(String name, Object obj) throws NamingException
rebind in interface ContextNamingExceptionpublic void rebind(Name name, Object obj) throws NamingException
rebind in interface ContextNamingExceptionpublic void rename(String oldName, String newName) throws NamingException
rename in interface ContextNamingExceptionpublic void rename(Name oldName, Name newName) throws NamingException
rename in interface ContextNamingExceptionpublic void unbind(String name) throws NamingException
unbind in interface ContextNamingExceptionpublic void unbind(Name name) throws NamingException
unbind in interface ContextNamingExceptionprotected NamingEnumeration<NameClassPair> list() throws NamingException
NamingExceptionprotected NamingEnumeration<Binding> listBindings() throws NamingException
NamingExceptionpublic NamingEnumeration<NameClassPair> list(String name) throws NamingException
list in interface ContextNamingExceptionpublic NamingEnumeration<NameClassPair> list(Name name) throws NamingException
list in interface ContextNamingExceptionpublic NamingEnumeration<Binding> listBindings(String name) throws NamingException
listBindings in interface ContextNamingExceptionpublic NamingEnumeration<Binding> listBindings(Name name) throws NamingException
listBindings in interface ContextNamingExceptionpublic Context createSubcontext(String name) throws NamingException
createSubcontext in interface ContextNamingExceptionpublic Context createSubcontext(Name name) throws NamingException
createSubcontext in interface ContextNamingExceptionpublic void destroySubcontext(String name) throws NamingException
destroySubcontext in interface ContextNamingExceptionpublic void destroySubcontext(Name name) throws NamingException
destroySubcontext in interface ContextNamingExceptionCopyright © 2005-2015 The Apache Software Foundation. All Rights Reserved.