| |
|
| java.lang.Object javax.naming.Reference
All known Subclasses: javax.naming.LinkRef,
Reference | public class Reference implements Cloneable,Serializable(Code) | | A Reference contains the class of the object which is
referenced together with a list of all the addresses at which this object may
be found. Additionally the Reference has the location of a
factory which can create this object together with the classname used to
create the object.
The Reference class relates to objects which are not bound in
a naming service but which need to be accessed via javax.naming.
Reference , RefAddr and their subclasses
provide a way to access objects other than those in naming and directory
systems.
|
Constructor Summary | |
public | Reference(String className) Constructs a Reference instance with an empty list of
addresses using the supplied class name.
Parameters: className - the class of the object which is referenced. | public | Reference(String className, RefAddr addr) Constructs a Reference instance with one entry of address.
Parameters: className - the class of the object which is referenced. | public | Reference(String className, String classFactory, String classFactoryLocation) Constructs a Reference instance with an empty list of
addresses using the supplied class name, factory class and factory
location.
Parameters: className - the class of the object which is referenced. | public | Reference(String className, RefAddr addr, String classFactory, String classFactoryLocation) Constructs a Reference instance with one entry of address
using the supplied class name, factory class and factory location.
Parameters: className - the class of the object which is referenced. |
Method Summary | |
public void | add(RefAddr addr) Appends an address to the list.
Parameters: addr - the address to append. | public void | add(int index, RefAddr addr) Inserts an address within the list at the specified index.
Parameters: addr - the address to insert into the list. | public void | clear() Deletes all the addresses from the address list. | public Object | clone() Returns a deep clone of this Reference instance. | public boolean | equals(Object o) Returns true if this Reference instance is equal to the
supplied object o . | public RefAddr | get(String type) Gets an address where the address type matches the specified string. | public RefAddr | get(int index) Gets the address held at the specified index in the address list.
Parameters: index - the index of the required address. | public Enumeration<RefAddr> | getAll() Gets all the addresses. | public String | getClassName() Gets the class of the object which is referenced. | public String | getFactoryClassLocation() Gets the location of the factory class. | public String | getFactoryClassName() Gets the class in a factory which is used to create an object of the type
which is referenced. | public int | hashCode() Returns the hashcode for this Reference instance. | public Object | remove(int index) Removes an address from the address list.
Parameters: index - the index of the address to remove. | public int | size() Gets the number of addresses in the address list. | public String | toString() Returns the string representation of the class name together with the
list of addresses. |
addrs | protected Vector<RefAddr> addrs(Code) | | A list of the addresses provided for this object. The default is null.
|
classFactory | protected String classFactory(Code) | | The class in a factory which is used to create an object of the type
which is referenced. The default is null.
|
classFactoryLocation | protected String classFactoryLocation(Code) | | The location of class classFactory . To find class files
the URL of the classfile is given. If there is more than one URL for the
class then a list of URLs appears in the string using a space as a
separator. The default is null.
|
className | protected String className(Code) | | The class of the object which is referenced.
|
Reference | public Reference(String className)(Code) | | Constructs a Reference instance with an empty list of
addresses using the supplied class name.
Parameters: className - the class of the object which is referenced. It cannot benull. |
Reference | public Reference(String className, RefAddr addr)(Code) | | Constructs a Reference instance with one entry of address.
Parameters: className - the class of the object which is referenced. It cannot benull. Parameters: addr - the object's address. It cannot be null. |
Reference | public Reference(String className, String classFactory, String classFactoryLocation)(Code) | | Constructs a Reference instance with an empty list of
addresses using the supplied class name, factory class and factory
location.
Parameters: className - the class of the object which is referenced. It cannot benull. Parameters: classFactory - the class in a factory which is used to create an object ofthe type which is referenced. It may be null. Parameters: classFactoryLocation - the location of the class file. It may be null. |
Reference | public Reference(String className, RefAddr addr, String classFactory, String classFactoryLocation)(Code) | | Constructs a Reference instance with one entry of address
using the supplied class name, factory class and factory location.
Parameters: className - the class of the object which is referenced. It cannot benull. Parameters: addr - the object's address. It cannot be null. Parameters: classFactory - the class in a factory which is used to create an object ofthe type which is referenced. It may be null. Parameters: classFactoryLocation - the location of the class file. It may be null. |
add | public void add(RefAddr addr)(Code) | | Appends an address to the list.
Parameters: addr - the address to append. It cannot be null. |
add | public void add(int index, RefAddr addr)(Code) | | Inserts an address within the list at the specified index.
Parameters: addr - the address to insert into the list. It cannot be null. Parameters: index - the index where to insert the address. It must be greater thanor equal to 0 and less than or equal to the number of entriesin the list(size()). throws: ArrayIndexOutOfBoundsException - If the index is invalid. |
clear | public void clear()(Code) | | Deletes all the addresses from the address list.
|
clone | public Object clone()(Code) | | Returns a deep clone of this Reference instance.
a deep clone of this object |
equals | public boolean equals(Object o)(Code) | | Returns true if this Reference instance is equal to the
supplied object o . They are considered equal if their
class name and list of addresses are equivalent (including the order of
the addresses in the list). The factory class and location are ignored
for the purposes of this comparison.
Parameters: o - the object to compare with true if this object is equal to o , otherwisefalse |
get | public RefAddr get(String type)(Code) | | Gets an address where the address type matches the specified string.
There may be more than one entry in the list with the same address type
but this method returns the first one found in the list.
Parameters: type - the address type to look for the first address whose type matches the string |
get | public RefAddr get(int index)(Code) | | Gets the address held at the specified index in the address list.
Parameters: index - the index of the required address. It must be greater than orequal to 0 and less than the number of entries in the list. the address held at the specified index throws: ArrayIndexOutOfBoundsException - If the index is invalid. |
getClassName | public String getClassName()(Code) | | Gets the class of the object which is referenced. The result cannot be
null.
the class of the object which is referenced |
getFactoryClassLocation | public String getFactoryClassLocation()(Code) | | Gets the location of the factory class. The result may be null.
the location of the factory class |
getFactoryClassName | public String getFactoryClassName()(Code) | | Gets the class in a factory which is used to create an object of the type
which is referenced. The result may be null.
the class in a factory which is used to create the referencedobject |
hashCode | public int hashCode()(Code) | | Returns the hashcode for this Reference instance. The
result is calculated by summing the hashcode of the class name and the
hash codes of each of the addresses in the address list.
the hashcode of this Reference instance |
remove | public Object remove(int index)(Code) | | Removes an address from the address list.
Parameters: index - the index of the address to remove. It must be greater than orequal to 0 and less than size(). the removed address throws: ArrayIndexOutOfBoundsException - If the index is invalid. |
size | public int size()(Code) | | Gets the number of addresses in the address list.
the size of the list |
toString | public String toString()(Code) | | Returns the string representation of the class name together with the
list of addresses.
the string representation of this object |
|
|
|