java.lang.Object | |
↳ | com.sun.jndi.rmi.registry.RegistryContext |
A RegistryContext is a context representing a remote RMI registry.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | SECURITY_MGR |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns a context for the registry at a given host and port.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a new environment property to the environment of this
context.
| |||||||||||
If the object to be bound is both Remote and Referenceable, binds the
object itself, not its Reference.
| |||||||||||
Binds a name to an object.
| |||||||||||
Closes this context.
| |||||||||||
Composes the name of this context with a name relative to
this context.
| |||||||||||
Composes the name of this context with a name relative to
this context.
| |||||||||||
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 environment in effect for this context.
| |||||||||||
Retrieves the full name of this context within its own namespace.
| |||||||||||
Retrieves the parser associated with the named context.
| |||||||||||
Retrieves the parser associated with the named context.
| |||||||||||
Returns an RMI registry reference for this 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.
| |||||||||||
Removes an environment property from the environment of this
context.
| |||||||||||
Binds a new name to the object bound to an old name, and unbinds
the old name.
| |||||||||||
Rename is implemented by this sequence of operations:
lookup, bind, unbind.
| |||||||||||
Unbinds the named object.
| |||||||||||
Unbinds the named object.
| |||||||||||
Wrap a RemoteException inside a NamingException.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Returns a context for the registry at a given host and port. If "host" is null, uses default host. If "port" is non-positive, uses default port. Cloning of "env" is handled by caller; see comments within RegistryContextFactory.getObjectInstance(), for example.
NamingException |
---|
Adds a new environment property to the environment of this context. If the property already exists, its value is overwritten. See class description for more details on environment properties.
propName | the name of the environment property to add; may not be null |
---|---|
propVal | the value of the property to add; may not be null |
NamingException |
---|
If the object to be bound is both Remote and Referenceable, binds the object itself, not its Reference.
name | the name to bind; may not be empty |
---|---|
obj | 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 |
---|---|
obj | the object to bind; possibly null |
NamingException |
---|
Closes this context. This method releases this context's resources immediately, instead of waiting for them to be released automatically by the garbage collector.
This method is idempotent: invoking it on a context that has already been closed has no effect. Invoking any other method on a closed context is not allowed, and results in undefined behaviour.
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 |
---|
Composes the name of this context with a name relative to
this context.
Given a name (name
) relative to this context, and
the name (prefix
) of this context relative to one
of its ancestors, this method returns the composition of the
two names using the syntax appropriate for the naming
system(s) involved. That is, if name
names an
object relative to this context, the result is the name of the
same object, but relative to the ancestor context. None of the
names may be null.
For example, if this context is named "wiz.com" relative to the initial context, then
composeName("east", "wiz.com")might return
"east.wiz.com"
.
If instead this context is named "org/research", then
composeName("user/jane", "org/research")might return
"org/research/user/jane"
while
composeName("user/jane", "research")returns
"research/user/jane"
.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 environment in effect for this context. See class description for more details on environment properties.
The caller should not make any changes to the object returned: their effect on the context is undefined. The environment of this context may be changed using addToEnvironment() and removeFromEnvironment().
NamingException |
---|
Retrieves the full name of this context within its own namespace.
Many naming services have a notion of a "full name" for objects in their respective namespaces. For example, an LDAP entry has a distinguished name, and a DNS record has a fully qualified name. This method allows the client application to retrieve this name. The string returned by this method is not a JNDI composite name and should not be passed directly to context methods. In naming systems for which the notion of full name does not make sense, OperationNotSupportedException is thrown.
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 |
---|
Returns an RMI registry reference for this context.
If this context was created from a reference, that reference is returned. Otherwise, an exception is thrown if the registry's host is "localhost" or the default (null). Although this could possibly make for a valid reference, it's far more likely to be an easily made error.
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 |
---|---|
obj | 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 |
---|---|
obj | the object to bind; possibly null |
NamingException |
---|
Removes an environment property from the environment of this context. See class description for more details on environment properties.
propName | the name of the environment property to remove; may not be 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.
name | the name of the existing binding; may not be empty |
---|---|
newName | the name of the new binding; may not be empty |
NamingException |
---|
Rename is implemented by this sequence of operations: lookup, bind, unbind. The sequence is not performed atomically.
oldName | the name of the existing binding; may not be empty |
---|---|
newName | the name of the new binding; may not be empty |
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 |
---|
Wrap a RemoteException inside a NamingException.
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
A subclass overrides the finalize
method to dispose of
system resources or to perform other cleanup.
The general contract of finalize is that it is invoked if and when the JavaTM virtual machine has determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, except as a result of an action taken by the finalization of some other object or class which is ready to be finalized. The finalize method may take any action, including making this object available again to other threads; the usual purpose of finalize, however, is to perform cleanup actions before the object is irrevocably discarded. For example, the finalize method for an object that represents an input/output connection might perform explicit I/O transactions to break the connection before the object is permanently discarded.
The finalize method of class Object performs no special action; it simply returns normally. Subclasses of Object may override this definition.
The Java programming language does not guarantee which thread will invoke the finalize method for any given object. It is guaranteed, however, that the thread that invokes finalize will not be holding any user-visible synchronization locks when finalize is invoked. If an uncaught exception is thrown by the finalize method, the exception is ignored and finalization of that object terminates.
After the finalize method has been invoked for an object, no further action is taken until the Java virtual machine has again determined that there is no longer any means by which this object can be accessed by any thread that has not yet died, including possible actions by other objects or classes which are ready to be finalized, at which point the object may be discarded.
The finalize method is never invoked more than once by a Java virtual machine for any given object.
Any exception thrown by the finalize
method causes
the finalization of this object to be halted, but is otherwise
ignored.