|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.jetty.jndi.NamingContext
public class NamingContext
NamingContext
Implementation of Context interface.
All Names are expected to be Compound, not Composite.
| Nested Class Summary | |
|---|---|
static interface |
NamingContext.Listener
Naming Context Listener. |
| Field Summary | |
|---|---|
protected Map<String,Binding> |
_bindings
|
protected Hashtable<String,Object> |
_env
|
protected String |
_name
|
protected NamingContext |
_parent
|
protected NameParser |
_parser
|
static String |
LOCK_PROPERTY
|
static String |
UNLOCK_PROPERTY
|
| 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 | |
|---|---|
NamingContext(Hashtable<String,Object> env,
String name,
NamingContext parent,
NameParser parser)
Constructor |
|
| Method Summary | |
|---|---|
void |
addBinding(Name name,
Object obj)
Add a name to object binding to this Context. |
void |
addListener(NamingContext.Listener listener)
|
Object |
addToEnvironment(String propName,
Object propVal)
Add an environment setting to this Context |
void |
bind(Name name,
Object obj)
Bind a name to an object |
void |
bind(String name,
Object obj)
Bind a name (as a String) to an object |
Object |
clone()
Clone this NamingContext |
void |
close()
Do nothing |
Name |
composeName(Name name,
Name prefix)
Join two names together. |
String |
composeName(String name,
String prefix)
Join two names together. |
Context |
createSubcontext(Name name)
Create a context as a child of this one |
Context |
createSubcontext(String name)
Create a Context as a child of this one |
void |
destroySubcontext(Name name)
|
void |
destroySubcontext(String name)
|
String |
dump()
|
void |
dump(Appendable out,
String indent)
|
Binding |
getBinding(Name name)
Get a name to object binding from this Context |
Binding |
getBinding(String name)
Get a name to object binding from this Context |
Map<String,Binding> |
getBindings()
|
Hashtable |
getEnvironment()
Get the environment of this Context. |
String |
getName()
Getter for _name |
String |
getNameInNamespace()
Get the full name of this Context node by visiting it's ancestors back to root. |
NameParser |
getNameParser(Name name)
Return a NameParser for this Context. |
NameParser |
getNameParser(String name)
Return a NameParser for this Context. |
Context |
getParent()
Getter for _parent |
boolean |
isLocked()
|
NamingEnumeration |
list(Name name)
List all names bound at Context named by Name |
NamingEnumeration |
list(String name)
List all names bound at Context named by Name |
NamingEnumeration |
listBindings(Name name)
List all Bindings present at Context named by Name |
NamingEnumeration |
listBindings(String name)
List all Bindings at Name |
Object |
lookup(Name name)
Lookup a binding by name |
Object |
lookup(String name)
Lookup binding of an object by name |
Object |
lookupLink(Name name)
Lookup link bound to name |
Object |
lookupLink(String name)
Lookup link bound to name |
void |
rebind(Name name,
Object obj)
Overwrite or create a binding |
void |
rebind(String name,
Object obj)
Overwrite or create a binding from Name to Object |
void |
removeBinding(Name name)
|
Object |
removeFromEnvironment(String propName)
Remove a property from this Context's environment. |
boolean |
removeListener(NamingContext.Listener listener)
|
void |
rename(Name oldName,
Name newName)
Not supported |
void |
rename(String oldName,
String newName)
Not supported |
void |
setBindings(Map<String,Binding> bindings)
|
void |
setEnv(Hashtable<String,Object> env)
|
void |
setNameParser(NameParser parser)
Setter for _parser |
Name |
toCanonicalName(Name name)
Remove leading or trailing empty components from name. |
void |
unbind(Name name)
Not supported. |
void |
unbind(String name)
Not supported. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String LOCK_PROPERTY
public static final String UNLOCK_PROPERTY
protected final Hashtable<String,Object> _env
protected Map<String,Binding> _bindings
protected NamingContext _parent
protected String _name
protected NameParser _parser
| Constructor Detail |
|---|
public NamingContext(Hashtable<String,Object> env,
String name,
NamingContext parent,
NameParser parser)
env - environment propertiesname - relative name of this contextparent - immediate ancestor Context (can be null)parser - NameParser for this Context| Method Detail |
|---|
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException - if an error occurspublic String getName()
public Context getParent()
public void setNameParser(NameParser parser)
public void setEnv(Hashtable<String,Object> env)
public Map<String,Binding> getBindings()
public void setBindings(Map<String,Binding> bindings)
public void bind(Name name,
Object obj)
throws NamingException
bind in interface Contextname - Name of the objectobj - object to bind
NamingException - if an error occurs
public void bind(String name,
Object obj)
throws NamingException
bind in interface Contextname - a String valueobj - an Object value
NamingException - if an error occurs
public Context createSubcontext(Name name)
throws NamingException
createSubcontext in interface Contextname - a Name value
Context value
NamingException - if an error occurs
public Context createSubcontext(String name)
throws NamingException
createSubcontext in interface Contextname - a String value
Context value
NamingException - if an error occurs
public void destroySubcontext(String name)
throws NamingException
destroySubcontext in interface Contextname - name of subcontext to remove
NamingException - if an error occurs
public void destroySubcontext(Name name)
throws NamingException
destroySubcontext in interface Contextname - name of subcontext to remove
NamingException - if an error occurs
public Object lookup(Name name)
throws NamingException
lookup in interface Contextname - name of bound object
NamingException - if an error occurs
public Object lookup(String name)
throws NamingException
lookup in interface Contextname - name of bound object
NamingException - if an error occurs
public Object lookupLink(Name name)
throws NamingException
lookupLink in interface Contextname - name of link binding
NamingException - if an error occurs
public Object lookupLink(String name)
throws NamingException
lookupLink in interface Contextname - name of link binding
NamingException - if an error occurs
public NamingEnumeration list(Name name)
throws NamingException
list in interface Contextname - a Name value
NamingEnumeration value
NamingException - if an error occurs
public NamingEnumeration list(String name)
throws NamingException
list in interface Contextname - a Name value
NamingEnumeration value
NamingException - if an error occurs
public NamingEnumeration listBindings(Name name)
throws NamingException
listBindings in interface Contextname - a Name value
NamingEnumeration value
NamingException - if an error occurs
public NamingEnumeration listBindings(String name)
throws NamingException
listBindings in interface Contextname - a String value
NamingEnumeration value
NamingException - if an error occurs
public void rebind(Name name,
Object obj)
throws NamingException
rebind in interface Contextname - a Name valueobj - an Object value
NamingException - if an error occurs
public void rebind(String name,
Object obj)
throws NamingException
rebind in interface Contextname - a String valueobj - an Object value
NamingException - if an error occurs
public void unbind(String name)
throws NamingException
unbind in interface Contextname - a String value
NamingException - if an error occurs
public void unbind(Name name)
throws NamingException
unbind in interface Contextname - a String value
NamingException - if an error occurs
public void rename(Name oldName,
Name newName)
throws NamingException
rename in interface ContextoldName - a Name valuenewName - a Name value
NamingException - if an error occurs
public void rename(String oldName,
String newName)
throws NamingException
rename in interface ContextoldName - a Name valuenewName - a Name value
NamingException - if an error occurs
public Name composeName(Name name,
Name prefix)
throws NamingException
composeName in interface Contextname - a Name valueprefix - a Name value
Name value
NamingException - if an error occurs
public String composeName(String name,
String prefix)
throws NamingException
composeName in interface Contextname - a Name valueprefix - a Name value
Name value
NamingException - if an error occurs
public void close()
throws NamingException
close in interface ContextNamingException - if an error occurspublic NameParser getNameParser(Name name)
getNameParser in interface Contextname - a Name value
NameParser valuepublic NameParser getNameParser(String name)
getNameParser in interface Contextname - a Name value
NameParser value
public String getNameInNamespace()
throws NamingException
getNameInNamespace in interface ContextNamingException - if an error occurs
public Object addToEnvironment(String propName,
Object propVal)
throws NamingException
addToEnvironment in interface ContextpropName - name of the property to addpropVal - value of the property to add
NamingException - if an error occurs
public Object removeFromEnvironment(String propName)
throws NamingException
removeFromEnvironment in interface ContextpropName - name of property to remove
NamingException - if an error occurspublic Hashtable getEnvironment()
getEnvironment in interface Context
public void addBinding(Name name,
Object obj)
throws NameAlreadyBoundException
name - a Name valueobj - an Object value
NameAlreadyBoundExceptionpublic Binding getBinding(Name name)
name - a Name value
Binding valuepublic Binding getBinding(String name)
name - as a String
public void removeBinding(Name name)
public Name toCanonicalName(Name name)
name - the name to normalize
public boolean isLocked()
public String dump()
dump in interface Dumpable
public void dump(Appendable out,
String indent)
throws IOException
dump in interface DumpableIOExceptionpublic void addListener(NamingContext.Listener listener)
public boolean removeListener(NamingContext.Listener listener)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||