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.
-
addrs
-
-
classFactory
-
-
classFactoryLocation
-
-
className
-
-
Reference(String)
- Constructs a new reference for an object with class name 'className'.
-
Reference(String, RefAddr)
- Constructs a new reference for an object with class name 'className' and
an address.
-
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.
-
Reference(String, RefAddrEnumeration)
- Constructs a new reference for an object with class name 'className'
and a list of addresses for the object.
-
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.
-
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.
-
appendAddr(RefAddr)
- Adds an address to the end of the list of addresses.
-
clone()
-
-
deleteAddr(int)
- Deletes the address at index posn from the list of addresses.
-
deleteAllAddrs()
- Deletes all addresses from this reference.
-
equals(Object)
- Determines whether obj is a reference with the same addresses
(in same order) as this reference.
-
getAddress(int)
- Retrieves the address at index posn.
-
getAddress(String)
- Retrieves the first address that has the address type 'addrType'.
-
getAddressCount()
- Retrieves the number of adddresses in this reference.
-
getAddresses()
- Retrieves an enumeration of the addresses in this reference.
-
getClassName()
- Retrieves the class name of the object to which this reference refers.
-
getFactoryClassLocation()
- Retrieves the location of the factory of the object
to which this reference refers.
-
getFactoryClassName()
- Retrieves the class name of the factory of the object
to which this reference refers.
-
hashCode()
- Computes the hash code of this reference.
-
insertAddr(int, RefAddr)
- Adds an address to the list of addresses at index posn.
-
prependAddr(RefAddr)
- Adds an address to the front of the list of addresses.
-
toString()
- Generates the string representation of this reference.
className
protected String className
addrs
protected Vector addrs
classFactory
protected String classFactory
classFactoryLocation
protected String classFactoryLocation
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.
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.
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.
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
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
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
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.
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.
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.
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.
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.
getAddresses
public RefAddrEnumeration getAddresses()
- Retrieves an enumeration of the addresses in this reference.
- Returns:
- An enumeration of the addresses in this reference.
getAddressCount
public int getAddressCount()
- Retrieves the number of adddresses in this reference.
- Returns:
- The number of addresses in this reference.
prependAddr
public void prependAddr(RefAddr addr)
- Adds an address to the front of the list of addresses.
- Parameters:
- addr - The address to add.
appendAddr
public void appendAddr(RefAddr addr)
- Adds an address to the end of the list of addresses.
- Parameters:
- addr - The address to add.
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.
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.
deleteAllAddrs
public void deleteAllAddrs()
- Deletes all addresses from this reference.
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
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
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
clone
protected Object clone()
- Overrides:
- clone in class Object
All Packages Class Hierarchy This Package Previous Next Index