Top Description Inners Fields Constructors Methods
org.mortbay.naming

public Class NamingContext

extends Object
implements Context, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, javax.naming.Context
Imports
java.util.Enumeration, .Hashtable, .NoSuchElementException, javax.naming.Binding, .CompoundName, .Context, .InitialContext, .LinkRef, .Name, .NameAlreadyBoundException, .NameClassPair, .NameNotFoundException, .NameParser, .NamingEnumeration, .NamingException, .NotContextException, .OperationNotSupportedException, .Reference, .Referenceable, javax.naming.spi.NamingManager, org.mortbay.log.Log

NamingContext

Implementation of Context interface.

Notes

All Names are expected to be Compound, not Composite.

Usage

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
NamingContext.BindingEnumeration

BindingEnumeration

Implementation of NamingEnumeration

Notes

Used to return results of Context.listBindings();

Usage

public class
NamingContext.NameEnumeration

NameEnumeration

Implementation of NamingEnumeration interface.

Field Summary

Modifier and TypeField and Description
protected Hashtable<K, V>
protected Hashtable<K, V>
protected String
protected Context
protected NameParser
public static final Enumeration<E>
public static final String
public static final String

Constructor Summary

AccessConstructor and Description
public
NamingContext(Hashtable<K, V>
environment properties
env
,
String
relative name of this context
name
,
Context
immediate ancestor Context (can be null)
parent
,
NameParser
NameParser for this Context
parser
)

Constructor

public
NamingContext(Hashtable<K, V>
a Hashtable value
env
)

Creates a new NamingContext instance.

public
NamingContext()

Constructor

Method Summary

Modifier and TypeMethod and Description
protected void
addBinding(Name
a Name value
name
,
Object
an Object value
obj
)

Add a name to object binding to this Context.

public Object

Returns:

propVal or previous value of the property
addToEnvironment
(String
name of the property to add
propName
,
Object
value of the property to add
propVal
)

Implements javax.naming.Context.addToEnvironment.

Add an environment setting to this Context
public void
bind(Name
Name of the object
name
,
Object
object to bind
obj
)

Implements javax.naming.Context.bind.

Bind a name to an object
public void
bind(String
a String value
name
,
Object
an Object value
obj
)

Implements javax.naming.Context.bind.

Bind a name (as a String) to an object
public Object

Returns:

copy of this NamingContext
clone
()

Overrides java.lang.Object.clone.

Clone this NamingContext
public void
close()

Implements javax.naming.Context.close.

Do nothing
public Name

Returns:

a Name value
composeName
(Name
a Name value
name
,
Name
a Name value
prefix
)

Implements javax.naming.Context.composeName.

Join two names together.
public String

Returns:

a Name value
composeName
(String
a Name value
name
,
String
a Name value
prefix
)

Implements javax.naming.Context.composeName.

Join two names together.
public Context

Returns:

a Context value
createSubcontext
(Name
a Name value
name
)

Implements javax.naming.Context.createSubcontext.

Create a context as a child of this one
public Context

Returns:

a Context value
createSubcontext
(String
a String value
name
)

Implements javax.naming.Context.createSubcontext.

Create a Context as a child of this one
public void
destroySubcontext(String
name of subcontext to remove
name
)

Implements javax.naming.Context.destroySubcontext.

Not supported
public void
destroySubcontext(Name
name of subcontext to remove
name
)

Implements javax.naming.Context.destroySubcontext.

Not supported
protected Binding

Returns:

a Binding value
getBinding
(Name
a Name value
name
)

Get a name to object binding from this Context

protected Binding

Returns:

null or the Binding
getBinding
(String
as a String
name
)

Get a name to object binding from this Context

public Hashtable<K, V>

Returns:

a copy of the environment of this Context.
getEnvironment
()

Implements javax.naming.Context.getEnvironment.

Get the environment of this Context.
public String

Returns:

name of this Context (relative, not absolute)
getName
()

Getter for _name

public String

Returns:

the full name of this Context
getNameInNamespace
()

Implements javax.naming.Context.getNameInNamespace.

Get the full name of this Context node by visiting it's ancestors back to root.
public NameParser

Returns:

a NameParser value
getNameParser
(Name
a Name value
name
)

Implements javax.naming.Context.getNameParser.

Return a NameParser for this Context.
public NameParser

Returns:

a NameParser value
getNameParser
(String
a Name value
name
)

Implements javax.naming.Context.getNameParser.

Return a NameParser for this Context.
public Context

Returns:

parent Context
getParent
()

Getter for _parent

private boolean
public NamingEnumeration<T>

Returns:

a NamingEnumeration value
list
(Name
a Name value
name
)

Implements javax.naming.Context.list.

List all names bound at Context named by Name
public NamingEnumeration<T>

Returns:

a NamingEnumeration value
list
(String
a Name value
name
)

Implements javax.naming.Context.list.

List all names bound at Context named by Name
public NamingEnumeration<T>

Returns:

a NamingEnumeration value
listBindings
(Name
a Name value
name
)

Implements javax.naming.Context.listBindings.

List all Bindings present at Context named by Name
public NamingEnumeration<T>

Returns:

a NamingEnumeration value
listBindings
(String
a String value
name
)

Implements javax.naming.Context.listBindings.

List all Bindings at Name
public Object
lookup(Name
name of bound object
name
)

Implements javax.naming.Context.lookup.

Lookup a binding by name
public Object

Returns:

object bound to name
lookup
(String
name of bound object
name
)

Implements javax.naming.Context.lookup.

Lookup binding of an object by name
public void
rebind(Name
a Name value
name
,
Object
an Object value
obj
)

Implements javax.naming.Context.rebind.

Overwrite or create a binding
public void
rebind(String
a String value
name
,
Object
an Object value
obj
)

Implements javax.naming.Context.rebind.

Overwrite or create a binding from Name to Object
protected void
public Object

Returns:

value of property or null if it didn't exist
removeFromEnvironment
(String
name of property to remove
propName
)

Implements javax.naming.Context.removeFromEnvironment.

Remove a property from this Context's environment.
public void
rename(Name
a Name value
oldName
,
Name
a Name value
newName
)

Implements javax.naming.Context.rename.

Not supported
public void
rename(String
a Name value
oldName
,
String
a Name value
newName
)

Implements javax.naming.Context.rename.

Not supported
public void
setNameParser(NameParser parser)

Setter for _parser

public Name

Returns:

normalized name
toCanonicalName
(Name
the name to normalize
name
)

Remove leading or trailing empty components from name.

public void
unbind(String
a String value
name
)

Implements javax.naming.Context.unbind.

Not supported.
public void
unbind(Name
a String value
name
)

Implements javax.naming.Context.unbind.

Not supported.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait