org/objectweb/proactive/core/runtime/rmi/RmiProActiveRuntimeForwarderImpl.java

00001 /* 
00002  * ################################################################
00003  * 
00004  * ProActive: The Java(TM) library for Parallel, Distributed, 
00005  *            Concurrent computing with Security and Mobility
00006  * 
00007  * Copyright (C) 1997-2007 INRIA/University of Nice-Sophia Antipolis
00008  * Contact: proactive@objectweb.org
00009  * 
00010  * This library is free software; you can redistribute it and/or
00011  * modify it under the terms of the GNU Lesser General Public
00012  * License as published by the Free Software Foundation; either
00013  * version 2.1 of the License, or any later version.
00014  *  
00015  * This library is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  * Lesser General Public License for more details.
00019  * 
00020  * You should have received a copy of the GNU Lesser General Public
00021  * License along with this library; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00023  * USA
00024  *  
00025  *  Initial developer(s):               The ProActive Team
00026  *                        http://www.inria.fr/oasis/ProActive/contacts.html
00027  *  Contributor(s): 
00028  * 
00029  * ################################################################
00030  */ 
00031 package org.objectweb.proactive.core.runtime.rmi;
00032 
00033 import java.io.IOException;
00034 import java.lang.reflect.InvocationTargetException;
00035 import java.rmi.AlreadyBoundException;
00036 import java.rmi.RemoteException;
00037 import java.rmi.server.RMIClientSocketFactory;
00038 import java.rmi.server.RMIServerSocketFactory;
00039 import java.security.PublicKey;
00040 import java.security.cert.X509Certificate;
00041 import java.util.ArrayList;
00042 
00043 import org.objectweb.proactive.Body;
00044 import org.objectweb.proactive.core.ProActiveException;
00045 import org.objectweb.proactive.core.UniqueRuntimeID;
00046 import org.objectweb.proactive.core.body.UniversalBody;
00047 import org.objectweb.proactive.core.body.ft.checkpointing.Checkpoint;
00048 import org.objectweb.proactive.core.descriptor.data.ProActiveDescriptor;
00049 import org.objectweb.proactive.core.descriptor.data.VirtualNode;
00050 import org.objectweb.proactive.core.mop.ConstructorCall;
00051 import org.objectweb.proactive.core.mop.ConstructorCallExecutionFailedException;
00052 import org.objectweb.proactive.core.node.NodeException;
00053 import org.objectweb.proactive.core.process.ExternalProcess;
00054 import org.objectweb.proactive.core.process.UniversalProcess;
00055 import org.objectweb.proactive.core.runtime.ProActiveRuntime;
00056 import org.objectweb.proactive.core.runtime.ProActiveRuntimeForwarder;
00057 import org.objectweb.proactive.core.runtime.VMInformation;
00058 import org.objectweb.proactive.ext.security.Communication;
00059 import org.objectweb.proactive.ext.security.ProActiveSecurityManager;
00060 import org.objectweb.proactive.ext.security.SecurityContext;
00061 import org.objectweb.proactive.ext.security.crypto.KeyExchangeException;
00062 import org.objectweb.proactive.ext.security.exceptions.RenegotiateSessionException;
00063 import org.objectweb.proactive.ext.security.exceptions.SecurityNotAvailableException;
00064 import org.objectweb.proactive.ext.security.securityentity.Entity;
00065 
00066 
00067 public class RmiProActiveRuntimeForwarderImpl extends RmiProActiveRuntimeImpl
00068     implements RmiProActiveRuntimeForwarder {
00069     protected transient ProActiveRuntimeForwarder proActiveRuntimeF;
00070 
00071     //
00072     // --- CONSTRUCTORS
00073     //
00074     public RmiProActiveRuntimeForwarderImpl()
00075         throws RemoteException, AlreadyBoundException {
00076         super();
00077         proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
00078     }
00079 
00080     public RmiProActiveRuntimeForwarderImpl(boolean isJini)
00081         throws RemoteException {
00082         super(isJini);
00083         proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
00084     }
00085 
00086     public RmiProActiveRuntimeForwarderImpl(RMIClientSocketFactory csf,
00087         RMIServerSocketFactory ssf)
00088         throws RemoteException, AlreadyBoundException {
00089         super(csf, ssf);
00090         proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
00091     }
00092 
00093     //
00094     // --- Remote Interface
00095     //
00096     public void addAcquaintance(UniqueRuntimeID urid,
00097         String proActiveRuntimeName) throws IOException, ProActiveException {
00098         proActiveRuntimeF.addAcquaintance(urid, proActiveRuntimeName);
00099     }
00100 
00101     public UniversalBody createBody(UniqueRuntimeID urid, String nodeName,
00102         ConstructorCall bodyConstructorCall, boolean isNodeLocal)
00103         throws IOException, ConstructorCallExecutionFailedException,
00104             InvocationTargetException, ProActiveException {
00105         return proActiveRuntimeF.createBody(urid, nodeName,
00106             bodyConstructorCall, isNodeLocal);
00107     }
00108 
00109     public String createLocalNode(UniqueRuntimeID urid, String nodeName,
00110         boolean replacePreviousBinding, ProActiveSecurityManager ps,
00111         String VNname, String jobId)
00112         throws IOException, NodeException, AlreadyBoundException {
00113         if (urid == null) {
00114                 return super.createLocalNode(nodeName, replacePreviousBinding, ps, VNname, jobId);
00115         } else {
00116         return proActiveRuntimeF.createLocalNode(urid, nodeName,
00117             replacePreviousBinding, ps, VNname, jobId);
00118         }
00119     }
00120 
00121     public void createVM(UniqueRuntimeID urid, UniversalProcess remoteProcess)
00122         throws IOException, ProActiveException {
00123         proActiveRuntimeF.createVM(urid, remoteProcess);
00124     }
00125 
00126     public String[] getAcquaintances(UniqueRuntimeID urid)
00127         throws IOException, ProActiveException {
00128         return proActiveRuntimeF.getAcquaintances(urid);
00129     }
00130 
00131     public ArrayList getActiveObjects(UniqueRuntimeID urid, String nodeName,
00132         String objectName) throws IOException, ProActiveException {
00133         return proActiveRuntimeF.getActiveObjects(urid, nodeName, objectName);
00134     }
00135 
00136     public ArrayList getActiveObjects(UniqueRuntimeID urid, String nodeName)
00137         throws IOException, ProActiveException {
00138         return proActiveRuntimeF.getActiveObjects(urid, nodeName);
00139     }
00140 
00141     public byte[] getClassDataFromParentRuntime(UniqueRuntimeID urid,
00142         String className) throws IOException, ProActiveException {
00143         return proActiveRuntimeF.getClassDataFromParentRuntime(urid, className);
00144     }
00145 
00146     public byte[] getClassDataFromThisRuntime(UniqueRuntimeID urid,
00147         String className) throws IOException, ProActiveException {
00148         return proActiveRuntimeF.getClassDataFromThisRuntime(urid, className);
00149     }
00150 
00151     public ArrayList<Entity> getEntities(UniqueRuntimeID urid)
00152         throws IOException, SecurityNotAvailableException {
00153         return proActiveRuntimeF.getEntities(urid);
00154     }
00155 
00156     public String getJobID(UniqueRuntimeID urid, String nodeUrl)
00157         throws IOException, ProActiveException {
00158         return proActiveRuntimeF.getJobID(urid, nodeUrl);
00159     }
00160 
00161     public String[] getLocalNodeNames(UniqueRuntimeID urid)
00162         throws IOException, ProActiveException {
00163         return proActiveRuntimeF.getLocalNodeNames(urid);
00164     }
00165 
00166     public SecurityContext getPolicy(UniqueRuntimeID urid, SecurityContext sc)
00167         throws IOException, SecurityNotAvailableException {
00168         return proActiveRuntimeF.getPolicy(urid, sc);
00169     }
00170 
00171     public ProActiveRuntime getProActiveRuntime(UniqueRuntimeID urid,
00172         String proActiveRuntimeName) throws IOException, ProActiveException {
00173         return proActiveRuntimeF.getProActiveRuntime(urid, proActiveRuntimeName);
00174     }
00175 
00176     public ProActiveRuntime[] getProActiveRuntimes(UniqueRuntimeID urid)
00177         throws IOException, ProActiveException {
00178         return proActiveRuntimeF.getProActiveRuntimes(urid);
00179     }
00180 
00181     public ExternalProcess getProcessToDeploy(UniqueRuntimeID urid,
00182         ProActiveRuntime proActiveRuntimeDist, String creatorID, String vmName,
00183         String padURL) throws ProActiveException, IOException {
00184         return proActiveRuntimeF.getProcessToDeploy(urid, proActiveRuntimeDist,
00185             creatorID, vmName, padURL);
00186     }
00187 
00188     public String getURL(UniqueRuntimeID urid)
00189         throws IOException, ProActiveException {
00190         return proActiveRuntimeF.getURL(urid);
00191     }
00192 
00193     public VirtualNode getVirtualNode(UniqueRuntimeID urid,
00194         String virtualNodeName) throws IOException, ProActiveException {
00195         return proActiveRuntimeF.getVirtualNode(urid, virtualNodeName);
00196     }
00197 
00198     public VMInformation getVMInformation(UniqueRuntimeID urid)
00199         throws IOException {
00200         return proActiveRuntimeF.getVMInformation();
00201     }
00202 
00203     public String getVNName(UniqueRuntimeID urid, String Nodename)
00204         throws IOException, ProActiveException {
00205         return proActiveRuntimeF.getVNName(urid, Nodename);
00206     }
00207 
00208     public void killAllNodes(UniqueRuntimeID urid)
00209         throws IOException, ProActiveException {
00210         proActiveRuntimeF.killAllNodes(urid);
00211     }
00212 
00213     public void killNode(UniqueRuntimeID urid, String nodeName)
00214         throws IOException, ProActiveException {
00215         proActiveRuntimeF.killNode(urid, nodeName);
00216     }
00217 
00218     public void killRT(UniqueRuntimeID urid, boolean softly)
00219         throws Exception {
00220         proActiveRuntimeF.killRT(urid, softly);
00221     }
00222 
00223     public UniversalBody receiveBody(UniqueRuntimeID urid, String nodeName,
00224         Body body) throws IOException, ProActiveException {
00225         return proActiveRuntimeF.receiveBody(urid, nodeName, body);
00226     }
00227 
00228     public UniversalBody receiveCheckpoint(UniqueRuntimeID urid,
00229         String nodeName, Checkpoint ckpt, int inc)
00230         throws IOException, ProActiveException {
00231         return proActiveRuntimeF.receiveCheckpoint(urid, nodeName, ckpt, inc);
00232     }
00233 
00234     public void register(UniqueRuntimeID urid,
00235         ProActiveRuntime proActiveRuntimeDist, String proActiveRuntimeName,
00236         String creatorID, String creationProtocol, String vmName)
00237         throws IOException, ProActiveException {
00238         proActiveRuntimeF.register(urid, proActiveRuntimeDist,
00239             proActiveRuntimeName, creatorID, creationProtocol, vmName);
00240     }
00241 
00242     public void registerVirtualNode(UniqueRuntimeID urid,
00243         String virtualNodeName, boolean replacePreviousBinding)
00244         throws IOException, ProActiveException, java.rmi.AlreadyBoundException {
00245         proActiveRuntimeF.registerVirtualNode(urid, virtualNodeName,
00246             replacePreviousBinding);
00247     }
00248 
00249     public void rmAcquaintance(UniqueRuntimeID urid, String proActiveRuntimeName)
00250         throws IOException, ProActiveException {
00251         proActiveRuntimeF.rmAcquaintance(urid, proActiveRuntimeName);
00252     }
00253 
00254     public void unregister(UniqueRuntimeID urid,
00255         ProActiveRuntime proActiveRuntimeDist, String proActiveRuntimeName,
00256         String creatorID, String creationProtocol, String vmName)
00257         throws IOException, ProActiveException {
00258         proActiveRuntimeF.unregister(urid, proActiveRuntimeDist,
00259             proActiveRuntimeURL, creatorID, creationProtocol, vmName);
00260     }
00261 
00262     public void unregisterAllVirtualNodes(UniqueRuntimeID urid)
00263         throws IOException, ProActiveException {
00264         proActiveRuntimeF.unregisterAllVirtualNodes(urid);
00265     }
00266 
00267     public void unregisterVirtualNode(UniqueRuntimeID urid,
00268         String virtualNodeName) throws IOException, ProActiveException {
00269         proActiveRuntimeF.unregisterVirtualNode(urid, virtualNodeName);
00270     }
00271 
00272     public X509Certificate getCertificate(UniqueRuntimeID urid)
00273         throws SecurityNotAvailableException, IOException {
00274         return proActiveRuntimeF.getCertificate(urid);
00275     }
00276 
00277     public byte[] getCertificateEncoded(UniqueRuntimeID urid)
00278         throws SecurityNotAvailableException, IOException {
00279         return proActiveRuntimeF.getCertificateEncoded(urid);
00280     }
00281 
00282     public ProActiveDescriptor getDescriptor(UniqueRuntimeID urid, String url,
00283         boolean isHierarchicalSearch) throws IOException, ProActiveException {
00284         return proActiveRuntimeF.getDescriptor(urid, url, isHierarchicalSearch);
00285     }
00286 
00287     public PublicKey getPublicKey(UniqueRuntimeID urid)
00288         throws SecurityNotAvailableException, IOException {
00289         return proActiveRuntimeF.getPublicKey(urid);
00290     }
00291 
00292     public void launchMain(UniqueRuntimeID urid, String className,
00293         String[] parameters)
00294         throws IOException, ClassNotFoundException, NoSuchMethodException,
00295             ProActiveException {
00296         proActiveRuntimeF.launchMain(className, parameters);
00297     }
00298 
00299     public void newRemote(UniqueRuntimeID urid, String className)
00300         throws IOException, ClassNotFoundException, ProActiveException {
00301         proActiveRuntimeF.newRemote(className);
00302     }
00303 
00304     public byte[][] publicKeyExchange(UniqueRuntimeID urid, long sessionID,
00305         byte[] myPublicKey, byte[] myCertificate, byte[] signature)
00306         throws SecurityNotAvailableException, RenegotiateSessionException,
00307             KeyExchangeException, IOException {
00308         return proActiveRuntimeF.publicKeyExchange(urid, sessionID,
00309             myPublicKey, myCertificate, signature);
00310     }
00311 
00312     public byte[] randomValue(UniqueRuntimeID urid, long sessionID,
00313         byte[] clientRandomValue)
00314         throws SecurityNotAvailableException, RenegotiateSessionException,
00315             IOException {
00316         return proActiveRuntimeF.randomValue(urid, sessionID, clientRandomValue);
00317     }
00318 
00319     public byte[][] secretKeyExchange(UniqueRuntimeID urid, long sessionID,
00320         byte[] encodedAESKey, byte[] encodedIVParameters,
00321         byte[] encodedClientMacKey, byte[] encodedLockData,
00322         byte[] parametersSignature)
00323         throws SecurityNotAvailableException, RenegotiateSessionException,
00324             IOException {
00325         return proActiveRuntimeF.secretKeyExchange(urid, sessionID,
00326             encodedAESKey, encodedIVParameters, encodedClientMacKey,
00327             encodedLockData, parametersSignature);
00328     }
00329 
00330     public long startNewSession(UniqueRuntimeID urid, Communication policy)
00331         throws SecurityNotAvailableException, RenegotiateSessionException,
00332             IOException {
00333         return proActiveRuntimeF.startNewSession(policy);
00334     }
00335 
00336     public void terminateSession(UniqueRuntimeID urid, long sessionID)
00337         throws IOException, SecurityNotAvailableException {
00338         // TODO Auto-generated method stub
00339     }
00340 
00341     public Object setLocalNodeProperty(UniqueRuntimeID runtimeID,
00342         String nodeName, String key, String value)
00343         throws IOException, ProActiveException {
00344         return this.proActiveRuntimeF.setLocalNodeProperty(runtimeID, nodeName,
00345             key, value);
00346     }
00347 
00348     public String getLocalNodeProperty(UniqueRuntimeID runtimeID,
00349         String nodeName, String key) throws IOException, ProActiveException {
00350         return this.proActiveRuntimeF.getLocalNodeProperty(runtimeID, nodeName,
00351             key);
00352     }
00353 }

Generated on Mon Jan 22 15:16:09 2007 for ProActive by  doxygen 1.5.1