|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jetty.jndi.NamingContext
public class NamingContext
NamingContext
Implementation of Context interface.
All Names are expected to be Compound, not Composite.
Nested Class Summary | |
---|---|
class |
NamingContext.BindingEnumeration
BindingEnumeration |
static interface |
NamingContext.Listener
Naming Context Listener. |
class |
NamingContext.NameEnumeration
NameEnumeration |
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()
Constructor |
|
NamingContext(Hashtable<String,Object> env)
Creates a new NamingContext instance. |
|
NamingContext(Hashtable<String,Object> env,
String name,
NamingContext parent,
NameParser parser)
Constructor |
Method Summary | |
---|---|
protected 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)
Not supported |
void |
destroySubcontext(String name)
Not supported |
String |
dump()
|
void |
dump(Appendable out,
String indent)
|
protected Binding |
getBinding(Name name)
Get a name to object binding from this Context |
protected Binding |
getBinding(String name)
Get a name to object binding from this Context |
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 |
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 |
protected 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 |
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 Contextpublic NamingContext(Hashtable<String,Object> env)
NamingContext
instance.
env
- a Hashtable
valuepublic NamingContext()
Method Detail |
---|
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- if an error occurspublic String getName()
public Context getParent()
public void setNameParser(NameParser parser)
public void bind(Name name, Object obj) throws NamingException
bind
in interface Context
name
- Name of the objectobj
- object to bind
NamingException
- if an error occurspublic void bind(String name, Object obj) throws NamingException
bind
in interface Context
name
- a String
valueobj
- an Object
value
NamingException
- if an error occurspublic Context createSubcontext(Name name) throws NamingException
createSubcontext
in interface Context
name
- a Name
value
Context
value
NamingException
- if an error occurspublic Context createSubcontext(String name) throws NamingException
createSubcontext
in interface Context
name
- a String
value
Context
value
NamingException
- if an error occurspublic void destroySubcontext(String name) throws NamingException
destroySubcontext
in interface Context
name
- name of subcontext to remove
NamingException
- if an error occurspublic void destroySubcontext(Name name) throws NamingException
destroySubcontext
in interface Context
name
- name of subcontext to remove
NamingException
- if an error occurspublic Object lookup(Name name) throws NamingException
lookup
in interface Context
name
- name of bound object
NamingException
- if an error occurspublic Object lookup(String name) throws NamingException
lookup
in interface Context
name
- name of bound object
NamingException
- if an error occurspublic Object lookupLink(Name name) throws NamingException
lookupLink
in interface Context
name
- name of link binding
NamingException
- if an error occurspublic Object lookupLink(String name) throws NamingException
lookupLink
in interface Context
name
- name of link binding
NamingException
- if an error occurspublic NamingEnumeration list(Name name) throws NamingException
list
in interface Context
name
- a Name
value
NamingEnumeration
value
NamingException
- if an error occurspublic NamingEnumeration list(String name) throws NamingException
list
in interface Context
name
- a Name
value
NamingEnumeration
value
NamingException
- if an error occurspublic NamingEnumeration listBindings(Name name) throws NamingException
listBindings
in interface Context
name
- a Name
value
NamingEnumeration
value
NamingException
- if an error occurspublic NamingEnumeration listBindings(String name) throws NamingException
listBindings
in interface Context
name
- a String
value
NamingEnumeration
value
NamingException
- if an error occurspublic void rebind(Name name, Object obj) throws NamingException
rebind
in interface Context
name
- a Name
valueobj
- an Object
value
NamingException
- if an error occurspublic void rebind(String name, Object obj) throws NamingException
rebind
in interface Context
name
- a String
valueobj
- an Object
value
NamingException
- if an error occurspublic void unbind(String name) throws NamingException
unbind
in interface Context
name
- a String
value
NamingException
- if an error occurspublic void unbind(Name name) throws NamingException
unbind
in interface Context
name
- a String
value
NamingException
- if an error occurspublic void rename(Name oldName, Name newName) throws NamingException
rename
in interface Context
oldName
- a Name
valuenewName
- a Name
value
NamingException
- if an error occurspublic void rename(String oldName, String newName) throws NamingException
rename
in interface Context
oldName
- a Name
valuenewName
- a Name
value
NamingException
- if an error occurspublic Name composeName(Name name, Name prefix) throws NamingException
composeName
in interface Context
name
- a Name
valueprefix
- a Name
value
Name
value
NamingException
- if an error occurspublic String composeName(String name, String prefix) throws NamingException
composeName
in interface Context
name
- a Name
valueprefix
- a Name
value
Name
value
NamingException
- if an error occurspublic void close() throws NamingException
close
in interface Context
NamingException
- if an error occurspublic NameParser getNameParser(Name name)
getNameParser
in interface Context
name
- a Name
value
NameParser
valuepublic NameParser getNameParser(String name)
getNameParser
in interface Context
name
- a Name
value
NameParser
valuepublic String getNameInNamespace() throws NamingException
getNameInNamespace
in interface Context
NamingException
- if an error occurspublic Object addToEnvironment(String propName, Object propVal) throws NamingException
addToEnvironment
in interface Context
propName
- name of the property to addpropVal
- value of the property to add
NamingException
- if an error occurspublic Object removeFromEnvironment(String propName) throws NamingException
removeFromEnvironment
in interface Context
propName
- name of property to remove
NamingException
- if an error occurspublic Hashtable getEnvironment()
getEnvironment
in interface Context
protected void addBinding(Name name, Object obj) throws NameAlreadyBoundException
name
- a Name
valueobj
- an Object
value
NameAlreadyBoundException
protected Binding getBinding(Name name)
name
- a Name
value
Binding
valueprotected Binding getBinding(String name)
name
- as a String
protected void removeBinding(Name name)
public Name toCanonicalName(Name name)
name
- the name to normalize
public String dump()
dump
in interface Dumpable
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
public 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 |