public abstract class

ComponentContext

extends PartialCompositeContext
java.lang.Object
   ↳ com.sun.jndi.toolkit.ctx.PartialCompositeContext
     ↳ com.sun.jndi.toolkit.ctx.ComponentContext
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Provides implementation of p_* operations using c_* operations provided by subclasses. Clients: deal only with names for its own naming service. Must provide implementations for c_* methods, and for p_parseComponent() and the c_*_nns methods if the defaults are not appropriate.

Summary

Constants
byte TERMINAL_COMPONENT
byte TERMINAL_NNS_COMPONENT
byte USE_CONTINUATION
[Expand]
Inherited Constants
From class com.sun.jndi.toolkit.ctx.PartialCompositeContext
From interface javax.naming.Context
[Expand]
Inherited Fields
From class com.sun.jndi.toolkit.ctx.PartialCompositeContext
Protected Constructors
ComponentContext()
Protected Methods
abstract void c_bind(Name name, Object obj, Continuation cont)
void c_bind_nns(Name name, Object obj, Continuation cont)
abstract Context c_createSubcontext(Name name, Continuation cont)
Context c_createSubcontext_nns(Name name, Continuation cont)
abstract void c_destroySubcontext(Name name, Continuation cont)
void c_destroySubcontext_nns(Name name, Continuation cont)
abstract NameParser c_getNameParser(Name name, Continuation cont)
NameParser c_getNameParser_nns(Name name, Continuation cont)
abstract NamingEnumeration c_list(Name name, Continuation cont)
abstract NamingEnumeration c_listBindings(Name name, Continuation cont)
NamingEnumeration c_listBindings_nns(Name name, Continuation cont)
NamingEnumeration c_list_nns(Name name, Continuation cont)
abstract Object c_lookup(Name name, Continuation cont)
abstract Object c_lookupLink(Name name, Continuation cont)
Object c_lookupLink_nns(Name name, Continuation cont)
Object c_lookup_nns(Name name, Continuation cont)
void c_processJunction_nns(Name name, Continuation cont)
Locates the nns using the default policy.
abstract void c_rebind(Name name, Object obj, Continuation cont)
void c_rebind_nns(Name name, Object obj, Continuation cont)
abstract void c_rename(Name oldname, Name newname, Continuation cont)
void c_rename_nns(Name oldname, Name newname, Continuation cont)
Object c_resolveIntermediate_nns(Name name, Continuation cont)
Resolves the nns for 'name' when the named context is acting as an intermediate context.
abstract void c_unbind(Name name, Continuation cont)
void c_unbind_nns(Name name, Continuation cont)
boolean isAllEmpty(Name n)
void p_bind(Name name, Object obj, Continuation cont)
Context p_createSubcontext(Name name, Continuation cont)
void p_destroySubcontext(Name name, Continuation cont)
NameParser p_getNameParser(Name name, Continuation cont)
NamingEnumeration p_list(Name name, Continuation cont)
NamingEnumeration p_listBindings(Name name, Continuation cont)
Object p_lookup(Name name, Continuation cont)
Object p_lookupLink(Name name, Continuation cont)
HeadTail p_parseComponent(Name name, Continuation cont)
Determines which of the first components of 'name' belong to this naming system.
void p_rebind(Name name, Object obj, Continuation cont)
void p_rename(Name oldName, Name newName, Continuation cont)
HeadTail p_resolveIntermediate(Name name, Continuation cont)
Determine whether 'name' is a terminal component in this naming system.
ResolveResult p_resolveToClass(Name name, Class contextType, Continuation cont)
void p_unbind(Name name, Continuation cont)
[Expand]
Inherited Methods
From class com.sun.jndi.toolkit.ctx.PartialCompositeContext
From class java.lang.Object
From interface javax.naming.Context
From interface javax.naming.spi.Resolver

Constants

protected static final byte TERMINAL_COMPONENT

Constant Value: 2 (0x00000002)

protected static final byte TERMINAL_NNS_COMPONENT

Constant Value: 3 (0x00000003)

protected static final byte USE_CONTINUATION

Constant Value: 1 (0x00000001)

Protected Constructors

protected ComponentContext ()

Protected Methods

protected abstract void c_bind (Name name, Object obj, Continuation cont)

protected void c_bind_nns (Name name, Object obj, Continuation cont)

protected abstract Context c_createSubcontext (Name name, Continuation cont)

protected Context c_createSubcontext_nns (Name name, Continuation cont)

protected abstract void c_destroySubcontext (Name name, Continuation cont)

protected void c_destroySubcontext_nns (Name name, Continuation cont)

protected abstract NameParser c_getNameParser (Name name, Continuation cont)

protected NameParser c_getNameParser_nns (Name name, Continuation cont)

protected abstract NamingEnumeration c_list (Name name, Continuation cont)

protected abstract NamingEnumeration c_listBindings (Name name, Continuation cont)

protected NamingEnumeration c_listBindings_nns (Name name, Continuation cont)

protected NamingEnumeration c_list_nns (Name name, Continuation cont)

protected abstract Object c_lookup (Name name, Continuation cont)

protected abstract Object c_lookupLink (Name name, Continuation cont)

protected Object c_lookupLink_nns (Name name, Continuation cont)

protected Object c_lookup_nns (Name name, Continuation cont)

protected void c_processJunction_nns (Name name, Continuation cont)

Locates the nns using the default policy. This policy fully handles junctions, but otherwise throws an exception when an attempt is made to resolve an implicit nns. The default policy is as follows: If there is a junction in the namespace, then resolve to the junction and continue the operation there (thus deferring to that context to find its own nns). Otherwise, resolve as far as possible and then throw CannotProceedException with the resolved object being a reference: the address type is "nns", and the address contents is this context. For example, when c_bind_nns(name, obj, ...) is invoked, the caller is attempting to bind the object "obj" to the nns of "name". If "name" is a junction, it names an object in another naming system that (presumably) has an nns. c_bind_nns() will first resolve "name" to a context and then attempt to continue the bind operation there, (thus binding to the nns of the context named by "name"). If "name" is empty then throw an exception, since this context does not by default support an implicit nns. To implement a context that does support an implicit nns, it is necessary to override this default policy. This is done by overriding the c_*_nns() methods (which each call this method by default).

protected abstract void c_rebind (Name name, Object obj, Continuation cont)

protected void c_rebind_nns (Name name, Object obj, Continuation cont)

protected abstract void c_rename (Name oldname, Name newname, Continuation cont)

protected void c_rename_nns (Name oldname, Name newname, Continuation cont)

protected Object c_resolveIntermediate_nns (Name name, Continuation cont)

Resolves the nns for 'name' when the named context is acting as an intermediate context. For a system that supports only junctions, this would be equilvalent to c_lookup(name, cont); because for junctions, an intermediate slash simply signifies a syntactic separator. For a system that supports only implicit nns, this would be equivalent to c_lookup_nns(name, cont); because for implicit nns, a slash always signifies the implicit nns, regardless of whether it is intermediate or trailing. By default this method supports junctions, and also allows for an implicit nns to be dynamically determined through the use of the "nns" reference (see c_processJunction_nns()). Contexts that implement implicit nns directly should provide an appropriate override. A junction, by definition, is a binding of a name in one namespace to an object in another. The default implementation of this method detects the crossover into another namespace using the following heuristic: there is a junction when "name" resolves to a context that is not an instance of this.getClass(). Contexts supporting junctions for which this heuristic is inappropriate should override this method.

protected abstract void c_unbind (Name name, Continuation cont)

protected void c_unbind_nns (Name name, Continuation cont)

protected boolean isAllEmpty (Name n)

protected void p_bind (Name name, Object obj, Continuation cont)

protected Context p_createSubcontext (Name name, Continuation cont)

protected void p_destroySubcontext (Name name, Continuation cont)

protected NameParser p_getNameParser (Name name, Continuation cont)

protected NamingEnumeration p_list (Name name, Continuation cont)

protected NamingEnumeration p_listBindings (Name name, Continuation cont)

protected Object p_lookup (Name name, Continuation cont)

protected Object p_lookupLink (Name name, Continuation cont)

protected HeadTail p_parseComponent (Name name, Continuation cont)

Determines which of the first components of 'name' belong to this naming system. If no components belong to this naming system, return the empty name (new CompositeName()) as the head, and the entire name as the tail. The default implementation supports strong separation. If the name is empty or if the first component is empty, head is the empty name and tail is the entire name. (This means that this context does not have any name to work with). Otherwise, it returns the first component as head, and the rest of the components as tail. Subclass should override this method according its own policies. For example, a weakly separated system with dynamic boundary determination would simply return as head 'name'. A weakly separated with static boundary determination would select the components in the front of 'name' that conform to some syntax rules. (e.g. in X.500 syntax, perhaps select front components that have a equal sign). If none conforms, return an empty name.

protected void p_rebind (Name name, Object obj, Continuation cont)

protected void p_rename (Name oldName, Name newName, Continuation cont)

protected HeadTail p_resolveIntermediate (Name name, Continuation cont)

Determine whether 'name' is a terminal component in this naming system. If so, return status indicating so, so that caller can perform context operation on this name. If not, then the first component(s) of 'name' names an intermediate context. In that case, resolve these components and set Continuation to be the object named. see test cases at bottom of file.

protected ResolveResult p_resolveToClass (Name name, Class contextType, Continuation cont)

protected void p_unbind (Name name, Continuation cont)