|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.codehaus.spice.jndikit.AbstractContext
public abstract class AbstractContext
Abstract JNDI Context that can be inherited from to provide a particular type of Context.
| Field Summary |
|---|
| 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 | |
|---|---|
AbstractContext()
|
|
AbstractContext(Hashtable environment)
|
|
| Method Summary | |
|---|---|
Object |
addToEnvironment(String key,
Object value)
Add a key-value pair to environment |
void |
bind(Name name,
Object object)
Bind an object to a name. |
protected abstract void |
bind(Name name,
Object object,
boolean rebind)
Helper method to bind |
void |
bind(String name,
Object object)
Bind an object to a name. |
void |
close()
Release resources associated with context. |
Name |
composeName(Name name,
Name prefix)
Compose a name form a name and a prefix. |
String |
composeName(String name,
String prefix)
Compose a name form a name and a prefix. |
Context |
createSubcontext(String name)
Create a Subcontext. |
void |
destroySubcontext(String name)
Destroy a Subcontext. |
Hashtable |
getEnvironment()
Return a copy of environment. |
protected Name |
getLeafName(Name name)
Get leaf name component from specified Name object. |
protected abstract NameParser |
getNameParser()
|
NameParser |
getNameParser(Name name)
Get the NameParser for the named context. |
NameParser |
getNameParser(String name)
Get the NameParser for the named context. |
protected Name |
getPathName(Name name)
Get name components minus leaf name component. |
protected Hashtable |
getRawEnvironment()
Utility method to retrieve raw environment value. |
protected boolean |
isSelf(Name name)
|
NamingEnumeration |
list(String name)
Enumerates the names bound in the named context, along with the objects bound to them. |
NamingEnumeration |
listBindings(String name)
Enumerates the names bound in the named context, along with the objects bound to them. |
Object |
lookup(String name)
Get the object named. |
Object |
lookupLink(Name name)
Get the object named following all links. |
Object |
lookupLink(String name)
Get the object named following all links. |
void |
rebind(Name name,
Object object)
Binds a name to an object, overwriting any existing binding. |
void |
rebind(String name,
Object object)
Binds a name to an object, overwriting any existing binding. |
Object |
removeFromEnvironment(String key)
Remove a key-value pair form environment and return it. |
void |
rename(Name oldName,
Name newName)
|
void |
rename(String oldName,
String newName)
Rename a already bound object |
void |
unbind(String name)
Unbind a object from a name. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.naming.Context |
|---|
createSubcontext, destroySubcontext, getNameInNamespace, list, listBindings, lookup, unbind |
| Constructor Detail |
|---|
public AbstractContext()
public AbstractContext(Hashtable environment)
| Method Detail |
|---|
protected abstract NameParser getNameParser()
throws NamingException
NamingException
public Object addToEnvironment(String key,
Object value)
throws NamingException
addToEnvironment in interface Contextkey - the keyvalue - the value
NamingExceptionpublic void close()
close in interface Contextprotected boolean isSelf(Name name)
public void bind(String name,
Object object)
throws NamingException
bind in interface Contextname - the name to bind toobject - the object
NamingException - if an error occurs such as
bad name or invalid binding
public void bind(Name name,
Object object)
throws NamingException
bind in interface Contextname - the name to bind toobject - the object
NamingException - if an error occurs such as
bad name or invalid binding
protected abstract void bind(Name name,
Object object,
boolean rebind)
throws NamingException
NamingException
public String composeName(String name,
String prefix)
throws NamingException
composeName in interface Contextname - the nameprefix - the prefix
NamingException - if a badly formatted name for context
public Name composeName(Name name,
Name prefix)
throws NamingException
composeName in interface Contextname - the nameprefix - the prefix
NamingException - if a badly formatted name for context
public Context createSubcontext(String name)
throws NamingException
createSubcontext in interface Contextname - the name of subcontext
NamingException - if an error occurs
(ie context exists, badly formated name etc)
public void destroySubcontext(String name)
throws NamingException
destroySubcontext in interface Contextname - the name of subcontext to destroy
NamingException - if an error occurs such as malformed name or
context not exiting or not empty
public Hashtable getEnvironment()
throws NamingException
getEnvironment in interface ContextNamingException
public NameParser getNameParser(String name)
throws NamingException
getNameParser in interface Contextname -
NamingException - if an error occurs
public NameParser getNameParser(Name name)
throws NamingException
getNameParser in interface Contextname -
NamingException - if an error occurs
public NamingEnumeration list(String name)
throws NamingException
list in interface Contextname - the name of the context
NamingException - if an error occurs
public NamingEnumeration listBindings(String name)
throws NamingException
listBindings in interface Contextname - the name of the context
NamingException - if an error occurs
public Object lookup(String name)
throws NamingException
lookup in interface Contextname - the name
NamingException - if an error occurs
(ie object name is inavlid or unbound)
public Object lookupLink(String name)
throws NamingException
lookupLink in interface Contextname - the name
NamingException - if an error occurs
(ie object name is inavlid or unbound)
public Object lookupLink(Name name)
throws NamingException
lookupLink in interface Contextname - the name
NamingException - if an error occurs
(ie object name is inavlid or unbound)
public void rebind(String name,
Object object)
throws NamingException
rebind in interface Contextname - the nameobject - the object
NamingException - if an error occurs
public void rebind(Name name,
Object object)
throws NamingException
rebind in interface Contextname - the nameobject - the object
NamingException - if an error occurs
public Object removeFromEnvironment(String key)
throws NamingException
removeFromEnvironment in interface Contextkey - the key
NamingException
public void rename(String oldName,
String newName)
throws NamingException
rename in interface ContextoldName - the old namenewName - the new name
NamingException - if an error occurs
public void rename(Name oldName,
Name newName)
throws NamingException
rename in interface ContextNamingException
public void unbind(String name)
throws NamingException
unbind in interface Contextname - the name
NamingException - if an error occursprotected final Hashtable getRawEnvironment()
protected Name getPathName(Name name)
throws NamingException
name - the name elements leading up to last element
NamingException - if an error occurs
protected Name getLeafName(Name name)
throws NamingException
name - the name to retrieve leaf from
NamingException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||