Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
javax.naming.Reference
Referenceable
, Serialized FormField Summary | |
protected Vector |
|
protected String |
|
protected String |
|
protected String |
|
Constructor Summary | |
Method Summary | |
void | |
void | |
void |
|
Object |
|
boolean | |
RefAddr |
|
RefAddr | |
Enumeration |
|
String |
|
String |
|
String |
|
int |
|
Object |
|
int |
|
String |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
protected Vectoraddrs
The list of addresses, stored in this reference. The object may be have by several different addresses.
protected String classFactory
The name of the class factory to create an instance of the object, referenced by this reference.
protected String classFactoryLocation
The location, from where the class factory should be loaded.
public Reference(String className)
Create a new reference that is referencting to the object of the specified class.
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 namefactoryClassName
- the object factory class namefactoryLocation
- the object factory location
public Reference(String className, RefAddr addr)
Create a new reference that is referencing to the object of the specified class with the given address.
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 nameaddr
- the address of the objectfactoryClassName
- the object factory class namefactoryLocation
- the object factory location
public void add(int posn, RefAddr addr)
Add the new address for this object at the given position of the address list.
public Object clone()
This method may be called to create a new copy of the Object. The typical behavior is as follows:
o == o.clone()
is falseo.getClass() == o.clone().getClass()
is trueo.equals(o)
is trueHowever, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override
Object.equals(Object)
.If the Object you call clone() on does not implement
Cloneable
(which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.
All array types implement Cloneable, and override this method as follows (it should never fail):
public Object clone() { try { super.clone(); } catch (CloneNotSupportedException e) { throw new InternalError(e.getMessage()); } }
- Returns:
- a copy of the Object
- See Also:
Cloneable
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.
public String getClassName()
Get the name of the class of the referenced object.
- See Also:
className
public String getFactoryClassLocation()
Get the location of the factory class of the referenced object.
- See Also:
classFactoryLocation
public String getFactoryClassName()
Get the name of the factory class of the referenced object
- See Also:
classFactory
public int hashCode()
Get the hashcode of this reference.
- Returns:
- the sum of the hash codes of the addresses.
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