org.mortbay.naming
Modifier and Type | Class and Description |
---|---|
class |
NamingContext.BindingEnumeration
BindingEnumeration
|
class |
NamingContext.NameEnumeration
NameEnumeration
|
Modifier and Type | Field and Description |
---|---|
protected Hashtable |
_bindings |
protected Hashtable |
_env |
protected String |
_name |
protected Context |
_parent |
protected NameParser |
_parser |
static Enumeration |
EMPTY_ENUM |
static String |
LOCK_PROPERTY |
static String |
UNLOCK_PROPERTY |
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 and Description |
---|
NamingContext()
Constructor
|
NamingContext(Hashtable env)
Creates a new
NamingContext instance. |
NamingContext(Hashtable env,
String name,
Context parent,
NameParser parser)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
addBinding(Name name,
Object obj)
Add a name to object binding to this Context.
|
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
|
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.
|
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.
|
public static final String LOCK_PROPERTY
public static final String UNLOCK_PROPERTY
public static final Enumeration EMPTY_ENUM
protected Context _parent
protected String _name
protected Hashtable _env
protected Hashtable _bindings
protected NameParser _parser
public NamingContext(Hashtable env, String name, Context parent, NameParser parser)
env
- environment propertiesname
- relative name of this contextparent
- immediate ancestor Context (can be null)parser
- NameParser for this Contextpublic NamingContext(Hashtable env)
NamingContext
instance.env
- a Hashtable
valuepublic NamingContext()
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 bindNamingException
- if an error occurspublic void bind(String name, Object obj) throws NamingException
bind
in interface Context
name
- a String
valueobj
- an Object
valueNamingException
- if an error occurspublic Context createSubcontext(Name name) throws NamingException
createSubcontext
in interface Context
name
- a Name
valueContext
valueNamingException
- if an error occurspublic Context createSubcontext(String name) throws NamingException
createSubcontext
in interface Context
name
- a String
valueContext
valueNamingException
- if an error occurspublic void destroySubcontext(String name) throws NamingException
destroySubcontext
in interface Context
name
- name of subcontext to removeNamingException
- if an error occurspublic void destroySubcontext(Name name) throws NamingException
destroySubcontext
in interface Context
name
- name of subcontext to removeNamingException
- if an error occurspublic Object lookup(Name name) throws NamingException
lookup
in interface Context
name
- name of bound objectNamingException
- if an error occurspublic Object lookup(String name) throws NamingException
lookup
in interface Context
name
- name of bound objectNamingException
- if an error occurspublic Object lookupLink(Name name) throws NamingException
lookupLink
in interface Context
name
- name of link bindingNamingException
- if an error occurspublic Object lookupLink(String name) throws NamingException
lookupLink
in interface Context
name
- name of link bindingNamingException
- if an error occurspublic NamingEnumeration list(Name name) throws NamingException
list
in interface Context
name
- a Name
valueNamingEnumeration
valueNamingException
- if an error occurspublic NamingEnumeration list(String name) throws NamingException
list
in interface Context
name
- a Name
valueNamingEnumeration
valueNamingException
- if an error occurspublic NamingEnumeration listBindings(Name name) throws NamingException
listBindings
in interface Context
name
- a Name
valueNamingEnumeration
valueNamingException
- if an error occurspublic NamingEnumeration listBindings(String name) throws NamingException
listBindings
in interface Context
name
- a String
valueNamingEnumeration
valueNamingException
- if an error occurspublic void rebind(Name name, Object obj) throws NamingException
rebind
in interface Context
name
- a Name
valueobj
- an Object
valueNamingException
- if an error occurspublic void rebind(String name, Object obj) throws NamingException
rebind
in interface Context
name
- a String
valueobj
- an Object
valueNamingException
- if an error occurspublic void unbind(String name) throws NamingException
unbind
in interface Context
name
- a String
valueNamingException
- if an error occurspublic void unbind(Name name) throws NamingException
unbind
in interface Context
name
- a String
valueNamingException
- if an error occurspublic void rename(Name oldName, Name newName) throws NamingException
rename
in interface Context
oldName
- a Name
valuenewName
- a Name
valueNamingException
- if an error occurspublic void rename(String oldName, String newName) throws NamingException
rename
in interface Context
oldName
- a Name
valuenewName
- a Name
valueNamingException
- if an error occurspublic Name composeName(Name name, Name prefix) throws NamingException
composeName
in interface Context
name
- a Name
valueprefix
- a Name
valueName
valueNamingException
- if an error occurspublic String composeName(String name, String prefix) throws NamingException
composeName
in interface Context
name
- a Name
valueprefix
- a Name
valueName
valueNamingException
- 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
valueNameParser
valuepublic NameParser getNameParser(String name)
getNameParser
in interface Context
name
- a Name
valueNameParser
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 addNamingException
- if an error occurspublic Object removeFromEnvironment(String propName) throws NamingException
removeFromEnvironment
in interface Context
propName
- name of property to removeNamingException
- if an error occurspublic Hashtable getEnvironment()
getEnvironment
in interface Context
protected void addBinding(Name name, Object obj)
name
- a Name
valueobj
- an Object
valueprotected Binding getBinding(Name name)
name
- a Name
valueBinding
valueprotected Binding getBinding(String name)
name
- as a Stringprotected void removeBinding(Name name)
Copyright © 2009 Mortbay Consulting Pty. Ltd. All Rights Reserved.