org.eclipse.jetty.jndi
类 NamingContext

java.lang.Object
  继承者 org.eclipse.jetty.jndi.NamingContext
所有已实现的接口:
Cloneable, Context, Dumpable

public class NamingContext
extends Object
implements Context, Cloneable, Dumpable

NamingContext

Implementation of Context interface.

Notes

All Names are expected to be Compound, not Composite.


嵌套类摘要
static interface NamingContext.Listener
          Naming Context Listener.
 
字段摘要
protected  Map<String,Binding> _bindings
           
protected  Hashtable<String,Object> _env
           
protected  String _name
           
protected  NamingContext _parent
           
protected  NameParser _parser
           
static String LOCK_PROPERTY
           
static String UNLOCK_PROPERTY
           
 
从接口 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
 
构造方法摘要
NamingContext(Hashtable<String,Object> env, String name, NamingContext parent, NameParser parser)
          Constructor
 
方法摘要
 void addBinding(Name name, Object obj)
          Add a name to object binding to this Context.
 void addListener(NamingContext.Listener listener)
           
 Object addToEnvironment(String propName, Object propVal)
          Add an environment setting to this Context
 void bind(Name name, Object obj)
          Bind a name to an object
 void bind(String name, Object obj)
          Bind a name (as a String) to an object
 Object clone()
          Clone this NamingContext
 void close()
          Do nothing
 Name composeName(Name name, Name prefix)
          Join two names together.
 String composeName(String name, String prefix)
          Join two names together.
 Context createSubcontext(Name name)
          Create a context as a child of this one
 Context createSubcontext(String name)
          Create a Context as a child of this one
 void destroySubcontext(Name name)
           
 void destroySubcontext(String name)
           
 String dump()
           
 void dump(Appendable out, String indent)
           
 Binding getBinding(Name name)
          Get a name to object binding from this Context
 Binding getBinding(String name)
          Get a name to object binding from this Context
 Map<String,Binding> getBindings()
           
 Hashtable getEnvironment()
          Get the environment of this Context.
 String getName()
          Getter for _name
 String getNameInNamespace()
          Get the full name of this Context node by visiting it's ancestors back to root.
 NameParser getNameParser(Name name)
          Return a NameParser for this Context.
 NameParser getNameParser(String name)
          Return a NameParser for this Context.
 Context getParent()
          Getter for _parent
 boolean isLocked()
           
 NamingEnumeration list(Name name)
          List all names bound at Context named by Name
 NamingEnumeration list(String name)
          List all names bound at Context named by Name
 NamingEnumeration listBindings(Name name)
          List all Bindings present at Context named by Name
 NamingEnumeration listBindings(String name)
          List all Bindings at Name
 Object lookup(Name name)
          Lookup a binding by name
 Object lookup(String name)
          Lookup binding of an object by name
 Object lookupLink(Name name)
          Lookup link bound to name
 Object lookupLink(String name)
          Lookup link bound to name
 void rebind(Name name, Object obj)
          Overwrite or create a binding
 void rebind(String name, Object obj)
          Overwrite or create a binding from Name to Object
 void removeBinding(Name name)
           
 Object removeFromEnvironment(String propName)
          Remove a property from this Context's environment.
 boolean removeListener(NamingContext.Listener listener)
           
 void rename(Name oldName, Name newName)
          Not supported
 void rename(String oldName, String newName)
          Not supported
 void setBindings(Map<String,Binding> bindings)
           
 void setEnv(Hashtable<String,Object> env)
           
 void setNameParser(NameParser parser)
          Setter for _parser
 Name toCanonicalName(Name name)
          Remove leading or trailing empty components from name.
 void unbind(Name name)
          Not supported.
 void unbind(String name)
          Not supported.
 
从类 java.lang.Object 继承的方法
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

LOCK_PROPERTY

public static final String LOCK_PROPERTY
另请参见:
常量字段值

UNLOCK_PROPERTY

public static final String UNLOCK_PROPERTY
另请参见:
常量字段值

_env

protected final Hashtable<String,Object> _env

_bindings

protected Map<String,Binding> _bindings

_parent

protected NamingContext _parent

_name

protected String _name

_parser

protected NameParser _parser
构造方法详细信息

NamingContext

public NamingContext(Hashtable<String,Object> env,
                     String name,
                     NamingContext parent,
                     NameParser parser)
Constructor

参数:
env - environment properties
name - relative name of this context
parent - immediate ancestor Context (can be null)
parser - NameParser for this Context
方法详细信息

clone

public Object clone()
             throws CloneNotSupportedException
Clone this NamingContext

覆盖:
Object 中的 clone
返回:
copy of this NamingContext
抛出:
CloneNotSupportedException - if an error occurs

getName

public String getName()
Getter for _name

返回:
name of this Context (relative, not absolute)

getParent

public Context getParent()
Getter for _parent

返回:
parent Context

setNameParser

public void setNameParser(NameParser parser)
Setter for _parser


setEnv

public void setEnv(Hashtable<String,Object> env)

getBindings

public Map<String,Binding> getBindings()

setBindings

public void setBindings(Map<String,Binding> bindings)

bind

public void bind(Name name,
                 Object obj)
          throws NamingException
Bind a name to an object

指定者:
接口 Context 中的 bind
参数:
name - Name of the object
obj - object to bind
抛出:
NamingException - if an error occurs

bind

public void bind(String name,
                 Object obj)
          throws NamingException
Bind a name (as a String) to an object

指定者:
接口 Context 中的 bind
参数:
name - a String value
obj - an Object value
抛出:
NamingException - if an error occurs

createSubcontext

public Context createSubcontext(Name name)
                         throws NamingException
Create a context as a child of this one

指定者:
接口 Context 中的 createSubcontext
参数:
name - a Name value
返回:
a Context value
抛出:
NamingException - if an error occurs

createSubcontext

public Context createSubcontext(String name)
                         throws NamingException
Create a Context as a child of this one

指定者:
接口 Context 中的 createSubcontext
参数:
name - a String value
返回:
a Context value
抛出:
NamingException - if an error occurs

destroySubcontext

public void destroySubcontext(String name)
                       throws NamingException
指定者:
接口 Context 中的 destroySubcontext
参数:
name - name of subcontext to remove
抛出:
NamingException - if an error occurs

destroySubcontext

public void destroySubcontext(Name name)
                       throws NamingException
指定者:
接口 Context 中的 destroySubcontext
参数:
name - name of subcontext to remove
抛出:
NamingException - if an error occurs

lookup

public Object lookup(Name name)
              throws NamingException
Lookup a binding by name

指定者:
接口 Context 中的 lookup
参数:
name - name of bound object
抛出:
NamingException - if an error occurs

lookup

public Object lookup(String name)
              throws NamingException
Lookup binding of an object by name

指定者:
接口 Context 中的 lookup
参数:
name - name of bound object
返回:
object bound to name
抛出:
NamingException - if an error occurs

lookupLink

public Object lookupLink(Name name)
                  throws NamingException
Lookup link bound to name

指定者:
接口 Context 中的 lookupLink
参数:
name - name of link binding
返回:
LinkRef or plain object bound at name
抛出:
NamingException - if an error occurs

lookupLink

public Object lookupLink(String name)
                  throws NamingException
Lookup link bound to name

指定者:
接口 Context 中的 lookupLink
参数:
name - name of link binding
返回:
LinkRef or plain object bound at name
抛出:
NamingException - if an error occurs

list

public NamingEnumeration list(Name name)
                       throws NamingException
List all names bound at Context named by Name

指定者:
接口 Context 中的 list
参数:
name - a Name value
返回:
a NamingEnumeration value
抛出:
NamingException - if an error occurs

list

public NamingEnumeration list(String name)
                       throws NamingException
List all names bound at Context named by Name

指定者:
接口 Context 中的 list
参数:
name - a Name value
返回:
a NamingEnumeration value
抛出:
NamingException - if an error occurs

listBindings

public NamingEnumeration listBindings(Name name)
                               throws NamingException
List all Bindings present at Context named by Name

指定者:
接口 Context 中的 listBindings
参数:
name - a Name value
返回:
a NamingEnumeration value
抛出:
NamingException - if an error occurs

listBindings

public NamingEnumeration listBindings(String name)
                               throws NamingException
List all Bindings at Name

指定者:
接口 Context 中的 listBindings
参数:
name - a String value
返回:
a NamingEnumeration value
抛出:
NamingException - if an error occurs

rebind

public void rebind(Name name,
                   Object obj)
            throws NamingException
Overwrite or create a binding

指定者:
接口 Context 中的 rebind
参数:
name - a Name value
obj - an Object value
抛出:
NamingException - if an error occurs

rebind

public void rebind(String name,
                   Object obj)
            throws NamingException
Overwrite or create a binding from Name to Object

指定者:
接口 Context 中的 rebind
参数:
name - a String value
obj - an Object value
抛出:
NamingException - if an error occurs

unbind

public void unbind(String name)
            throws NamingException
Not supported.

指定者:
接口 Context 中的 unbind
参数:
name - a String value
抛出:
NamingException - if an error occurs

unbind

public void unbind(Name name)
            throws NamingException
Not supported.

指定者:
接口 Context 中的 unbind
参数:
name - a String value
抛出:
NamingException - if an error occurs

rename

public void rename(Name oldName,
                   Name newName)
            throws NamingException
Not supported

指定者:
接口 Context 中的 rename
参数:
oldName - a Name value
newName - a Name value
抛出:
NamingException - if an error occurs

rename

public void rename(String oldName,
                   String newName)
            throws NamingException
Not supported

指定者:
接口 Context 中的 rename
参数:
oldName - a Name value
newName - a Name value
抛出:
NamingException - if an error occurs

composeName

public Name composeName(Name name,
                        Name prefix)
                 throws NamingException
Join two names together. These are treated as CompoundNames.

指定者:
接口 Context 中的 composeName
参数:
name - a Name value
prefix - a Name value
返回:
a Name value
抛出:
NamingException - if an error occurs

composeName

public String composeName(String name,
                          String prefix)
                   throws NamingException
Join two names together. These are treated as CompoundNames.

指定者:
接口 Context 中的 composeName
参数:
name - a Name value
prefix - a Name value
返回:
a Name value
抛出:
NamingException - if an error occurs

close

public void close()
           throws NamingException
Do nothing

指定者:
接口 Context 中的 close
抛出:
NamingException - if an error occurs

getNameParser

public NameParser getNameParser(Name name)
Return a NameParser for this Context.

指定者:
接口 Context 中的 getNameParser
参数:
name - a Name value
返回:
a NameParser value

getNameParser

public NameParser getNameParser(String name)
Return a NameParser for this Context.

指定者:
接口 Context 中的 getNameParser
参数:
name - a Name value
返回:
a NameParser value

getNameInNamespace

public String getNameInNamespace()
                          throws NamingException
Get the full name of this Context node by visiting it's ancestors back to root. NOTE: if this Context has a URL namespace then the URL prefix will be missing

指定者:
接口 Context 中的 getNameInNamespace
返回:
the full name of this Context
抛出:
NamingException - if an error occurs

addToEnvironment

public Object addToEnvironment(String propName,
                               Object propVal)
                        throws NamingException
Add an environment setting to this Context

指定者:
接口 Context 中的 addToEnvironment
参数:
propName - name of the property to add
propVal - value of the property to add
返回:
propVal or previous value of the property
抛出:
NamingException - if an error occurs

removeFromEnvironment

public Object removeFromEnvironment(String propName)
                             throws NamingException
Remove a property from this Context's environment.

指定者:
接口 Context 中的 removeFromEnvironment
参数:
propName - name of property to remove
返回:
value of property or null if it didn't exist
抛出:
NamingException - if an error occurs

getEnvironment

public Hashtable getEnvironment()
Get the environment of this Context.

指定者:
接口 Context 中的 getEnvironment
返回:
a copy of the environment of this Context.

addBinding

public void addBinding(Name name,
                       Object obj)
                throws NameAlreadyBoundException
Add a name to object binding to this Context.

参数:
name - a Name value
obj - an Object value
抛出:
NameAlreadyBoundException

getBinding

public Binding getBinding(Name name)
Get a name to object binding from this Context

参数:
name - a Name value
返回:
a Binding value

getBinding

public Binding getBinding(String name)
Get a name to object binding from this Context

参数:
name - as a String
返回:
null or the Binding

removeBinding

public void removeBinding(Name name)

toCanonicalName

public Name toCanonicalName(Name name)
Remove leading or trailing empty components from name. Eg "/comp/env/" -> "comp/env"

参数:
name - the name to normalize
返回:
normalized name

isLocked

public boolean isLocked()

dump

public String dump()
指定者:
接口 Dumpable 中的 dump

dump

public void dump(Appendable out,
                 String indent)
          throws IOException
指定者:
接口 Dumpable 中的 dump
抛出:
IOException

addListener

public void addListener(NamingContext.Listener listener)

removeListener

public boolean removeListener(NamingContext.Listener listener)


Copyright © 2013. All Rights Reserved.