com.caucho.naming
Class DirContextImpl

java.lang.Object
  extended by com.caucho.naming.ContextImpl
      extended by com.caucho.naming.DirContextImpl
All Implemented Interfaces:
javax.naming.Context, javax.naming.directory.DirContext

public class DirContextImpl
extends ContextImpl
implements javax.naming.directory.DirContext

Resin's implementation of the JNDI DirContext. The actual storage of the persistent data is in the AbstractModel.

The DirContextImpl is just a Visitor around the AbstractModel which also encapsulate the JNDI environment.

In JNDI, each Context is a <model, env> pair. Each client might pass a different environment to the InitialContext so each ContextImpl must be unique for each client. (Granted, this is a bit wasteful of space which is why JNDI values should be cached.)

Applications which want a different model can still use ContextImpl and specify the root object for AbstractModel. ContextImpl will take care of the JNDI API for the model.


Field Summary
protected static L10N L
           
protected static java.util.logging.Logger log
           
 
Fields inherited from class com.caucho.naming.ContextImpl
_env, _model, _name
 
Fields inherited from interface javax.naming.directory.DirContext
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
 
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
DirContextImpl(AbstractModel model, java.util.Hashtable env)
          Creates a DirContextImpl.
DirContextImpl(java.lang.String name, AbstractModel model, java.util.Hashtable env)
          Creates a DirContextImpl.
 
Method Summary
 void bind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 void bind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
protected  ContextImpl create(java.lang.String name, AbstractModel model, java.util.Hashtable env)
          Creates a new instance of the ContextImpl.
 javax.naming.directory.DirContext createSubcontext(javax.naming.Name name, javax.naming.directory.Attributes attrs)
           
 javax.naming.directory.DirContext createSubcontext(java.lang.String name, javax.naming.directory.Attributes attrs)
           
 javax.naming.directory.Attributes getAttributes(javax.naming.Name name)
           
 javax.naming.directory.Attributes getAttributes(javax.naming.Name name, java.lang.String[] attrIds)
           
 javax.naming.directory.Attributes getAttributes(java.lang.String name)
           
 javax.naming.directory.Attributes getAttributes(java.lang.String name, java.lang.String[] attrIds)
           
 javax.naming.directory.DirContext getSchema(javax.naming.Name name)
           
 javax.naming.directory.DirContext getSchema(java.lang.String name)
           
 javax.naming.directory.DirContext getSchemaClassDefinition(javax.naming.Name name)
           
 javax.naming.directory.DirContext getSchemaClassDefinition(java.lang.String name)
           
 void modifyAttributes(javax.naming.Name name, int mod_op, javax.naming.directory.Attributes attrs)
           
 void modifyAttributes(javax.naming.Name name, javax.naming.directory.ModificationItem[] mods)
           
 void modifyAttributes(java.lang.String name, int mod_op, javax.naming.directory.Attributes attrs)
           
 void modifyAttributes(java.lang.String name, javax.naming.directory.ModificationItem[] mods)
           
 void rebind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 void rebind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, javax.naming.directory.Attributes attrs)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, javax.naming.directory.Attributes attrs, java.lang.String[] args)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)
           
 javax.naming.NamingEnumeration search(javax.naming.Name name, java.lang.String filterExpr, javax.naming.directory.SearchControls cons)
           
 javax.naming.NamingEnumeration search(java.lang.String name, javax.naming.directory.Attributes attrs)
           
 javax.naming.NamingEnumeration search(java.lang.String name, javax.naming.directory.Attributes attrs, java.lang.String[] args)
           
 javax.naming.NamingEnumeration search(java.lang.String name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)
           
 javax.naming.NamingEnumeration search(java.lang.String name, java.lang.String filterExpr, javax.naming.directory.SearchControls cons)
           
 java.lang.String toString()
          Returns a string value.
 
Methods inherited from class com.caucho.naming.ContextImpl
addToEnvironment, bind, bind, close, composeName, composeName, create, createSingleSubcontext, createSubcontext, createSubcontext, destroySingleSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getFullPath, getFullPath, getModel, getName, getNameInNamespace, getNameParser, getNameParser, getSeparator, getSeparatorString, list, list, listBindings, listBindings, listSingle, lookup, lookup, lookupImpl, lookupLink, lookupLink, lookupSingle, parseFirst, parseRest, rebind, rebind, rebindSingle, removeFromEnvironment, rename, rename, unbind, unbind, unbindSingle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.naming.Context
addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind
 

Field Detail

L

protected static L10N L

log

protected static java.util.logging.Logger log
Constructor Detail

DirContextImpl

public DirContextImpl(AbstractModel model,
                      java.util.Hashtable env)
Creates a DirContextImpl.

Parameters:
model - The underlying storage node.
env - The client's JNDI environment.

DirContextImpl

public DirContextImpl(java.lang.String name,
                      AbstractModel model,
                      java.util.Hashtable env)
Creates a DirContextImpl.

Parameters:
name - JNDI name, used for error messages, etc.
model - The underlying storage node.
env - The client's JNDI environment.
Method Detail

create

protected ContextImpl create(java.lang.String name,
                             AbstractModel model,
                             java.util.Hashtable env)
Creates a new instance of the ContextImpl. Subclasses will override this method to return a new instance of the subclass.

Overrides:
create in class ContextImpl
Parameters:
name - the JNDI name for the new context
model - the underlying storage node
env - the client's JNDI environment.
Returns:
a new instance of the implementing class.

bind

public void bind(javax.naming.Name name,
                 java.lang.Object obj,
                 javax.naming.directory.Attributes attrs)
Specified by:
bind in interface javax.naming.directory.DirContext

bind

public void bind(java.lang.String name,
                 java.lang.Object obj,
                 javax.naming.directory.Attributes attrs)
Specified by:
bind in interface javax.naming.directory.DirContext

createSubcontext

public javax.naming.directory.DirContext createSubcontext(javax.naming.Name name,
                                                          javax.naming.directory.Attributes attrs)
Specified by:
createSubcontext in interface javax.naming.directory.DirContext

createSubcontext

public javax.naming.directory.DirContext createSubcontext(java.lang.String name,
                                                          javax.naming.directory.Attributes attrs)
Specified by:
createSubcontext in interface javax.naming.directory.DirContext

getAttributes

public javax.naming.directory.Attributes getAttributes(javax.naming.Name name)
Specified by:
getAttributes in interface javax.naming.directory.DirContext

getAttributes

public javax.naming.directory.Attributes getAttributes(java.lang.String name)
Specified by:
getAttributes in interface javax.naming.directory.DirContext

getAttributes

public javax.naming.directory.Attributes getAttributes(javax.naming.Name name,
                                                       java.lang.String[] attrIds)
Specified by:
getAttributes in interface javax.naming.directory.DirContext

getAttributes

public javax.naming.directory.Attributes getAttributes(java.lang.String name,
                                                       java.lang.String[] attrIds)
Specified by:
getAttributes in interface javax.naming.directory.DirContext

getSchema

public javax.naming.directory.DirContext getSchema(javax.naming.Name name)
Specified by:
getSchema in interface javax.naming.directory.DirContext

getSchema

public javax.naming.directory.DirContext getSchema(java.lang.String name)
Specified by:
getSchema in interface javax.naming.directory.DirContext

getSchemaClassDefinition

public javax.naming.directory.DirContext getSchemaClassDefinition(javax.naming.Name name)
Specified by:
getSchemaClassDefinition in interface javax.naming.directory.DirContext

getSchemaClassDefinition

public javax.naming.directory.DirContext getSchemaClassDefinition(java.lang.String name)
Specified by:
getSchemaClassDefinition in interface javax.naming.directory.DirContext

modifyAttributes

public void modifyAttributes(javax.naming.Name name,
                             int mod_op,
                             javax.naming.directory.Attributes attrs)
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext

modifyAttributes

public void modifyAttributes(java.lang.String name,
                             int mod_op,
                             javax.naming.directory.Attributes attrs)
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext

modifyAttributes

public void modifyAttributes(javax.naming.Name name,
                             javax.naming.directory.ModificationItem[] mods)
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext

modifyAttributes

public void modifyAttributes(java.lang.String name,
                             javax.naming.directory.ModificationItem[] mods)
Specified by:
modifyAttributes in interface javax.naming.directory.DirContext

rebind

public void rebind(javax.naming.Name name,
                   java.lang.Object obj,
                   javax.naming.directory.Attributes attrs)
Specified by:
rebind in interface javax.naming.directory.DirContext

rebind

public void rebind(java.lang.String name,
                   java.lang.Object obj,
                   javax.naming.directory.Attributes attrs)
Specified by:
rebind in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             javax.naming.directory.Attributes attrs)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             javax.naming.directory.Attributes attrs)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             javax.naming.directory.Attributes attrs,
                                             java.lang.String[] args)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             javax.naming.directory.Attributes attrs,
                                             java.lang.String[] args)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             java.lang.String filterExpr,
                                             java.lang.Object[] filterArgs,
                                             javax.naming.directory.SearchControls cons)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             java.lang.String filterExpr,
                                             java.lang.Object[] filterArgs,
                                             javax.naming.directory.SearchControls cons)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(javax.naming.Name name,
                                             java.lang.String filterExpr,
                                             javax.naming.directory.SearchControls cons)
Specified by:
search in interface javax.naming.directory.DirContext

search

public javax.naming.NamingEnumeration search(java.lang.String name,
                                             java.lang.String filterExpr,
                                             javax.naming.directory.SearchControls cons)
Specified by:
search in interface javax.naming.directory.DirContext

toString

public java.lang.String toString()
Returns a string value.

Overrides:
toString in class ContextImpl