00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 package org.objectweb.proactive.core.body.rmi;
00032
00033 import java.io.IOException;
00034 import java.rmi.RemoteException;
00035 import java.rmi.server.RMIClientSocketFactory;
00036 import java.rmi.server.RMIServerSocketFactory;
00037 import java.security.PublicKey;
00038 import java.security.cert.X509Certificate;
00039 import java.util.ArrayList;
00040
00041 import org.objectweb.proactive.Body;
00042 import org.objectweb.proactive.core.UniqueID;
00043 import org.objectweb.proactive.core.body.UniversalBody;
00044 import org.objectweb.proactive.core.body.ft.internalmsg.FTMessage;
00045 import org.objectweb.proactive.core.body.reply.Reply;
00046 import org.objectweb.proactive.core.body.request.Request;
00047 import org.objectweb.proactive.core.exceptions.NonFunctionalException;
00048 import org.objectweb.proactive.core.exceptions.manager.NFEListener;
00049 import org.objectweb.proactive.ext.security.Communication;
00050 import org.objectweb.proactive.ext.security.SecurityContext;
00051 import org.objectweb.proactive.ext.security.crypto.KeyExchangeException;
00052 import org.objectweb.proactive.ext.security.exceptions.RenegotiateSessionException;
00053 import org.objectweb.proactive.ext.security.exceptions.SecurityNotAvailableException;
00054
00055
00061 public class RmiRemoteBodyImpl extends java.rmi.server.UnicastRemoteObject
00062 implements RmiRemoteBody, java.rmi.server.Unreferenced {
00063
00068
00069
00070
00071
00076 protected transient UniversalBody body;
00077
00078
00079
00080
00081 public RmiRemoteBodyImpl() throws RemoteException {
00082 }
00083
00084 public RmiRemoteBodyImpl(UniversalBody body) throws RemoteException {
00085
00086 this.body = body;
00087 }
00088
00089 public RmiRemoteBodyImpl(UniversalBody body, RMIServerSocketFactory sf,
00090 RMIClientSocketFactory cf) throws RemoteException {
00091 super(0, cf, sf);
00092 this.body = body;
00093 }
00094
00095
00096
00097
00098
00099
00100
00101 public String getJobID() {
00102 return body.getJobID();
00103 }
00104
00105 public int receiveRequest(Request r)
00106 throws java.io.IOException, RenegotiateSessionException {
00107 return body.receiveRequest(r);
00108 }
00109
00110 public int receiveReply(Reply r) throws java.io.IOException {
00111 return body.receiveReply(r);
00112 }
00113
00117 public void terminate() throws IOException {
00118 body.terminate();
00119 }
00120
00121 public String getNodeURL() {
00122 return body.getNodeURL();
00123 }
00124
00125 public UniqueID getID() {
00126 return body.getID();
00127 }
00128
00129 public void updateLocation(UniqueID id, UniversalBody remoteBody)
00130 throws java.io.IOException {
00131 body.updateLocation(id, remoteBody);
00132 }
00133
00134 public void unreferenced() {
00135
00136
00137 }
00138
00139 public void enableAC() throws java.io.IOException {
00140 body.enableAC();
00141 }
00142
00143 public void disableAC() throws java.io.IOException {
00144 body.disableAC();
00145 }
00146
00147 public void setImmediateService(String methodName)
00148 throws java.io.IOException {
00149 body.setImmediateService(methodName);
00150 }
00151
00152 public void removeImmediateService(String methodName,
00153 Class[] parametersTypes) throws IOException {
00154 body.removeImmediateService(methodName, parametersTypes);
00155 }
00156
00157 public void setImmediateService(String methodName, Class[] parametersTypes)
00158 throws IOException {
00159 body.setImmediateService(methodName, parametersTypes);
00160 }
00161
00162
00163 public void terminateSession(long sessionID)
00164 throws IOException, SecurityNotAvailableException {
00165 body.terminateSession(sessionID);
00166 }
00167
00168 public X509Certificate getCertificate()
00169 throws SecurityNotAvailableException, IOException {
00170 X509Certificate cert = body.getCertificate();
00171 return cert;
00172 }
00173
00174 public long startNewSession(Communication policy)
00175 throws SecurityNotAvailableException, IOException,
00176 RenegotiateSessionException {
00177 return body.startNewSession(policy);
00178 }
00179
00180 public PublicKey getPublicKey()
00181 throws SecurityNotAvailableException, IOException {
00182 return body.getPublicKey();
00183 }
00184
00185 public byte[] randomValue(long sessionID, byte[] cl_rand)
00186 throws IOException, SecurityNotAvailableException,
00187 RenegotiateSessionException {
00188 return body.randomValue(sessionID, cl_rand);
00189 }
00190
00191 public byte[][] publicKeyExchange(long sessionID, byte[] my_pub,
00192 byte[] my_cert, byte[] sig_code)
00193 throws IOException, SecurityNotAvailableException,
00194 RenegotiateSessionException, KeyExchangeException {
00195 return body.publicKeyExchange(sessionID, my_pub, my_cert, sig_code);
00196 }
00197
00198 public byte[][] secretKeyExchange(long sessionID, byte[] tmp, byte[] tmp1,
00199 byte[] tmp2, byte[] tmp3, byte[] tmp4)
00200 throws IOException, SecurityNotAvailableException,
00201 RenegotiateSessionException {
00202 return body.secretKeyExchange(sessionID, tmp, tmp1, tmp2, tmp3, tmp4);
00203 }
00204
00205
00206
00207
00208 public byte[] getCertificateEncoded()
00209 throws IOException, SecurityNotAvailableException {
00210 return body.getCertificateEncoded();
00211 }
00212
00213
00214
00215
00216 public SecurityContext getPolicy(SecurityContext securityContext)
00217 throws IOException, SecurityNotAvailableException {
00218 return body.getPolicy(securityContext);
00219 }
00220
00221 public ArrayList getEntities()
00222 throws SecurityNotAvailableException, IOException {
00223 return body.getEntities();
00224 }
00225
00226
00227
00228
00229 public Object receiveFTMessage(FTMessage fte) throws IOException {
00230 return this.body.receiveFTMessage(fte);
00231 }
00232
00233 public void changeProxiedBody(Body newBody) {
00234 this.body = newBody;
00235 }
00236
00237
00238
00239
00240 public void addNFEListener(NFEListener listener) {
00241 body.addNFEListener(listener);
00242 }
00243
00244 public void removeNFEListener(NFEListener listener) {
00245 body.removeNFEListener(listener);
00246 }
00247
00248 public int fireNFE(NonFunctionalException e) {
00249 return body.fireNFE(e);
00250 }
00251
00252
00253
00254
00255
00256
00257
00258 private void writeObject(java.io.ObjectOutputStream out)
00259 throws java.io.IOException {
00260
00261
00262 out.defaultWriteObject();
00263
00264
00265
00266 }
00267 }