1 7 8 package java.rmi.activation; 9 10 import java.rmi.MarshalledObject ; 11 12 34 public final class ActivationDesc implements java.io.Serializable 35 { 36 39 private ActivationGroupID groupID; 40 41 44 private String className; 45 46 49 private String location; 50 51 54 private MarshalledObject data; 55 56 59 private boolean restart; 60 61 62 private static final long serialVersionUID = 7455834104417690957L; 63 64 92 public ActivationDesc(String className, 93 String location, 94 MarshalledObject data) 95 throws ActivationException 96 { 97 this(ActivationGroup.internalCurrentGroupID(), 98 className, location, data, false); 99 } 100 101 129 public ActivationDesc(String className, 130 String location, 131 MarshalledObject data, 132 boolean restart) 133 throws ActivationException 134 { 135 this(ActivationGroup.internalCurrentGroupID(), 136 className, location, data, restart); 137 } 138 139 163 public ActivationDesc(ActivationGroupID groupID, 164 String className, 165 String location, 166 MarshalledObject data) 167 { 168 this(groupID, className, location, data, false); 169 } 170 171 195 public ActivationDesc(ActivationGroupID groupID, 196 String className, 197 String location, 198 MarshalledObject data, 199 boolean restart) 200 { 201 if (groupID == null) 202 throw new IllegalArgumentException ("groupID can't be null"); 203 this.groupID = groupID; 204 this.className = className; 205 this.location = location; 206 this.data = data; 207 this.restart = restart; 208 } 209 210 219 public ActivationGroupID getGroupID() { 220 return groupID; 221 } 222 223 229 public String getClassName() { 230 return className; 231 } 232 233 239 public String getLocation() { 240 return location; 241 } 242 243 249 public MarshalledObject getData() { 250 return data; 251 } 252 253 267 public boolean getRestartMode() { 268 return restart; 269 } 270 271 279 public boolean equals(Object obj) { 280 281 if (obj instanceof ActivationDesc ) { 282 ActivationDesc desc = (ActivationDesc ) obj; 283 return 284 ((groupID == null ? desc.groupID == null : 285 groupID.equals(desc.groupID)) && 286 (className == null ? desc.className == null : 287 className.equals(desc.className)) && 288 (location == null ? desc.location == null: 289 location.equals(desc.location)) && 290 (data == null ? desc.data == null : 291 data.equals(desc.data)) && 292 (restart == desc.restart)); 293 294 } else { 295 return false; 296 } 297 } 298 299 304 public int hashCode() 305 { 306 return ((location == null 307 ? 0 308 : location.hashCode() << 24) ^ 309 (groupID == null 310 ? 0 311 : groupID.hashCode() << 16) ^ 312 (className == null 313 ? 0 314 : className.hashCode() << 9) ^ 315 (data == null 316 ? 0 317 : data.hashCode() << 1) ^ 318 (restart 319 ? 1 320 : 0)); 321 } 322 } 323 324 | Popular Tags |