|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.resilientedge.util.naming.AbstractCtx | +--com.resilientedge.util.naming.DelegatingCtx
DelegatingCtx does not have internal bindings but instead delegates its call to other contexts. It is up to a derived class to create the delegated contexts and initialize this context with them. The subcontext does not extend the namespace. The items in the subcontext are seen as items of this context.
Internally DelegatingCtx maintains two types of bindings. One binding is
read-write and is set using setBindingContext
.The other
contexts are read-only and are set using addOtherContext
.
This arraingment can cause unusual behavior since a name may be sucessfully
retrieved but may not be able to be rebound or renamed. Only bindings that
are directly bound to this context can be modified. All others may only be
retrieved.
One other side affect of this implementation is that the list methods are attached to the read-write binding only and does not travers the read-only bindings. This may be changed in the future.
Fields inherited from interface javax.naming.event.EventContext |
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPE |
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 | |
protected |
DelegatingCtx()
Construct a PreferenceCtx. |
|
DelegatingCtx(javax.naming.Context bindingContext)
Construct a PreferenceCtx. |
protected |
DelegatingCtx(javax.naming.Context parent,
java.util.Hashtable env)
Construct a PreferenceCtx with an environment and parent Context. |
protected |
DelegatingCtx(java.util.Hashtable env)
Construct a PreferenceCtx with an environment. |
Method Summary | |
void |
addOtherContext(javax.naming.Context ctx)
Add a read-only delegate Context to this context. |
void |
addOtherContext(int index,
javax.naming.Context ctx)
Add a read-only delegate Context to this context. |
void |
bind(javax.naming.Name name,
java.lang.Object obj)
|
protected javax.naming.NameParser |
getNameParser()
|
javax.naming.NameParser |
getNameParser(javax.naming.Name name)
|
javax.naming.NamingEnumeration |
list(javax.naming.Name name)
|
javax.naming.NamingEnumeration |
listBindings(javax.naming.Name name)
|
java.lang.Object |
lookup(javax.naming.Name name)
Lookup a name. |
java.lang.Object |
lookupLink(javax.naming.Name name)
|
void |
rebind(javax.naming.Name name,
java.lang.Object obj)
|
void |
removeOtherContext(javax.naming.Context ctx)
Remove a read-only delegate Context from this context. |
void |
rename(javax.naming.Name oldName,
javax.naming.Name newName)
|
void |
setBindingContext(javax.naming.Context ctx)
Set the read-write delegate Context to this context. |
void |
unbind(javax.naming.Name name)
|
Methods inherited from class com.resilientedge.util.naming.AbstractCtx |
addNamingListener, addNamingListener, addToEnvironment, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, fireObjectChangeEvent, getEnvironment, getNameInNamespace, getNameParser, getParentContext, getRootContext, list, listBindings, lookup, lookupLink, rebind, removeFromEnvironment, removeNamingListener, rename, setParentContext, targetMustExist, unbind |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DelegatingCtx(javax.naming.Context bindingContext)
bindingContext
- Parameter Descriptionprotected DelegatingCtx()
protected DelegatingCtx(java.util.Hashtable env)
env
- Parameter Descriptionprotected DelegatingCtx(javax.naming.Context parent, java.util.Hashtable env)
parent
- Parameter Descriptionenv
- Parameter DescriptionMethod Detail |
public void setBindingContext(javax.naming.Context ctx)
ctx
- A Context that will be share this naming space.public javax.naming.NameParser getNameParser(javax.naming.Name name) throws javax.naming.NamingException
getNameParser
in class AbstractCtx
name
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic java.lang.Object lookup(javax.naming.Name name) throws javax.naming.NamingException
name
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic void bind(javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
name
- Parameter Descriptionobj
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic void rebind(javax.naming.Name name, java.lang.Object obj) throws javax.naming.NamingException
name
- Parameter Descriptionobj
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic void unbind(javax.naming.Name name) throws javax.naming.NamingException
name
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic void rename(javax.naming.Name oldName, javax.naming.Name newName) throws javax.naming.NamingException
oldName
- Parameter DescriptionnewName
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic javax.naming.NamingEnumeration list(javax.naming.Name name) throws javax.naming.NamingException
name
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic javax.naming.NamingEnumeration listBindings(javax.naming.Name name) throws javax.naming.NamingException
name
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic java.lang.Object lookupLink(javax.naming.Name name) throws javax.naming.NamingException
name
- Parameter Descriptionjavax.naming.NamingException
- Exception Descriptionpublic void addOtherContext(javax.naming.Context ctx)
ctx
- A Context that will be share this naming space.public void addOtherContext(int index, javax.naming.Context ctx)
ctx
- A Context that will be share this
naming space.index
- The feature to be added to the
OtherContext attributeArrayIndexOutOfBoundsException
- public void removeOtherContext(javax.naming.Context ctx)
ctx
- A Context to remove.protected javax.naming.NameParser getNameParser() throws javax.naming.NamingException
getNameParser
in class AbstractCtx
javax.naming.NamingException
- Exception Description
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |