Provides an implementation of a JNDI context for the Jeremie registry.
addToEnvironment
public Object addToEnvironment(String propName,
Object propVal)
throws NamingException
Sets the value of a property in the current context's environment.
Overwrites any previous value of the property.
propName
- the name of the property;propVal
- the value of the property.
- the previous value of the property, possibly null.
bind
public void bind(Name name,
Object obj)
throws NamingException
Binds the given name with the given object in the current context's
registry. The object being bound must be either a remote object,
or a JNDI reference or referenceable object.
Before binding, the javax.naming.spi.NamingManager is called
to consult any possible state factories concerning the object.
javax.naming.Reference
, or javax.naming.Referenceable.
name
- the (non-empty) name to bind;obj
- the object to bind which must be either java.rmi.Remote
,
bind
public void bind(String name,
Object obj)
throws NamingException
Binds the given stringified name with the given object in the current
context's registry. The object being bound must be either a remote object,
or a JNDI reference or referenceable object.
javax.naming.Reference
, or javax.naming.Referenceable.
name
- the (non-empty) stringified name to bind;obj
- the object to bind which must be either java.rmi.Remote
,
close
public void close()
throws NamingException
Closes this registry context.
composeName
public Name composeName(Name name,
Name prefix)
throws NamingException
Composes two names, one being relative to the current context, the other
being the name of the current context relative to one of its ancestors.
name
- a name relative to this registry context;prefix
- the name of this context relative to one of its ancestors.
- a composed name.
composeName
public String composeName(String name,
String prefix)
throws NamingException
Composes two stringified names, one being relative to the current context,
the other being the stringified name of the current context relative to
one of its ancestors.
name
- a stringified name relative to this registry context;prefix
- the stringified name of this context relative to one of its
ancestors.
- a composed stringified name.
createSubcontext
public Context createSubcontext(Name name)
throws NamingException
Subcontexts are not supported by Jeremie registry contexts.
createSubcontext
public Context createSubcontext(String name)
throws NamingException
Subcontexts are not supported by Jeremie registry contexts.
destroySubcontext
public void destroySubcontext(Name name)
throws NamingException
Subcontexts are not supported by Jeremie registry contexts.
destroySubcontext
public void destroySubcontext(String name)
throws NamingException
Subcontexts are not supported by Jeremie registry contexts.
getEnvironment
public Hashtable getEnvironment()
throws NamingException
Returns the environment of the current context.
- the possibly empty environment of this context.
getNameInNamespace
public String getNameInNamespace()
throws NamingException
Retrieves the full name of the current context within its own namespace,
in other words, the empty string "".
- the full name of the current context.
getNameParser
public NameParser getNameParser(Name name)
throws NamingException
Retrieves the current context's name parser.
name
- the name of the context from which to get the parser; ignored.
- the name parser of the current registry context.
getNameParser
public NameParser getNameParser(String name)
throws NamingException
Retrieves the current context's name parser.
name
- the stringified name of the context from which to get the
parser; ignored.
- the name parser of the current registry context.
list
public NamingEnumeration list(Name name)
throws NamingException
Enumerates the names and the class names of the objects that they are
bound to in the current context's registry. The input name must be empty
so that it signifies the current context. For each (name, class name) pair,
the class name is java.lang.Object
.
name
- the name of the context to list; must be empty.
- an enumeration of the (name, class name) pairs in the registry.
list
public NamingEnumeration list(String name)
throws NamingException
Enumerates the names and the class names of the objects that they are
bound to in the current context's registry. The input stringified
name must be "" so that it signifies the current context. For each
(name, class name) pair, the class name is java.lang.Object
.
name
- the stringifed name of the context to list; must be "".
- an enumeration of the (name, class name) pairs in the registry.
listBindings
public NamingEnumeration listBindings(Name name)
throws NamingException
Enumerates the names and objects that they are bound to in the current
context's registry. The input name must be empty so that it signifies
the current context.
name
- the name of the context to list; must be empty.
- an enumeration of the (name, object) pairs in the registry.
listBindings
public NamingEnumeration listBindings(String name)
throws NamingException
Enumerates the names and objects that they are bound to in the current
context's registry. The input stringified name must be "" so that it
signifies the current context.
name
- the stringified name of the context to list; must be "".
- an enumeration of the (name, object) pairs in the registry.
lookup
public Object lookup(Name name)
throws NamingException
Retrieves the object bound to the given name in the current context's
registry.
If the object returned is a
Jeremie JNDI reference
, then the javax.naming.spi.NamingManager is called
to retrieve the target object referenced.
name
- the name of the object to be retrieved. If empty,
then a new instance of this context is returned.
- the object bound to the name, or whose reference is bound to the name.
lookup
public Object lookup(String name)
throws NamingException
Retrieves the object bound to the given stringified name in the current
context's registry.
name
- the stringified name of the object to be retrieved. If empty,
then a new instance of this context is returned.
- the object bound to the name, or whose reference is bound to the name.
lookupLink
public Object lookupLink(Name name)
throws NamingException
Links are not treated specially by Jeremie registry contexts. This method
does the same as the lookup(Name) method.
name
- the name of the object to be retrieved. If empty,
then a new instance of this context is returned.
- the object bound to the name, or whose reference is bound to the name.
lookup(Name)
lookupLink
public Object lookupLink(String name)
throws NamingException
Links are not treated specially by Jeremie registry contexts. This method
does the same as the lookup(String) method.
name
- the name of the object to be retrieved. If empty,
then a new instance of this context is returned.
- the object bound to the name, or whose reference is bound to the name.
lookup(String)
rebind
public void rebind(Name name,
Object obj)
throws NamingException
Rebinds the given name with the given object in the current
context's registry. The object being bound must be either a remote object,
or a JNDI reference or referenceable object.
Before binding, the javax.naming.spi.NamingManager is called
to consult any possible state factories concerning the object.
javax.naming.Reference
, or javax.naming.Referenceable.
name
- the (non-empty) name to rebind;obj
- the object to bind which must be either java.rmi.Remote
,
rebind
public void rebind(String name,
Object obj)
throws NamingException
Rebinds the given stringified name with the given object in the current
context's registry. The object being bound must be either a remote object,
or a JNDI reference or referenceable object.
javax.naming.Reference
, or javax.naming.Referenceable.
name
- the (non-empty) stringified name to rebind;obj
- the object to bind which must be either java.rmi.Remote
,
removeFromEnvironment
public Object removeFromEnvironment(String propName)
throws NamingException
Undefines the value of a property in the current context's environment.
propName
- the name of the property;
- the previous value of the property, possibly null.
rename
public void rename(Name oldname,
Name newname)
throws NamingException
Renames an existing bound name in the current context's registry.
rename
public void rename(String oldname,
String newname)
throws NamingException
Renames an existing stringified bound name in the current context's registry.
unbind
public void unbind(Name name)
throws NamingException
Unbinds the given name from the current context's registry.
name
- the name to unbind.
unbind
public void unbind(String name)
throws NamingException
Unbinds the given stringified name from the current context's registry.
name
- the name to unbind.