All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.naming.Reference

java.lang.Object
   |
   +----java.naming.Reference

public class Reference
extends Object
implements Cloneable, Serializable
Reference represents a way of recording address information about objects which themselves are not directly bound to the naming system. A Reference consists of a list of addresses and class information about the object being referred to. Each address in the list identifies a communications endpoint for the same conceptual object. Multiple addresses may arise for various reasons, such as replication or the object offering interfaces over more than one communication mechanism. The addresses are indexed starting with zero. A Reference also contains information to assist in creating an instance of the object to which this Reference refers. It contains the class name of that object, and the class name and location of the factory to be used to create the object.


Variable Index

 o addrs
 o classFactory
 o classFactoryLocation
 o className

Constructor Index

 o Reference(String)
Constructs a new reference for an object with class name 'className'.
 o Reference(String, RefAddr)
Constructs a new reference for an object with class name 'className' and an address.
 o Reference(String, RefAddr, String, String)
Constructs a new reference for an object with class name 'className', the class name and location of the object's factory, and the address for the object.
 o Reference(String, RefAddrEnumeration)
Constructs a new reference for an object with class name 'className' and a list of addresses for the object.
 o Reference(String, RefAddrEnumeration, String, String)
Constructs a new reference for an object with class name 'className', the class name and location of the object's factory, and the address for the object.
 o Reference(String, String, String)
Constructs a new reference for an object with class name 'className', and the class name and location of the object's factory.

Method Index

 o appendAddr(RefAddr)
Adds an address to the end of the list of addresses.
 o clone()
 o deleteAddr(int)
Deletes the address at index posn from the list of addresses.
 o deleteAllAddrs()
Deletes all addresses from this reference.
 o equals(Object)
Determines whether obj is a reference with the same addresses (in same order) as this reference.
 o getAddress(int)
Retrieves the address at index posn.
 o getAddress(String)
Retrieves the first address that has the address type 'addrType'.
 o getAddressCount()
Retrieves the number of adddresses in this reference.
 o getAddresses()
Retrieves an enumeration of the addresses in this reference.
 o getClassName()
Retrieves the class name of the object to which this reference refers.
 o getFactoryClassLocation()
Retrieves the location of the factory of the object to which this reference refers.
 o getFactoryClassName()
Retrieves the class name of the factory of the object to which this reference refers.
 o hashCode()
Computes the hash code of this reference.
 o insertAddr(int, RefAddr)
Adds an address to the list of addresses at index posn.
 o prependAddr(RefAddr)
Adds an address to the front of the list of addresses.
 o toString()
Generates the string representation of this reference.

Variables

 o className
 protected String className
 o addrs
 protected Vector addrs
 o classFactory
 protected String classFactory
 o classFactoryLocation
 protected String classFactoryLocation

Constructors

 o Reference
 public Reference(String className)
Constructs a new reference for an object with class name 'className'.

Parameters:
className - The class name of the object to which this reference refers.
 o Reference
 public Reference(String className,
                  RefAddr addr)
Constructs a new reference for an object with class name 'className' and an address.

Parameters:
className - The class name of the object to which this reference refers.
addr - The address of the object.
 o Reference
 public Reference(String className,
                  RefAddrEnumeration addrs)
Constructs a new reference for an object with class name 'className' and a list of addresses for the object.

Parameters:
className - The class name of the object to which this reference refers.
addrs - The addresses of the object.
 o Reference
 public Reference(String className,
                  String factory,
                  String factoryLocation)
Constructs a new reference for an object with class name 'className', and the class name and location of the object's factory.

Parameters:
className - The class name of the object to which this reference refers.
factory - The class name of the object's factory.
factoryLocation - The location from which to load the factory (e.g. URL)
See Also:
ObjectFactory
 o Reference
 public Reference(String className,
                  RefAddr addr,
                  String factory,
                  String factoryLocation)
Constructs a new reference for an object with class name 'className', the class name and location of the object's factory, and the address for the object.

Parameters:
className - The class name of the object to which this reference refers.
factory - The class name of the object's factory.
factoryLocation - The location from which to load the factory (e.g. URL)
addr - The address of the object.
See Also:
ObjectFactory
 o Reference
 public Reference(String className,
                  RefAddrEnumeration addrs,
                  String factory,
                  String factoryLocation)
Constructs a new reference for an object with class name 'className', the class name and location of the object's factory, and the address for the object.

Parameters:
className - The class name of the object to which this reference refers.
factory - The class name of the object's factory.
factoryLocation - The location from which to load the factory (e.g. URL)
addrs - The addresses of the object.
See Also:
ObjectFactory

Methods

 o getClassName
 public String getClassName()
Retrieves the class name of the object to which this reference refers.

Returns:
The package-qualified class name of the object.
 o getFactoryClassName
 public String getFactoryClassName()
Retrieves the class name of the factory of the object to which this reference refers.

Returns:
The package-qualified class name of the factory.
 o getFactoryClassLocation
 public String getFactoryClassLocation()
Retrieves the location of the factory of the object to which this reference refers.

Returns:
The location for loading in the factory's class.
 o getAddress
 public RefAddr getAddress(String addrType)
Retrieves the first address that has the address type 'addrType'.

Parameters:
addrType - The address type for which to find the address.
Returns:
The address in this reference with address type 'addrType.
 o getAddress
 public RefAddr getAddress(int posn)
Retrieves the address at index posn.

Parameters:
posn - The index of the address to retrieve.
Returns:
The address at index posn.
 o getAddresses
 public RefAddrEnumeration getAddresses()
Retrieves an enumeration of the addresses in this reference.

Returns:
An enumeration of the addresses in this reference.
 o getAddressCount
 public int getAddressCount()
Retrieves the number of adddresses in this reference.

Returns:
The number of addresses in this reference.
 o prependAddr
 public void prependAddr(RefAddr addr)
Adds an address to the front of the list of addresses.

Parameters:
addr - The address to add.
 o appendAddr
 public void appendAddr(RefAddr addr)
Adds an address to the end of the list of addresses.

Parameters:
addr - The address to add.
 o insertAddr
 public void insertAddr(int posn,
                        RefAddr addr)
Adds an address to the list of addresses at index posn. All addresses at index posn or greater are shifted up the list by one.

Parameters:
posn - The 0-based index of the list to insert addr.
addr - The address to add.
 o deleteAddr
 public void deleteAddr(int posn)
Deletes the address at index posn from the list of addresses.

Parameters:
posn - The 0-based index of in address to delete.
 o deleteAllAddrs
 public void deleteAllAddrs()
Deletes all addresses from this reference.

 o equals
 public boolean equals(Object obj)
Determines whether obj is a reference with the same addresses (in same order) as this reference. Reference also needs to have the same class name as this reference.

Parameters:
obj - The object to check.
Returns:
true if obj is equal to this reference; false otherwise.
Overrides:
equals in class Object
 o hashCode
 public int hashCode()
Computes the hash code of this reference. The hash code is computed using its addresses.

Returns:
A hash code of this reference as an int.
Overrides:
hashCode in class Object
 o toString
 public String toString()
Generates the string representation of this reference. The string consists of the class name to which this reference refers, and the string representation of each of its addresses.

Returns:
The string representation of this reference.
Overrides:
toString in class Object
 o clone
 protected Object clone()
Overrides:
clone in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index