javax.naming

Class Reference

public class Reference extends Object implements Cloneable, Serializable

This class represents a reference to an object that is located outside of the naming/directory system.

See Also:

Field Summary
protected Vector<RefAddr>addrs
The list of addresses, stored in this reference.
protected StringclassFactory
The name of the class factory to create an instance of the object, referenced by this reference.
protected StringclassFactoryLocation
The location, from where the class factory should be loaded.
protected StringclassName
The name of the class of the object, to that this reference refers.
Constructor Summary
Reference(String className)
Create a new reference that is referencting to the object of the specified class.
Reference(String className, RefAddr addr)
Create a new reference that is referencing to the object of the specified class with the given address.
Reference(String className, String factoryClassName, String factoryLocation)
Create a new reference that is referencing to the object of the specified class, specifying the class and location of the factory that produces these objects.
Reference(String className, RefAddr addr, String factoryClassName, String factoryLocation)
Create a new reference that is referencing to the object of the specified class, specifying the class and location of the factory that produces these objects and also the address of this object.
Method Summary
voidadd(int posn, RefAddr addr)
Add the new address for this object at the given position of the address list.
voidadd(RefAddr addr)
Appends the new object address to the end of the address list.
voidclear()
Removes all defined addresses of the object.
Objectclone()
booleanequals(Object obj)
Compares two addresses for equality, by value.
RefAddrget(int posn)
Get the address of this object at the given position.
RefAddrget(String addrType)
Get the given type of address for this object.
Enumeration<RefAddr>getAll()
Get the enumeration over all defined addresses of the object.
StringgetClassName()
Get the name of the class of the referenced object.
StringgetFactoryClassLocation()
Get the location of the factory class of the referenced object.
StringgetFactoryClassName()
Get the name of the factory class of the referenced object
inthashCode()
Get the hashcode of this reference.
Objectremove(int posn)
Remove the address at the given position.
intsize()
Return the number of the defined addresses.
StringtoString()
Return the string representation.

Field Detail

addrs

protected Vector<RefAddr> addrs
The list of addresses, stored in this reference. The object may be have by several different addresses.

classFactory

protected String classFactory
The name of the class factory to create an instance of the object, referenced by this reference.

classFactoryLocation

protected String classFactoryLocation
The location, from where the class factory should be loaded.

className

protected String className
The name of the class of the object, to that this reference refers.

Constructor Detail

Reference

public Reference(String className)
Create a new reference that is referencting to the object of the specified class.

Reference

public Reference(String className, RefAddr addr)
Create a new reference that is referencing to the object of the specified class with the given address.

Reference

public Reference(String className, String factoryClassName, String factoryLocation)
Create a new reference that is referencing to the object of the specified class, specifying the class and location of the factory that produces these objects.

Parameters: className the object class name factoryClassName the object factory class name factoryLocation the object factory location

Reference

public Reference(String className, RefAddr addr, String factoryClassName, String factoryLocation)
Create a new reference that is referencing to the object of the specified class, specifying the class and location of the factory that produces these objects and also the address of this object.

Parameters: className the object class name addr the address of the object factoryClassName the object factory class name factoryLocation the object factory location

Method Detail

add

public void add(int posn, RefAddr addr)
Add the new address for this object at the given position of the address list.

add

public void add(RefAddr addr)
Appends the new object address to the end of the address list.

clear

public void clear()
Removes all defined addresses of the object.

clone

public Object clone()

equals

public boolean equals(Object obj)
Compares two addresses for equality, by value.

get

public RefAddr get(int posn)
Get the address of this object at the given position.

get

public RefAddr get(String addrType)
Get the given type of address for this object.

Parameters: addrType the needed type of address

Returns: the address of this object, having the specified type. If there is no address of such type, null is returned.

getAll

public Enumeration<RefAddr> getAll()
Get the enumeration over all defined addresses of the object.

getClassName

public String getClassName()
Get the name of the class of the referenced object.

See Also: className

getFactoryClassLocation

public String getFactoryClassLocation()
Get the location of the factory class of the referenced object.

See Also: classFactoryLocation

getFactoryClassName

public String getFactoryClassName()
Get the name of the factory class of the referenced object

See Also: classFactory

hashCode

public int hashCode()
Get the hashcode of this reference.

Returns: the sum of the hash codes of the addresses.

remove

public Object remove(int posn)
Remove the address at the given position.

Parameters: posn the position of the address to remove

Returns: the removed address

size

public int size()
Return the number of the defined addresses.

toString

public String toString()
Return the string representation.