java.lang.Object | |
↳ | com.sun.jndi.toolkit.ctx.PartialCompositeContext |
![]() |
![]() |
PartialCompositeContext implements Context operations on composite names using implementations of the p_ interfaces defined by its subclasses. The main purpose provided by this class is that it deals with partial resolutions and continuations, so that callers of the Context operation don't have to. Types of clients that will be direct subclasses of PartialCompositeContext may be service providers that implement one of the JNDI protocols, but which do not deal with continuations. Usually, service providers will be using one of the subclasses of PartialCompositeContext.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | _ATOMIC | ||||||||||
int | _COMPONENT | ||||||||||
int | _PARTIAL |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
_contextType |
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Binds a name to an object.
| |||||||||||
Binds a name to an object.
| |||||||||||
Composes the name of this context with a name relative to
this context.
| |||||||||||
This default implementation simply concatenates the two names.
| |||||||||||
Creates and binds a new context.
| |||||||||||
Creates and binds a new context.
| |||||||||||
Destroys the named context and removes it from the namespace.
| |||||||||||
Destroys the named context and removes it from the namespace.
| |||||||||||
Retrieves the parser associated with the named context.
| |||||||||||
Retrieves the parser associated with the named context.
| |||||||||||
Enumerates the names bound in the named context, along with the
class names of objects bound to them.
| |||||||||||
Enumerates the names bound in the named context, along with the
class names of objects bound to them.
| |||||||||||
Enumerates the names bound in the named context, along with the
objects bound to them.
| |||||||||||
Enumerates the names bound in the named context, along with the
objects bound to them.
| |||||||||||
Retrieves the named object.
| |||||||||||
Retrieves the named object.
| |||||||||||
Retrieves the named object, following links except
for the terminal atomic component of the name.
| |||||||||||
Retrieves the named object, following links except
for the terminal atomic component of the name.
| |||||||||||
Binds a name to an object, overwriting any existing binding.
| |||||||||||
Binds a name to an object, overwriting any existing binding.
| |||||||||||
Binds a new name to the object bound to an old name, and unbinds
the old name.
| |||||||||||
Binds a new name to the object bound to an old name, and unbinds
the old name.
| |||||||||||
Partially resolves a name.
| |||||||||||
Partially resolves a name.
| |||||||||||
Unbinds the named object.
| |||||||||||
Unbinds the named object.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Tests whether a name contains a nonempty component.
| |||||||||||
Retrieves a PartialCompositeContext for the resolved object in
cont.
| |||||||||||
A cheap way of getting the environment.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Binds a name to an object. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.
name | the name to bind; may not be empty |
---|---|
newObj | the object to bind; possibly null |
NamingException |
---|
Binds a name to an object.
See bind(Name, Object)
for details.
name | the name to bind; may not be empty |
---|---|
newObj | the object to bind; possibly null |
NamingException |
---|
Composes the name of this context with a name relative to
this context.
See composeName(Name, Name)
for details.
name | a name relative to this context |
---|---|
prefix | the name of this context relative to one of its ancestors |
prefix
and name
NamingException |
---|
This default implementation simply concatenates the two names. There's one twist when the "java.naming.provider.compose.elideEmpty" environment setting is set to "true": if each name contains a nonempty component, and if 'prefix' ends with an empty component or 'name' starts with one, then one empty component is dropped. For example:
elideEmpty=false elideEmpty=true {"a"} + {"b"} => {"a", "b"} {"a", "b"} {"a"} + {""} => {"a", ""} {"a", ""} {"a"} + {"", "b"} => {"a", "", "b"} {"a", "b"} {"a", ""} + {"b", ""} => {"a", "", "b", ""} {"a", "b", ""} {"a", ""} + {"", "b"} => {"a", "", "", "b"} {"a", "", "b"}
name | a name relative to this context |
---|---|
prefix | the name of this context relative to one of its ancestors |
prefix
and name
NamingException |
---|
Creates and binds a new context. Creates a new context with the given name and binds it in the target context (that named by all but terminal atomic component of the name). All intermediate contexts and the target context must already exist.
name | the name of the context to create; may not be empty |
---|
NamingException |
---|
Creates and binds a new context.
See createSubcontext(Name)
for details.
name | the name of the context to create; may not be empty |
---|
NamingException |
---|
Destroys the named context and removes it from the namespace. Any attributes associated with the name are also removed. Intermediate contexts are not destroyed.
This method is idempotent. It succeeds even if the terminal atomic name is not bound in the target context, but throws NameNotFoundException if any of the intermediate contexts do not exist.
In a federated naming system, a context from one naming system may be bound to a name in another. One can subsequently look up and perform operations on the foreign context using a composite name. However, an attempt destroy the context using this composite name will fail with NotContextException, because the foreign context is not a "subcontext" of the context in which it is bound. Instead, use unbind() to remove the binding of the foreign context. Destroying the foreign context requires that the destroySubcontext() be performed on a context from the foreign context's "native" naming system.
name | the name of the context to be destroyed; may not be empty |
---|
NamingException |
---|
Destroys the named context and removes it from the namespace.
See destroySubcontext(Name)
for details.
name | the name of the context to be destroyed; may not be empty |
---|
NamingException |
---|
Retrieves the parser associated with the named context. In a federation of namespaces, different naming systems will parse names differently. This method allows an application to get a parser for parsing names into their atomic components using the naming convention of a particular naming system. Within any single naming system, NameParser objects returned by this method must be equal (using the equals() test).
name | the name of the context from which to get the parser |
---|
NamingException |
---|
Retrieves the parser associated with the named context.
See getNameParser(Name)
for details.
name | the name of the context from which to get the parser |
---|
NamingException |
---|
Enumerates the names bound in the named context, along with the
class names of objects bound to them.
See list(Name)
for details.
name | the name of the context to list |
---|
NamingException |
---|
Enumerates the names bound in the named context, along with the class names of objects bound to them. The contents of any subcontexts are not included.
If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.
name | the name of the context to list |
---|
NamingException |
---|
Enumerates the names bound in the named context, along with the objects bound to them. The contents of any subcontexts are not included.
If a binding is added to or removed from this context, its effect on an enumeration previously returned is undefined.
name | the name of the context to list |
---|
NamingException |
---|
Enumerates the names bound in the named context, along with the
objects bound to them.
See listBindings(Name)
for details.
name | the name of the context to list |
---|
NamingException |
---|
Retrieves the named object.
See lookup(Name)
for details.
name | the name of the object to look up |
---|
NamingException |
---|
Retrieves the named object. If name is empty, returns a new instance of this context (which represents the same naming context as this context, but its environment may be modified independently and it may be accessed concurrently).
name | the name of the object to look up |
---|
NamingException |
---|
Retrieves the named object, following links except
for the terminal atomic component of the name.
See lookupLink(Name)
for details.
name | the name of the object to look up |
---|
NamingException |
---|
Retrieves the named object, following links except for the terminal atomic component of the name. If the object bound to name is not a link, returns the object itself.
name | the name of the object to look up |
---|
NamingException |
---|
Binds a name to an object, overwriting any existing binding.
See rebind(Name, Object)
for details.
name | the name to bind; may not be empty |
---|---|
newObj | the object to bind; possibly null |
NamingException |
---|
Binds a name to an object, overwriting any existing binding. All intermediate contexts and the target context (that named by all but terminal atomic component of the name) must already exist.
If the object is a DirContext, any existing attributes associated with the name are replaced with those of the object. Otherwise, any existing attributes associated with the name remain unchanged.
name | the name to bind; may not be empty |
---|---|
newObj | the object to bind; possibly null |
NamingException |
---|
Binds a new name to the object bound to an old name, and unbinds
the old name.
See rename(Name, Name)
for details.
oldName | the name of the existing binding; may not be empty |
---|---|
newName | the name of the new binding; may not be empty |
NamingException |
---|
Binds a new name to the object bound to an old name, and unbinds the old name. Both names are relative to this context. Any attributes associated with the old name become associated with the new name. Intermediate contexts of the old name are not changed.
oldName | the name of the existing binding; may not be empty |
---|---|
newName | the name of the new binding; may not be empty |
NamingException |
---|
Partially resolves a name. Stops at the first
context that is an instance of a given subtype of
Context
.
name | the name to resolve |
---|---|
contextType | the type of object to resolve. This should
be a subtype of Context . |
name
. Cannot be null.NamingException |
---|
Partially resolves a name.
See resolveToClass(Name, Class)
for details.
name | the name to resolve |
---|---|
contextType | the type of object to resolve. This should
be a subtype of Context . |
name
. Cannot be null.NamingException |
---|
Unbinds the named object.
Removes the terminal atomic name in name
from the target context--that named by all but the terminal
atomic part of name
.
This method is idempotent. It succeeds even if the terminal atomic name is not bound in the target context, but throws NameNotFoundException if any of the intermediate contexts do not exist.
Any attributes associated with the name are removed. Intermediate contexts are not changed.
name | the name to unbind; may not be empty |
---|
NamingException |
---|
Unbinds the named object.
See unbind(Name)
for details.
name | the name to unbind; may not be empty |
---|
NamingException |
---|
Retrieves a PartialCompositeContext for the resolved object in cont. Throws CannotProceedException if not successful.
NamingException |
---|
A cheap way of getting the environment. Default implemenation is NOT cheap because it simply calls getEnvironment(), which most implementations clone before returning. Subclass should ALWAYS override this with the cheapest possible way. The toolkit knows to clone when necessary.
NamingException |
---|
NamingException |
---|
NamingException |
---|
NamingException |
---|