1 7 8 package javax.naming.spi; 9 10 import javax.naming.Name ; 11 import javax.naming.Context ; 12 import javax.naming.CompositeName ; 13 import javax.naming.InvalidNameException ; 14 15 29 public class ResolveResult implements java.io.Serializable { 30 36 protected Object resolvedObj; 37 43 protected Name remainingName; 44 45 49 protected ResolveResult() { 50 resolvedObj = null; 51 remainingName = null; 52 } 53 54 62 public ResolveResult(Object robj, String rcomp) { 63 resolvedObj = robj; 64 try { 65 remainingName = new CompositeName (rcomp); 66 } catch (InvalidNameException e) { 68 } 70 } 71 72 79 public ResolveResult(Object robj, Name rname) { 80 resolvedObj = robj; 81 setRemainingName(rname); 82 } 83 84 93 public Name getRemainingName() { 94 return this.remainingName; 95 } 96 97 103 public Object getResolvedObj() { 104 return this.resolvedObj; 105 } 106 107 118 public void setRemainingName(Name name) { 119 if (name != null) 120 this.remainingName = (Name )(name.clone()); 121 else { 122 this.remainingName = null; 124 } 125 } 126 127 135 public void appendRemainingName(Name name) { 136 if (name != null) { 140 if (this.remainingName != null) { 141 try { 142 this.remainingName.addAll(name); 143 } catch (InvalidNameException e) { 144 } 146 } else { 147 this.remainingName = (Name )(name.clone()); 148 } 149 } 150 } 151 152 159 public void appendRemainingComponent(String name) { 160 if (name != null) { 161 CompositeName rname = new CompositeName (); 162 try { 163 rname.add(name); 164 } catch (InvalidNameException e) { 165 } 167 appendRemainingName(rname); 168 } 169 } 170 171 178 public void setResolvedObj(Object obj) { 179 this.resolvedObj = obj; 180 } 182 183 private static final long serialVersionUID = -4552108072002407559L; 184 } 185 | Popular Tags |