javax.naming.spi
public class: ResolveResult [javadoc |
source]
java.lang.Object
javax.naming.spi.ResolveResult
All Implemented Interfaces:
Serializable
This class represents the result of resolution of a name.
It contains the object to which name was resolved, and the portion
of the name that has not been resolved.
A ResolveResult instance is not synchronized against concurrent
multithreaded access. Multiple threads trying to access and modify
a single ResolveResult instance should lock the object.
- author:
Rosanna - Lee
- author:
Scott - Seligman
- since:
1.3 -
| Field Summary |
|---|
| protected Object | resolvedObj | Field containing the Object that was resolved to successfully.
It can be null only when constructed using a subclass.
Constructors should always initialize this. |
| protected Name | remainingName | Field containing the remaining name yet to be resolved.
It can be null only when constructed using a subclass.
Constructors should always initialize this. |
| Constructor: |
protected ResolveResult() {
resolvedObj = null;
remainingName = null;
}
Constructs an instance of ResolveResult with the
resolved object and remaining name both initialized to null. |
public ResolveResult(Object robj,
String rcomp) {
resolvedObj = robj;
try {
remainingName = new CompositeName(rcomp);
// remainingName.appendComponent(rcomp);
} catch (InvalidNameException e) {
// ignore; shouldn't happen
}
}
Constructs a new instance of ResolveResult consisting of
the resolved object and the remaining unresolved component. Parameters:
robj - The non-null object resolved to.
rcomp - The single remaining name component that has yet to be
resolved. Cannot be null (but can be empty).
|
public ResolveResult(Object robj,
Name rname) {
resolvedObj = robj;
setRemainingName(rname);
}
Constructs a new instance of ResolveResult consisting of
the resolved Object and the remaining name. Parameters:
robj - The non-null Object resolved to.
rname - The non-null remaining name that has yet to be resolved.
|
| Methods from java.lang.Object: |
|---|
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from javax.naming.spi.ResolveResult Detail: |
public void appendRemainingComponent(String name) {
if (name != null) {
CompositeName rname = new CompositeName();
try {
rname.add(name);
} catch (InvalidNameException e) {
// ignore; shouldn't happen for empty composite name
}
appendRemainingName(rname);
}
}
Adds a single component to the end of remaining name. |
public void appendRemainingName(Name name) {
// System.out.println("appendingRemainingName: " + name.toString());
// Exception e = new Exception();
// e.printStackTrace();
if (name != null) {
if (this.remainingName != null) {
try {
this.remainingName.addAll(name);
} catch (InvalidNameException e) {
// ignore; shouldn't happen for composite name
}
} else {
this.remainingName = (Name)(name.clone());
}
}
}
Adds components to the end of remaining name. |
public Name getRemainingName() {
return this.remainingName;
}
Retrieves the remaining unresolved portion of the name. |
public Object getResolvedObj() {
return this.resolvedObj;
}
Retrieves the Object to which resolution was successful. |
public void setRemainingName(Name name) {
if (name != null)
this.remainingName = (Name)(name.clone());
else {
// ??? should throw illegal argument exception
this.remainingName = null;
}
}
Sets the remaining name field of this result to name.
A copy of name is made so that modifying the copy within
this ResolveResult does not affect name and
vice versa. |
public void setResolvedObj(Object obj) {
this.resolvedObj = obj;
// ??? should check for null?
}
Sets the resolved Object field of this result to obj. |