org.objectweb.naming

Interface Name

public interface Name

A name designates an object or an object interface. A name may also provide access to the object or interface it designates. Such a name implements both the Name interface and the (or a) Java interface of the object it designates.

Method Summary

byte[]
encode()
Encodes this name as an array of bytes.
NamingContext
getNamingContext()
Returns the NamingContext that created this name.

Method Details

encode

public byte[] encode()
            throws NamingException
Encodes this name as an array of bytes. This method can be used to send names over a network, or to store them on disk.

Returns:
an encoded form of this name.

Throws:
NamingException - if this name can not be encoded (this is the case, for example, of names that are only valid inside a given Java Virtual Machine, and that can therefore not be sent over a network or stored on a disk).


getNamingContext

public NamingContext getNamingContext()
Returns the NamingContext that created this name. In order for a name to implement both the Name interface and the Java interface of the object it designates, the methods of these two interfaces must have distinct names. To increase the probability of this case, this method has been named "getNamingContext" instead of "getContext", since "getNamingContext" is less frequent than "getContext".

Returns:
the NamingContext that created this name.