APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.jndi.toolkit.ctx

public abstract Class ComponentContext

extends PartialCompositeContext
Class Inheritance
Known Direct Subclasses
com.sun.jndi.toolkit.ctx.AtomicContext
Imports
javax.naming.*, javax.naming.spi.ResolveResult

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.
Authors
Rosanna Lee, Scott Seligman

Field Summary

Modifier and TypeField and Description
private static int
protected static final byte
protected static final byte
protected static final byte
Inherited from com.sun.jndi.toolkit.ctx.PartialCompositeContext:
_ATOMIC_COMPONENT_contextType_EMPTY_NAME_NNS_NAME_PARTIAL

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract void
c_bind(Name name, Object obj, Continuation cont)

protected void
protected abstract Context
protected Context
protected abstract void
protected void
protected abstract NameParser
protected NameParser
protected abstract NamingEnumeration<NameClassPair>
c_list(Name name, Continuation cont)

protected NamingEnumeration<NameClassPair>
protected abstract NamingEnumeration<Binding>
protected NamingEnumeration<Binding>
protected abstract Object
protected Object
protected void
c_processJunction_nns(Name name, Continuation cont)

Locates the nns using the default policy.

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

protected void
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.

protected abstract void
protected void
pack-priv void
protected boolean
protected void
protected Context
protected void
protected NameParser
protected NamingEnumeration<NameClassPair>
protected NamingEnumeration<Binding>
protected Object
protected HeadTail
p_parseComponent(Name name, Continuation cont)

Determines which of the first components of 'name' belong to this naming system.

protected void
protected void
protected HeadTail
p_resolveIntermediate(Name name, Continuation cont)

Determine whether 'name' is a terminal component in this naming system.

protected ResolveResult
protected void
Inherited from com.sun.jndi.toolkit.ctx.PartialCompositeContext:
allEmptybindbindcomposeNamecomposeNamecreateSubcontextcreateSubcontextdestroySubcontextdestroySubcontextgetNameParsergetNameParsergetPCContextlistlistlistBindingslistBindingslookuplookuplookupLinklookupLinkp_getEnvironmentrebindrebindrenamerenameresolveToClassresolveToClassunbindunbind

Field Detail

debugback to summary
private static int debug
TERMINAL_COMPONENTback to summary
protected static final byte TERMINAL_COMPONENT
TERMINAL_NNS_COMPONENTback to summary
protected static final byte TERMINAL_NNS_COMPONENT
USE_CONTINUATIONback to summary
protected static final byte USE_CONTINUATION

Constructor Detail

ComponentContextback to summary
protected ComponentContext()

Method Detail

c_bindback to summary
protected abstract void c_bind(Name name, Object obj, Continuation cont) throws NamingException
c_bind_nnsback to summary
protected void c_bind_nns(Name name, Object obj, Continuation cont) throws NamingException
c_createSubcontextback to summary
protected abstract Context c_createSubcontext(Name name, Continuation cont) throws NamingException
c_createSubcontext_nnsback to summary
protected Context c_createSubcontext_nns(Name name, Continuation cont) throws NamingException
c_destroySubcontextback to summary
protected abstract void c_destroySubcontext(Name name, Continuation cont) throws NamingException
c_destroySubcontext_nnsback to summary
protected void c_destroySubcontext_nns(Name name, Continuation cont) throws NamingException
c_getNameParserback to summary
protected abstract NameParser c_getNameParser(Name name, Continuation cont) throws NamingException
c_getNameParser_nnsback to summary
protected NameParser c_getNameParser_nns(Name name, Continuation cont) throws NamingException
c_listback to summary
protected abstract NamingEnumeration<NameClassPair> c_list(Name name, Continuation cont) throws NamingException
c_list_nnsback to summary
protected NamingEnumeration<NameClassPair> c_list_nns(Name name, Continuation cont) throws NamingException
c_listBindingsback to summary
protected abstract NamingEnumeration<Binding> c_listBindings(Name name, Continuation cont) throws NamingException
c_listBindings_nnsback to summary
protected NamingEnumeration<Binding> c_listBindings_nns(Name name, Continuation cont) throws NamingException
c_lookupback to summary
protected abstract Object c_lookup(Name name, Continuation cont) throws NamingException
c_lookup_nnsback to summary
protected Object c_lookup_nns(Name name, Continuation cont) throws NamingException
c_processJunction_nnsback to summary
protected void c_processJunction_nns(Name name, Continuation cont) throws NamingException

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).

c_rebindback to summary
protected abstract void c_rebind(Name name, Object obj, Continuation cont) throws NamingException
c_rebind_nnsback to summary
protected void c_rebind_nns(Name name, Object obj, Continuation cont) throws NamingException
c_renameback to summary
protected abstract void c_rename(Name oldname, Name newname, Continuation cont) throws NamingException
c_rename_nnsback to summary
protected void c_rename_nns(Name oldname, Name newname, Continuation cont) throws NamingException
c_resolveIntermediate_nnsback to summary
protected Object c_resolveIntermediate_nns(Name name, Continuation cont) throws NamingException

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 equivalent 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.

c_unbindback to summary
protected abstract void c_unbind(Name name, Continuation cont) throws NamingException
c_unbind_nnsback to summary
protected void c_unbind_nns(Name name, Continuation cont) throws NamingException
checkAndAdjustRemainingNameback to summary
pack-priv void checkAndAdjustRemainingName(Name rname) throws InvalidNameException
isAllEmptyback to summary
protected boolean isAllEmpty(Name n)
p_bindback to summary
protected void p_bind(Name name, Object obj, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_bind.

p_createSubcontextback to summary
protected Context p_createSubcontext(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_createSubcontext.

p_destroySubcontextback to summary
protected void p_destroySubcontext(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_destroySubcontext.

p_getNameParserback to summary
protected NameParser p_getNameParser(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_getNameParser.

p_listback to summary
protected NamingEnumeration<NameClassPair> p_list(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_list.

p_listBindingsback to summary
protected NamingEnumeration<Binding> p_listBindings(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_listBindings.

p_lookupback to summary
protected Object p_lookup(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_lookup.

p_parseComponentback to summary
protected HeadTail p_parseComponent(Name name, Continuation cont) throws NamingException

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.

p_rebindback to summary
protected void p_rebind(Name name, Object obj, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_rebind.

p_renameback to summary
protected void p_rename(Name oldName, Name newName, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_rename.

p_resolveIntermediateback to summary
protected HeadTail p_resolveIntermediate(Name name, Continuation cont) throws NamingException

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.

p_resolveToClassback to summary
protected ResolveResult p_resolveToClass(Name name, Class<?> contextType, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_resolveToClass.

p_unbindback to summary
protected void p_unbind(Name name, Continuation cont) throws NamingException

Implements abstract com.sun.jndi.toolkit.ctx.PartialCompositeContext.p_unbind.