1 31 package org.objectweb.proactive.core.body; 32 33 import org.objectweb.proactive.core.UniqueID; 34 35 36 50 public abstract class AbstractUniversalBody implements UniversalBody, java.io.Serializable { 51 52 56 57 protected UniqueID bodyID; 58 59 61 protected BodyMap location; 62 63 64 protected String nodeURL; 65 66 67 protected transient UniversalBody remoteBody; 68 69 protected RemoteBodyFactory remoteBodyFactory; 70 71 75 79 83 public AbstractUniversalBody() {} 84 85 92 public AbstractUniversalBody(String nodeURL, RemoteBodyFactory remoteBodyFactory) { 93 this.nodeURL = nodeURL; 94 this.bodyID = new UniqueID(); 95 this.location = new BodyMap(); 96 this.remoteBodyFactory = remoteBodyFactory; 97 this.remoteBody = remoteBodyFactory.newRemoteBody(this); 98 } 99 100 101 105 109 public String getNodeURL() { 110 return nodeURL; 111 } 112 113 public UniversalBody getRemoteAdapter() { 114 return remoteBody; 115 } 116 117 public UniqueID getID() { 118 return bodyID; 119 } 120 121 public void updateLocation(UniqueID bodyID, UniversalBody body) { 122 location.updateBody(bodyID, body); 123 } 124 125 126 130 131 135 private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { 136 out.defaultWriteObject(); 137 } 138 139 private void readObject(java.io.ObjectInputStream in) throws java.io.IOException , ClassNotFoundException { 140 in.defaultReadObject(); 141 if (bodyID == null) { 142 bodyID = new UniqueID(); 145 } 146 this.remoteBody = remoteBodyFactory.newRemoteBody(this); 148 } 149 150 } | Popular Tags |