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, wait
createNestedSubcontext, isNestedSubcontext
protected AbstractContext(String nameInNamespace)
public AbstractContext(String nameInNamespace, ContextAccess contextAccess)
public void close() throws NamingException
close
in interface Context
NamingException
protected 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
NamingException
protected 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
NamingException
protected 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
NamingException
protected 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
NamingException
protected void removeDeepBinding(Name name, boolean pruneEmptyContexts, boolean removeNotEmptyContext) throws NamingException
NamingException
protected static boolean isEmpty(Context context) throws NamingException
NamingException
protected static int getSize(Context context) throws NamingException
NamingException
public Hashtable getEnvironment()
getEnvironment
in interface Context
public Object addToEnvironment(String propName, Object propVal) throws NamingException
addToEnvironment
in interface Context
NamingException
public Object removeFromEnvironment(String propName) throws NamingException
removeFromEnvironment
in interface Context
NamingException
public String getNameInNamespace()
getNameInNamespace
in interface Context
protected 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 Context
public NameParser getNameParser(String name)
getNameParser
in interface Context
public Name composeName(Name name, Name prefix) throws NamingException
composeName
in interface Context
NamingException
public String composeName(String name, String prefix) throws NamingException
composeName
in interface Context
NamingException
public Object lookup(String name) throws NamingException
lookup
in interface Context
NamingException
public Object lookup(Name name) throws NamingException
lookup
in interface Context
NamingException
public Object lookupLink(String name) throws NamingException
lookupLink
in interface Context
NamingException
public Object lookupLink(Name name) throws NamingException
lookupLink
in interface Context
NamingException
public void bind(String name, Object obj) throws NamingException
bind
in interface Context
NamingException
public void bind(Name name, Object obj) throws NamingException
bind
in interface Context
NamingException
public void rebind(String name, Object obj) throws NamingException
rebind
in interface Context
NamingException
public void rebind(Name name, Object obj) throws NamingException
rebind
in interface Context
NamingException
public void rename(String oldName, String newName) throws NamingException
rename
in interface Context
NamingException
public void rename(Name oldName, Name newName) throws NamingException
rename
in interface Context
NamingException
public void unbind(String name) throws NamingException
unbind
in interface Context
NamingException
public void unbind(Name name) throws NamingException
unbind
in interface Context
NamingException
protected NamingEnumeration<NameClassPair> list() throws NamingException
NamingException
protected NamingEnumeration<Binding> listBindings() throws NamingException
NamingException
public NamingEnumeration<NameClassPair> list(String name) throws NamingException
list
in interface Context
NamingException
public NamingEnumeration<NameClassPair> list(Name name) throws NamingException
list
in interface Context
NamingException
public NamingEnumeration<Binding> listBindings(String name) throws NamingException
listBindings
in interface Context
NamingException
public NamingEnumeration<Binding> listBindings(Name name) throws NamingException
listBindings
in interface Context
NamingException
public Context createSubcontext(String name) throws NamingException
createSubcontext
in interface Context
NamingException
public Context createSubcontext(Name name) throws NamingException
createSubcontext
in interface Context
NamingException
public void destroySubcontext(String name) throws NamingException
destroySubcontext
in interface Context
NamingException
public void destroySubcontext(Name name) throws NamingException
destroySubcontext
in interface Context
NamingException
Copyright © 2005-2021. All Rights Reserved.