Example usage for java.rmi RemoteException RemoteException

List of usage examples for java.rmi RemoteException RemoteException

Introduction

In this page you can find the example usage for java.rmi RemoteException RemoteException.

Prototype

public RemoteException(String s, Throwable cause) 

Source Link

Document

Constructs a RemoteException with the specified detail message and cause.

Usage

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramManagerImpl.java

public int createNewProgram(int testbedID, int projectID, String name, String description, byte[] zipData,
        String tosPlatform) throws RemoteException {
    log.info("Request to create new program:\n" + "  testbedID:    " + testbedID + "\n" + "  projectID:    "
            + projectID + "\n" + "  name:         " + name + "\n" + "  description:  " + description + "\n"
            + "  zipData size: " + zipData.length);

    int programID = -1;
    boolean error = false;

    try {//from w w w.j a  v a 2  s . co m
        Program program;
        File dir;

        program = programAdapter.createNewProgram(projectID, name, description);

        log.info("Program created:\n" + program + "(" + program.getID() + ")");

        programID = program.getID();
        dir = FileUtils.makeProgramDir(PROG_ROOT, testbedID, projectID, programID);
        dir = ZipUtils.unzip(zipData, dir);
        program = programAdapter.updateProgramPath(programID, dir.getAbsolutePath());

        writeLock.lock();
        try {
            programs.put(programID, program);
        } finally {
            writeLock.unlock();
        }
        notifyObservers(Message.NEW_PROGRAM, program);
    } catch (IOException ex) {
        error = true;
        String msg = "I/O Exception while creating new program";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } catch (AdaptationException ex) {
        error = true;
        String msg = "AdaptationException";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } catch (Exception ex) {
        error = true;
        String msg = "Exception";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        if (error && programID != -1) {
            try {
                deleteProgram(programID);
            } catch (Exception ex2) {
            }
        }
    }

    return programID;
}

From source file:com.elasticgrid.platforms.ec2.EC2NodeInstantiatorImpl.java

public void createSecurityGroup(String group) throws RemoteException {
    try {//from  w w w. java 2 s  .  co m
        jec2.createSecurityGroup(group, "Elastic Grid " + group);
    } catch (EC2Exception e) {
        throw new RemoteException("Can't create security group '" + group + "'", e);
    }
}

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProjectDeploymentConfigurationManagerImpl.java

public void cloneProjectDeploymentConfig(int sourceID, String name, String description) throws RemoteException {
    log.info("Request to clone ProjectDeploymentConfiguration:\n" + "  sourceID:        " + sourceID + "\n"
            + "  newName:         " + name + "\n" + "  newDescription:  " + description);

    try {//from w  ww.  j av  a  2s.c o m
        ProjectDeploymentConfiguration oldConfig = projDepConfigs.get(sourceID);

        ProjectDeploymentConfiguration config = projDepConfigAdapter
                .createNewProjectDeploymentConfig(oldConfig.getProjectID(), name, description);

        writeLock.lock();
        try {
            projDepConfigs.put(config.getID(), config);
        } finally {
            writeLock.unlock();
        }

        notifyObservers(Message.NEW_CONFIG, config);

        MoteDeploymentConfigurationManagerImpl.getInstance().cloneMoteDeploymentConfigurations(sourceID,
                config.getID());

        ProgramProfilingSymbolManagerImpl.getInstance().cloneProfilingSymbol(sourceID, config.getID());

        ProgramProfilingMessageSymbolManagerImpl.getInstance().cloneProfilingMessageSymbol(sourceID,
                config.getID());

    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (RemoteException ex) {
        throw ex;
    } catch (Exception ex) {
        String msg = "Exception in cloneProjectDeploymentConfig";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramSymbolManagerImpl.java

private ProgramSymbolManagerImpl() throws RemoteException {
    super();// w  w  w .  j  a  v  a2s. c  o m

    try {
        this.managerLock = new ReentrantReadWriteLock(true);
        this.readLock = managerLock.readLock();
        this.writeLock = managerLock.writeLock();
        programSymbolAdapter = AdapterFactory.createProgramSymbolAdapter(AdapterType.SQL);
        programSymbols = programSymbolAdapter.readProgramSymbols();

        log.debug("ProgramSymbols read:\n" + programSymbols);
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (Exception ex) {
        String msg = "Exception in ProgramSymbolManagerImpl";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramProfilingMessageSymbolManagerImpl.java

public void createNewProfilingMessageSymbol(int configID, int programMsgSymbolID) throws RemoteException {
    try {//from ww  w . java2s  . co  m
        log.info("Request to create new ProgramProfilingMessageSymbol:\n"
                + "  projectDeploymentConfigurationID:  " + configID + "\n"
                + "  programMessageSymbolID:            " + programMsgSymbolID);

        ProgramProfilingMessageSymbol ppms = ppmsAdapter.createNewProfilingMessageSymbol(configID,
                programMsgSymbolID);

        writeLock.lock();
        try {
            ppmSymbols.put(ppms.getID(), ppms);
        } finally {
            writeLock.unlock();
        }

        notifyObservers(Message.NEW_SYMBOL, ppms);
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (Exception ex) {
        String msg = "Exception in createNewProfilingMessageSymbol";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

From source file:org.molgenis.wikipathways.client.WikiPathwaysRESTBindingStub.java

@Override
public byte[] getColoredPathway(String pwId, String revision, String[] graphId, String[] color, String fileType)
        throws RemoteException {
    try {//from w  w w .j  a va  2 s .co m
        String url = baseUrl + "/getColoredPathway?pwId=" + pwId + "&revision=" + revision;
        for (String g : graphId) {
            url = url + "&graphId=" + g;
        }
        for (String c : color) {
            url = url + "&color=" + c;
        }
        url = url + "&fileType=" + fileType;
        Document jdomDocument = Utils.connect(url, client);
        Element data = jdomDocument.getRootElement().getChild("data", WSNamespaces.NS1);
        return Base64.decodeBase64(data.getValue());
    } catch (Exception e) {
        throw new RemoteException(e.getMessage(), e.getCause());
    }
}

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProjectManagerImpl.java

private void cleanupProjectDeploymentConfigurations(int projectID) throws RemoteException {
    ProjectDeploymentConfigurationManager pdcm;
    pdcm = ProjectDeploymentConfigurationManagerImpl.getInstance();

    try {/*from   w  w w .j  a v a2s  . c o  m*/
        List<ProjectDeploymentConfiguration> list;
        list = pdcm.getProjectDeploymentConfigs(projectID);
        list = new ArrayList<ProjectDeploymentConfiguration>(list);

        for (ProjectDeploymentConfiguration i : list) {
            pdcm.deleteProjectDeploymentConfig(i.getID());
        }
    } catch (RemoteException ex) {
        throw ex;
    } catch (Exception ex) {
        String msg = "Exception in cleanupProjectDeploymentConfigurations";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

From source file:gov.nih.nci.caarray.services.external.v1_0.grid.service.CaArraySvc_v1_0Impl.java

public gov.nih.nci.cagrid.enumeration.stubs.response.EnumerationResponseContainer enumerateExperiments(
        gov.nih.nci.caarray.external.v1_0.query.ExperimentSearchCriteria experimentSearchCriteria)
        throws RemoteException {
    try {/* w ww.  jav a  2  s  . com*/
        return EnumerateResponseFactory.createEnumerationResponse(new SearchEnumIterator<Experiment>(
                Experiment.class, getSearchUtils().experimentsByCriteria(experimentSearchCriteria).iterator()));
    } catch (Exception e) {
        throw new RemoteException("Unable to create enumeration", e);
    }
}

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramMessageSymbolManagerImpl.java

public void deleteSymbolsForProgram(int programID) throws RemoteException {
    ProgramMessageSymbol[] pmt = null;// www . ja v a 2 s . c om

    readLock.lock();
    try {
        pmt = programMessageSymbols.values().toArray(new ProgramMessageSymbol[programMessageSymbols.size()]);
    } finally {
        readLock.unlock();
    }

    try {
        for (int i = 0; i < pmt.length; ++i) {
            if (pmt[i].getProgramID() == programID) {
                ProgramProfilingMessageSymbolManagerImpl.getInstance().deleteProgProfMsgSymsFor(pmt[i].getID());
                deleteProgramMessageSymbol(pmt[i].getID());
            }
        }
    } catch (Exception ex) {
        String msg = "Exception in deleteSymbolsForProgram";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

From source file:edu.clemson.cs.nestbed.server.management.configuration.ProgramProfilingSymbolManagerImpl.java

public void cloneProfilingSymbol(int srcConfigID, int newConfigID) throws RemoteException {
    try {// ww  w  . jav  a2  s .c o  m
        log.info("Request to clone ProgramProfilingSymbol with " + "ProjectDeploymentconfigurationID:  "
                + srcConfigID);

        List<ProgramProfilingSymbol> newList;
        newList = new ArrayList<ProgramProfilingSymbol>();

        for (ProgramProfilingSymbol i : progProfSymbols.values()) {
            if (i.getProjectDeploymentConfigurationID() == srcConfigID) {
                ProgramProfilingSymbol profilingSymbol = progProfSymbolAdapter
                        .createNewProfilingSymbol(newConfigID, i.getProgramSymbolID());
                newList.add(profilingSymbol);
            }
        }

        writeLock.lock();
        try {
            for (ProgramProfilingSymbol i : newList) {
                progProfSymbols.put(i.getID(), i);
            }
        } finally {
            writeLock.unlock();
        }

        for (ProgramProfilingSymbol i : newList) {
            notifyObservers(Message.NEW_SYMBOL, i);
        }
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (Exception ex) {
        String msg = "Exception in cloneProfilingSymbol";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}