aicas logo Jamaica 3.4 release 8

com.sun.jndi.toolkit.ctx
Class AtomicContext

java.lang.Object
  extended by com.sun.jndi.toolkit.ctx.PartialCompositeContext
      extended by com.sun.jndi.toolkit.ctx.ComponentContext
          extended by com.sun.jndi.toolkit.ctx.AtomicContext
All Implemented Interfaces:
Context, Resolver
Direct Known Subclasses:
PartialCompositeDirContext

public abstract class AtomicContext
extends ComponentContext

Clients: deal only with names for its own naming service and deals with single contexts that can be built up into hierarchical naming systems. Direct subclasses of AtomicContext must provide implementations for the abstract a_ Context methods, and c_parseComponent(). If the subclass implements the notion of implicit nns, it must override the a_*_nns Context methods as well.


Field Summary
 
Fields inherited from class com.sun.jndi.toolkit.ctx.ComponentContext
TERMINAL_COMPONENT, TERMINAL_NNS_COMPONENT, USE_CONTINUATION
 
Fields inherited from class com.sun.jndi.toolkit.ctx.PartialCompositeContext
_ATOMIC, _COMPONENT, _contextType, _PARTIAL
 
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 AtomicContext()
           
 
Method Summary
protected  void a_bind_nns(String name, Object obj, Continuation cont)
           
protected abstract  void a_bind(String name, Object obj, Continuation cont)
           
protected  Context a_createSubcontext_nns(String name, Continuation cont)
           
protected abstract  Context a_createSubcontext(String name, Continuation cont)
           
protected  void a_destroySubcontext_nns(String name, Continuation cont)
           
protected abstract  void a_destroySubcontext(String name, Continuation cont)
           
protected  NameParser a_getNameParser_nns(Continuation cont)
           
protected abstract  NameParser a_getNameParser(Continuation cont)
           
protected  NamingEnumeration a_list_nns(Continuation cont)
           
protected abstract  NamingEnumeration a_list(Continuation cont)
           
protected  NamingEnumeration a_listBindings_nns(Continuation cont)
           
protected abstract  NamingEnumeration a_listBindings(Continuation cont)
           
protected  Object a_lookup_nns(String name, Continuation cont)
           
protected abstract  Object a_lookup(String name, Continuation cont)
           
protected  Object a_lookupLink_nns(String name, Continuation cont)
           
protected abstract  Object a_lookupLink(String name, Continuation cont)
           
protected  void a_processJunction_nns(Continuation cont)
          This function is used when implementing a naming system that supports junctions.
protected  void a_processJunction_nns(String name, Continuation cont)
          This function is used when implementing a naming system that supports junctions.
protected  void a_rebind_nns(String name, Object obj, Continuation cont)
           
protected abstract  void a_rebind(String name, Object obj, Continuation cont)
           
protected  void a_rename_nns(String oldname, Name newname, Continuation cont)
           
protected abstract  void a_rename(String oldname, Name newname, Continuation cont)
           
protected  Object a_resolveIntermediate_nns(String name, Continuation cont)
          Resolves the nns for 'name' when the named context is acting as an intermediate context.
protected  void a_unbind_nns(String name, Continuation cont)
           
protected abstract  void a_unbind(String name, Continuation cont)
           
protected  void c_bind_nns(Name name, Object obj, Continuation cont)
           
protected  void c_bind(Name name, Object obj, Continuation cont)
           
protected  Context c_createSubcontext_nns(Name name, Continuation cont)
           
protected  Context c_createSubcontext(Name name, Continuation cont)
           
protected  void c_destroySubcontext_nns(Name name, Continuation cont)
           
protected  void c_destroySubcontext(Name name, Continuation cont)
           
protected  NameParser c_getNameParser_nns(Name name, Continuation cont)
           
protected  NameParser c_getNameParser(Name name, Continuation cont)
           
protected  NamingEnumeration c_list_nns(Name name, Continuation cont)
           
protected  NamingEnumeration c_list(Name name, Continuation cont)
           
protected  NamingEnumeration c_listBindings_nns(Name name, Continuation cont)
           
protected  NamingEnumeration c_listBindings(Name name, Continuation cont)
           
protected  Object c_lookup_nns(Name name, Continuation cont)
           
protected  Object c_lookup(Name name, Continuation cont)
           
protected  Object c_lookupLink_nns(Name name, Continuation cont)
           
protected  Object c_lookupLink(Name name, Continuation cont)
           
protected abstract  StringHeadTail c_parseComponent(String inputName, Continuation cont)
          Parse 'inputName' into two parts: head: the first component in this name tail: the rest of the unused name.
protected  void c_rebind_nns(Name name, Object obj, Continuation cont)
           
protected  void c_rebind(Name name, Object obj, Continuation cont)
           
protected  void c_rename_nns(Name oldname, Name newname, Continuation cont)
           
protected  void c_rename(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  void c_unbind_nns(Name name, Continuation cont)
           
protected  void c_unbind(Name name, Continuation cont)
           
protected  boolean isEmpty(String name)
           
protected  boolean resolve_to_context(Name name, Continuation cont)
          Resolve to context named by 'name'.
protected  void resolve_to_nns_and_continue(Name name, Continuation cont)
          Resolves to nns associated with 'name' and set Continuation to the result.
protected  boolean resolve_to_penultimate_context_nns(Name name, Continuation cont)
          This function is similar to resolve_to_penultimate_context() except it should only be called by the nns() functions.
protected  boolean resolve_to_penultimate_context(Name name, Continuation cont)
          Resolves to penultimate context named by 'name'.
 
Methods inherited from class com.sun.jndi.toolkit.ctx.ComponentContext
c_processJunction_nns, isAllEmpty, p_bind, p_createSubcontext, p_destroySubcontext, p_getNameParser, p_list, p_listBindings, p_lookup, p_lookupLink, p_parseComponent, p_rebind, p_rename, p_resolveIntermediate, p_resolveToClass, p_unbind
 
Methods inherited from class com.sun.jndi.toolkit.ctx.PartialCompositeContext
allEmpty, bind, bind, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getNameParser, getNameParser, getPCContext, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, p_getEnvironment, rebind, rebind, rename, rename, resolveToClass, resolveToClass, unbind, unbind
 
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
addToEnvironment, close, getEnvironment, getNameInNamespace, removeFromEnvironment
 
Methods inherited from interface javax.naming.spi.Resolver
resolveToClass, resolveToClass
 

Constructor Detail

AtomicContext

protected AtomicContext()
Method Detail

a_lookup

protected abstract Object a_lookup(String name,
                                   Continuation cont)
                            throws NamingException
Throws:
NamingException

a_lookupLink

protected abstract Object a_lookupLink(String name,
                                       Continuation cont)
                                throws NamingException
Throws:
NamingException

a_list

protected abstract NamingEnumeration a_list(Continuation cont)
                                     throws NamingException
Throws:
NamingException

a_listBindings

protected abstract NamingEnumeration a_listBindings(Continuation cont)
                                             throws NamingException
Throws:
NamingException

a_bind

protected abstract void a_bind(String name,
                               Object obj,
                               Continuation cont)
                        throws NamingException
Throws:
NamingException

a_rebind

protected abstract void a_rebind(String name,
                                 Object obj,
                                 Continuation cont)
                          throws NamingException
Throws:
NamingException

a_unbind

protected abstract void a_unbind(String name,
                                 Continuation cont)
                          throws NamingException
Throws:
NamingException

a_destroySubcontext

protected abstract void a_destroySubcontext(String name,
                                            Continuation cont)
                                     throws NamingException
Throws:
NamingException

a_createSubcontext

protected abstract Context a_createSubcontext(String name,
                                              Continuation cont)
                                       throws NamingException
Throws:
NamingException

a_rename

protected abstract void a_rename(String oldname,
                                 Name newname,
                                 Continuation cont)
                          throws NamingException
Throws:
NamingException

a_getNameParser

protected abstract NameParser a_getNameParser(Continuation cont)
                                       throws NamingException
Throws:
NamingException

c_parseComponent

protected abstract StringHeadTail c_parseComponent(String inputName,
                                                   Continuation cont)
                                            throws NamingException
Parse 'inputName' into two parts: head: the first component in this name tail: the rest of the unused name. Subclasses should provide an implementation for this method which parses inputName using its own name syntax.

Throws:
NamingException

a_resolveIntermediate_nns

protected Object a_resolveIntermediate_nns(String 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 junctions, this would be equilvalent to a_lookup(name, cont); because for junctions, an intermediate slash simply signifies a syntactic separator. For a system that supports implicit nns, this would be equivalent to a_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 a_processJunction_nns()). Contexts that implement implicit nns directly should provide an appropriate override.

Throws:
NamingException

a_lookup_nns

protected Object a_lookup_nns(String name,
                              Continuation cont)
                       throws NamingException
Throws:
NamingException

a_lookupLink_nns

protected Object a_lookupLink_nns(String name,
                                  Continuation cont)
                           throws NamingException
Throws:
NamingException

a_list_nns

protected NamingEnumeration a_list_nns(Continuation cont)
                                throws NamingException
Throws:
NamingException

a_listBindings_nns

protected NamingEnumeration a_listBindings_nns(Continuation cont)
                                        throws NamingException
Throws:
NamingException

a_bind_nns

protected void a_bind_nns(String name,
                          Object obj,
                          Continuation cont)
                   throws NamingException
Throws:
NamingException

a_rebind_nns

protected void a_rebind_nns(String name,
                            Object obj,
                            Continuation cont)
                     throws NamingException
Throws:
NamingException

a_unbind_nns

protected void a_unbind_nns(String name,
                            Continuation cont)
                     throws NamingException
Throws:
NamingException

a_createSubcontext_nns

protected Context a_createSubcontext_nns(String name,
                                         Continuation cont)
                                  throws NamingException
Throws:
NamingException

a_destroySubcontext_nns

protected void a_destroySubcontext_nns(String name,
                                       Continuation cont)
                                throws NamingException
Throws:
NamingException

a_rename_nns

protected void a_rename_nns(String oldname,
                            Name newname,
                            Continuation cont)
                     throws NamingException
Throws:
NamingException

a_getNameParser_nns

protected NameParser a_getNameParser_nns(Continuation cont)
                                  throws NamingException
Throws:
NamingException

isEmpty

protected boolean isEmpty(String name)

c_lookup

protected Object c_lookup(Name name,
                          Continuation cont)
                   throws NamingException
Specified by:
c_lookup in class ComponentContext
Throws:
NamingException

c_lookupLink

protected Object c_lookupLink(Name name,
                              Continuation cont)
                       throws NamingException
Specified by:
c_lookupLink in class ComponentContext
Throws:
NamingException

c_list

protected NamingEnumeration c_list(Name name,
                                   Continuation cont)
                            throws NamingException
Specified by:
c_list in class ComponentContext
Throws:
NamingException

c_listBindings

protected NamingEnumeration c_listBindings(Name name,
                                           Continuation cont)
                                    throws NamingException
Specified by:
c_listBindings in class ComponentContext
Throws:
NamingException

c_bind

protected void c_bind(Name name,
                      Object obj,
                      Continuation cont)
               throws NamingException
Specified by:
c_bind in class ComponentContext
Throws:
NamingException

c_rebind

protected void c_rebind(Name name,
                        Object obj,
                        Continuation cont)
                 throws NamingException
Specified by:
c_rebind in class ComponentContext
Throws:
NamingException

c_unbind

protected void c_unbind(Name name,
                        Continuation cont)
                 throws NamingException
Specified by:
c_unbind in class ComponentContext
Throws:
NamingException

c_destroySubcontext

protected void c_destroySubcontext(Name name,
                                   Continuation cont)
                            throws NamingException
Specified by:
c_destroySubcontext in class ComponentContext
Throws:
NamingException

c_createSubcontext

protected Context c_createSubcontext(Name name,
                                     Continuation cont)
                              throws NamingException
Specified by:
c_createSubcontext in class ComponentContext
Throws:
NamingException

c_rename

protected void c_rename(Name oldname,
                        Name newname,
                        Continuation cont)
                 throws NamingException
Specified by:
c_rename in class ComponentContext
Throws:
NamingException

c_getNameParser

protected NameParser c_getNameParser(Name name,
                                     Continuation cont)
                              throws NamingException
Specified by:
c_getNameParser in class ComponentContext
Throws:
NamingException

c_resolveIntermediate_nns

protected Object c_resolveIntermediate_nns(Name name,
                                           Continuation cont)
                                    throws NamingException
Description copied from class: ComponentContext
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.

Overrides:
c_resolveIntermediate_nns in class ComponentContext
Throws:
NamingException

c_lookup_nns

protected Object c_lookup_nns(Name name,
                              Continuation cont)
                       throws NamingException
Overrides:
c_lookup_nns in class ComponentContext
Throws:
NamingException

c_lookupLink_nns

protected Object c_lookupLink_nns(Name name,
                                  Continuation cont)
                           throws NamingException
Overrides:
c_lookupLink_nns in class ComponentContext
Throws:
NamingException

c_list_nns

protected NamingEnumeration c_list_nns(Name name,
                                       Continuation cont)
                                throws NamingException
Overrides:
c_list_nns in class ComponentContext
Throws:
NamingException

c_listBindings_nns

protected NamingEnumeration c_listBindings_nns(Name name,
                                               Continuation cont)
                                        throws NamingException
Overrides:
c_listBindings_nns in class ComponentContext
Throws:
NamingException

c_bind_nns

protected void c_bind_nns(Name name,
                          Object obj,
                          Continuation cont)
                   throws NamingException
Overrides:
c_bind_nns in class ComponentContext
Throws:
NamingException

c_rebind_nns

protected void c_rebind_nns(Name name,
                            Object obj,
                            Continuation cont)
                     throws NamingException
Overrides:
c_rebind_nns in class ComponentContext
Throws:
NamingException

c_unbind_nns

protected void c_unbind_nns(Name name,
                            Continuation cont)
                     throws NamingException
Overrides:
c_unbind_nns in class ComponentContext
Throws:
NamingException

c_createSubcontext_nns

protected Context c_createSubcontext_nns(Name name,
                                         Continuation cont)
                                  throws NamingException
Overrides:
c_createSubcontext_nns in class ComponentContext
Throws:
NamingException

c_destroySubcontext_nns

protected void c_destroySubcontext_nns(Name name,
                                       Continuation cont)
                                throws NamingException
Overrides:
c_destroySubcontext_nns in class ComponentContext
Throws:
NamingException

c_rename_nns

protected void c_rename_nns(Name oldname,
                            Name newname,
                            Continuation cont)
                     throws NamingException
Overrides:
c_rename_nns in class ComponentContext
Throws:
NamingException

c_getNameParser_nns

protected NameParser c_getNameParser_nns(Name name,
                                         Continuation cont)
                                  throws NamingException
Overrides:
c_getNameParser_nns in class ComponentContext
Throws:
NamingException

a_processJunction_nns

protected void a_processJunction_nns(String name,
                                     Continuation cont)
                              throws NamingException
This function is used when implementing a naming system that supports junctions. For example, when the a_bind_nns(name, newobj) method is invoked, that means the caller is attempting to bind the object 'newobj' to the nns of 'name'. For context that supports junctions, 'name' names a junction and is pointing to the root of another naming system, which in turn might have an nns. This means that a_bind_nns() should first resolve 'name' and attempt to continue the operation in the context named by 'name'. (i.e. bind to the nns of the context named by 'name'). If name is already empty, then throw NameNotFoundException because this context by default does not have any nns.

Throws:
NamingException

a_processJunction_nns

protected void a_processJunction_nns(Continuation cont)
                              throws NamingException
This function is used when implementing a naming system that supports junctions. For example, when the a_list_nns(newobj) method is invoked, that means the caller is attempting to list the the nns context of of this context. For a context that supports junctions, it by default does not have any nns. Consequently, a NameNotFoundException is thrown.

Throws:
NamingException

resolve_to_context

protected boolean resolve_to_context(Name name,
                                     Continuation cont)
                              throws NamingException
Resolve to context named by 'name'. Returns true if at named context (i.e. 'name' is empty name). Returns false otherwise, and sets Continuation on parts of 'name' not yet resolved.

Throws:
NamingException

resolve_to_penultimate_context

protected boolean resolve_to_penultimate_context(Name name,
                                                 Continuation cont)
                                          throws NamingException
Resolves to penultimate context named by 'name'. Returns true if penultimate context has been reached (i.e. name only has one atomic component left). Returns false otherwise, and sets Continuation to parts of name not yet resolved.

Throws:
NamingException

resolve_to_penultimate_context_nns

protected boolean resolve_to_penultimate_context_nns(Name name,
                                                     Continuation cont)
                                              throws NamingException
This function is similar to resolve_to_penultimate_context() except it should only be called by the nns() functions. This function fixes any exception or continuations so that it will have the proper nns name.

Throws:
NamingException

resolve_to_nns_and_continue

protected void resolve_to_nns_and_continue(Name name,
                                           Continuation cont)
                                    throws NamingException
Resolves to nns associated with 'name' and set Continuation to the result.

Throws:
NamingException

aicas logo Jamaica 3.4 release 8

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2009 aicas GmbH. All Rights Reserved.