Modifier and Type | Class and Description |
---|---|
static interface |
NamingContext.Listener
Naming Context Listener.
|
Modifier and Type | Field and Description |
---|---|
protected Map<String,Binding> |
_bindings |
protected Hashtable<String,Object> |
_env |
protected String |
_name |
protected NamingContext |
_parent |
protected NameParser |
_parser |
static String |
DEEP_BINDING |
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(Hashtable<String,Object> env,
String name,
NamingContext parent,
NameParser parser)
Constructor
|
Modifier and Type | Method and Description |
---|---|
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.
|
String |
toString() |
void |
unbind(Name name)
Not supported.
|
void |
unbind(String name)
Not supported.
|
public static final String DEEP_BINDING
public static final String LOCK_PROPERTY
public static final String UNLOCK_PROPERTY
protected NamingContext _parent
protected String _name
protected NameParser _parser
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 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
public void addBinding(Name name, Object obj) throws NameAlreadyBoundException
name
- a Name
valueobj
- an Object
valueNameAlreadyBoundException
public Binding getBinding(Name name)
name
- a Name
valueBinding
valuepublic Binding getBinding(String name)
name
- as a Stringpublic void removeBinding(Name name)
public Name toCanonicalName(Name name)
name
- the name to normalizepublic boolean isLocked()
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)
Copyright © 1995-2015 Webtide. All Rights Reserved.