<commit_before>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2005 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://www.inria.fr/oasis/ProActive/contacts.html
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.core.runtime.rmi;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.ArrayList;

import org.objectweb.proactive.Body;
import org.objectweb.proactive.core.ProActiveException;
import org.objectweb.proactive.core.UniqueRuntimeID;
import org.objectweb.proactive.core.body.UniversalBody;
import org.objectweb.proactive.core.body.ft.checkpointing.Checkpoint;
import org.objectweb.proactive.core.descriptor.data.ProActiveDescriptor;
import org.objectweb.proactive.core.descriptor.data.VirtualNode;
import org.objectweb.proactive.core.mop.ConstructorCall;
import org.objectweb.proactive.core.mop.ConstructorCallExecutionFailedException;
import org.objectweb.proactive.core.node.NodeException;
import org.objectweb.proactive.core.process.ExternalProcess;
import org.objectweb.proactive.core.process.UniversalProcess;
import org.objectweb.proactive.core.runtime.ProActiveRuntime;
import org.objectweb.proactive.core.runtime.ProActiveRuntimeForwarder;
import org.objectweb.proactive.core.runtime.VMInformation;
import org.objectweb.proactive.ext.security.Communication;
import org.objectweb.proactive.ext.security.ProActiveSecurityManager;
import org.objectweb.proactive.ext.security.SecurityContext;
import org.objectweb.proactive.ext.security.crypto.KeyExchangeException;
import org.objectweb.proactive.ext.security.exceptions.RenegotiateSessionException;
import org.objectweb.proactive.ext.security.exceptions.SecurityNotAvailableException;


public class RmiProActiveRuntimeForwarderImpl extends RmiProActiveRuntimeImpl
    implements RmiProActiveRuntimeForwarder {
    protected transient ProActiveRuntimeForwarder proActiveRuntimeF;

    //
    // --- CONSTRUCTORS
    //
    public RmiProActiveRuntimeForwarderImpl()
        throws RemoteException, AlreadyBoundException {
        super();
        proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
    }

    public RmiProActiveRuntimeForwarderImpl(boolean isJini)
        throws RemoteException {
        super(isJini);
        proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
    }

    public RmiProActiveRuntimeForwarderImpl(RMIClientSocketFactory csf,
        RMIServerSocketFactory ssf)
        throws RemoteException, AlreadyBoundException {
        super(csf, ssf);
        proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
    }

    //
    // --- Remote Interface
    //
    public void addAcquaintance(UniqueRuntimeID urid,
        String proActiveRuntimeName) throws IOException, ProActiveException {
        proActiveRuntimeF.addAcquaintance(urid, proActiveRuntimeName);
    }

    public UniversalBody createBody(UniqueRuntimeID urid, String nodeName,
        ConstructorCall bodyConstructorCall, boolean isNodeLocal)
        throws IOException, ConstructorCallExecutionFailedException,
            InvocationTargetException, ProActiveException {
        return proActiveRuntimeF.createBody(urid, nodeName,
            bodyConstructorCall, isNodeLocal);
    }

    public String createLocalNode(UniqueRuntimeID urid, String nodeName,
        boolean replacePreviousBinding, ProActiveSecurityManager ps,
        String VNname, String jobId)
        throws IOException, NodeException, AlreadyBoundException {
        return proActiveRuntimeF.createLocalNode(urid, nodeName,
            replacePreviousBinding, ps, VNname, jobId);
    }

    public void createVM(UniqueRuntimeID urid, UniversalProcess remoteProcess)
        throws IOException, ProActiveException {
        proActiveRuntimeF.createVM(urid, remoteProcess);
    }

    public String[] getAcquaintances(UniqueRuntimeID urid)
        throws IOException, ProActiveException {
        return proActiveRuntimeF.getAcquaintances(urid);
    }

    public ArrayList getActiveObjects(UniqueRuntimeID urid, String nodeName,
        String objectName) throws IOException, ProActiveException {
        return proActiveRuntimeF.getActiveObjects(urid, nodeName, objectName);
    }

    public ArrayList getActiveObjects(UniqueRuntimeID urid, String nodeName)
        throws IOException, ProActiveException {
        return proActiveRuntimeF.getActiveObjects(urid, nodeName);
    }

    public byte[] getClassDataFromParentRuntime(UniqueRuntimeID urid,
        String className) throws IOException, ProActiveException {
        return proActiveRuntimeF.getClassDataFromParentRuntime(urid, className);
    }<commit_msg>Bugfix: perform the call on local runtime if urid is null<commit_after>/*
 * ################################################################
 *
 * ProActive: The Java(TM) library for Parallel, Distributed,
 *            Concurrent computing with Security and Mobility
 *
 * Copyright (C) 1997-2005 INRIA/University of Nice-Sophia Antipolis
 * Contact: <EMAIL>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 *  Initial developer(s):               The ProActive Team
 *                        http://www.inria.fr/oasis/ProActive/contacts.html
 *  Contributor(s):
 *
 * ################################################################
 */
package org.objectweb.proactive.core.runtime.rmi;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.rmi.AlreadyBoundException;
import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.security.PublicKey;
import java.security.cert.X509Certificate;
import java.util.ArrayList;

import org.objectweb.proactive.Body;
import org.objectweb.proactive.core.ProActiveException;
import org.objectweb.proactive.core.UniqueRuntimeID;
import org.objectweb.proactive.core.body.UniversalBody;
import org.objectweb.proactive.core.body.ft.checkpointing.Checkpoint;
import org.objectweb.proactive.core.descriptor.data.ProActiveDescriptor;
import org.objectweb.proactive.core.descriptor.data.VirtualNode;
import org.objectweb.proactive.core.mop.ConstructorCall;
import org.objectweb.proactive.core.mop.ConstructorCallExecutionFailedException;
import org.objectweb.proactive.core.node.NodeException;
import org.objectweb.proactive.core.process.ExternalProcess;
import org.objectweb.proactive.core.process.UniversalProcess;
import org.objectweb.proactive.core.runtime.ProActiveRuntime;
import org.objectweb.proactive.core.runtime.ProActiveRuntimeForwarder;
import org.objectweb.proactive.core.runtime.VMInformation;
import org.objectweb.proactive.ext.security.Communication;
import org.objectweb.proactive.ext.security.ProActiveSecurityManager;
import org.objectweb.proactive.ext.security.SecurityContext;
import org.objectweb.proactive.ext.security.crypto.KeyExchangeException;
import org.objectweb.proactive.ext.security.exceptions.RenegotiateSessionException;
import org.objectweb.proactive.ext.security.exceptions.SecurityNotAvailableException;


public class RmiProActiveRuntimeForwarderImpl extends RmiProActiveRuntimeImpl
    implements RmiProActiveRuntimeForwarder {
    protected transient ProActiveRuntimeForwarder proActiveRuntimeF;

    //
    // --- CONSTRUCTORS
    //
    public RmiProActiveRuntimeForwarderImpl()
        throws RemoteException, AlreadyBoundException {
        super();
        proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
    }

    public RmiProActiveRuntimeForwarderImpl(boolean isJini)
        throws RemoteException {
        super(isJini);
        proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
    }

    public RmiProActiveRuntimeForwarderImpl(RMIClientSocketFactory csf,
        RMIServerSocketFactory ssf)
        throws RemoteException, AlreadyBoundException {
        super(csf, ssf);
        proActiveRuntimeF = (ProActiveRuntimeForwarder) super.proActiveRuntime;
    }

    //
    // --- Remote Interface
    //
    public void addAcquaintance(UniqueRuntimeID urid,
        String proActiveRuntimeName) throws IOException, ProActiveException {
        proActiveRuntimeF.addAcquaintance(urid, proActiveRuntimeName);
    }

    public UniversalBody createBody(UniqueRuntimeID urid, String nodeName,
        ConstructorCall bodyConstructorCall, boolean isNodeLocal)
        throws IOException, ConstructorCallExecutionFailedException,
            InvocationTargetException, ProActiveException {
        return proActiveRuntimeF.createBody(urid, nodeName,
            bodyConstructorCall, isNodeLocal);
    }

    public String createLocalNode(UniqueRuntimeID urid, String nodeName,
        boolean replacePreviousBinding, ProActiveSecurityManager ps,
        String VNname, String jobId)
        throws IOException, NodeException, AlreadyBoundException {
        if (urid == null) {
        	return super.createLocalNode(nodeName, replacePreviousBinding, ps, VNname, jobId);
        } else {
    	return proActiveRuntimeF.createLocalNode(urid, nodeName,
            replacePreviousBinding, ps, VNname, jobId);
        }
    }

    public void createVM(UniqueRuntimeID urid, UniversalProcess remoteProcess)
        throws IOException, ProActiveException {
        proActiveRuntimeF.createVM(urid, remoteProcess);
    }

    public String[] getAcquaintances(UniqueRuntimeID urid)
        throws IOException, ProActiveException {
        return proActiveRuntimeF.getAcquaintances(urid);
    }

    public ArrayList getActiveObjects(UniqueRuntimeID urid, String nodeName,
        String objectName) throws IOException, ProActiveException {
        return proActiveRuntimeF.getActiveObjects(urid, nodeName, objectName);
    }

    public ArrayList getActiveObjects(UniqueRuntimeID urid, String nodeName)
        throws IOException, ProActiveException {
        return proActiveRuntimeF.getActiveObjects(urid, nodeName);
    }

    public byte[] getClassDataFromParentRuntime(UniqueRuntimeID urid,
        String className) throws IOException, ProActiveException {
        return proActiveRuntimeF.getClassDataFromParentRuntime(urid, className);
    }
{'fraction_non_alphanumeric': 0.09088661832564271, 'fraction_numerical': 0.004449571522742254, 'mean_word_length': 4.391825855175478, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5835311', 'n_tokens_mistral': 3234, 'n_tokens_neox': 3121, 'n_words': 750}