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.ProgramProfilingSymbolManagerImpl.java

public List<ProgramProfilingSymbol> getProgramProfilingSymbols(int configID, int programID)
        throws RemoteException {
    List<ProgramProfilingSymbol> symbolList = getProgramProfilingSymbols(configID);

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

    try {//from   w w  w  .jav  a2s  .c  o m

        for (ProgramProfilingSymbol i : symbolList) {
            ProgramSymbol programSymbol = ProgramSymbolManagerImpl.getInstance()
                    .getProgramSymbol(i.getProgramSymbolID());

            if (programSymbol.getProgramID() == programID) {
                symbolsForProg.add(i);
            }
        }
    } catch (RemoteException ex) {
        throw ex;
    } catch (Exception ex) {
        String msg = "Exception in getProgramProfilingSymbols";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }

    return symbolsForProg;
}

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

private MoteTestbedAssignmentManagerImpl() throws RemoteException {
    super();/* ww w .  ja  v  a2  s.  c  o  m*/

    try {
        managerLock = new ReentrantReadWriteLock(true);
        readLock = managerLock.readLock();
        writeLock = managerLock.writeLock();
        moteTestbedAssignmentAdapter = AdapterFactory.createMoteTestbedAssignmentAdapter(AdapterType.SQL);
        moteTestbedAssignments = moteTestbedAssignmentAdapter.readMoteTestbedAssignments();

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

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

public List<ProgramProfilingMessageSymbol> getProgramProfilingMessageSymbols(int configID, int programID)
        throws RemoteException {
    List<ProgramProfilingMessageSymbol> symbolList;
    List<ProgramProfilingMessageSymbol> symbolsForProg;

    try {/* w  w  w. j a  v a 2s  .  c o  m*/
        symbolList = getProgramProfilingMessageSymbols(configID);
        symbolsForProg = new ArrayList<ProgramProfilingMessageSymbol>();

        for (ProgramProfilingMessageSymbol i : symbolList) {
            ProgramMessageSymbol programMsgSymbol;

            programMsgSymbol = ProgramMessageSymbolManagerImpl.getInstance()
                    .getProgramMessageSymbol(i.getProgramMessageSymbolID());

            if (programMsgSymbol.getProgramID() == programID) {
                symbolsForProg.add(i);
            }
        }
    } catch (RemoteException ex) {
        throw ex;
    } catch (Exception ex) {
        String msg = "Exception in getProgramProfilingMessageSymbols";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }

    return symbolsForProg;
}

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

public void createNewProjectDeploymentConfig(int projectID, String name, String description)
        throws RemoteException {
    log.info("Request to create new ProjectDeploymentConfiguration:\n" + "  projectID:    " + projectID + "\n"
            + "  name:         " + name + "\n" + "  description:  " + description);

    try {//from   w  w w .  j  a  v a 2 s  . com
        ProjectDeploymentConfiguration config = projDepConfigAdapter.createNewProjectDeploymentConfig(projectID,
                name, description);

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

        notifyObservers(Message.NEW_CONFIG, config);
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (Exception ex) {
        String msg = "Exception in createNewProjectDeploymentConfig";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

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

public void addProgramMessageSymbol(int programID, String name, byte[] bytecode) throws RemoteException {
    writeLock.lock();//from   w ww  . j av  a  2  s.  c  o  m
    try {
        log.debug("addProgramMessageSymbol():\n" + "    programID:       " + programID + "\n"
                + "    name:            " + name + "\n" + "    bytecode.length: " + bytecode.length);

        ProgramMessageSymbol pmt;
        pmt = programMessageSymbolAdapter.addProgramMessageSymbol(programID, name, bytecode);

        programMessageSymbols.put(pmt.getID(), pmt);
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (Exception ex) {
        String msg = "Exception in addProgramMessageSymbol";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        writeLock.unlock();
    }
}

From source file:com.edmunds.etm.netscaler.NetScalerLoadBalancer.java

@Override
public synchronized boolean isVirtualServerDefined(String serverName) throws RemoteException {
    try {/* ww w.ja  v  a2 s  .c  o m*/
        return nitroService.getVirtualServers().get(serverName) != null;
    } catch (NitroExceptionNoSuchResource e) {
        return false;
    } catch (NitroException e) {
        throw new RemoteException("Existence Check Failed", e);
    }
}

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

public void deleteProject(int projectID) throws RemoteException {
    try {/* www.j  av  a 2 s .  c om*/
        log.info("Request to delete Project with id: " + projectID);

        cleanupPrograms(projectID);
        cleanupProjectDeploymentConfigurations(projectID);

        Project project = projectAdapter.deleteProject(projectID);
        writeLock.lock();
        try {
            projects.remove(project.getID());
        } finally {
            writeLock.unlock();
        }

        notifyObservers(Message.DELETE_PROJECT, project);
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (RemoteException ex) {
        throw ex;
    } catch (Exception ex) {
        String msg = "Exception in deleteProject";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    }
}

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

public void shutdownInstance(String instanceID) throws RemoteException {
    logger.info(format("Shutting down Amazon EC2 instance '%s'...", instanceID));
    try {/*from   www  .  j  av  a  2s  . co  m*/
        jec2.terminateInstances(Arrays.asList(instanceID));
    } catch (EC2Exception e) {
        throw new RemoteException(format("Can't stop Amazon instance '%s'", instanceID), e);
    }
}

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

public void createProgramSymbol(int programID, String module, String symbol, int address, int size)
        throws RemoteException {
    writeLock.lock();/*from   ww w. j av  a 2  s.  c o  m*/
    try {
        log.debug(module + "." + symbol);
        ProgramSymbol programSymbol = programSymbolAdapter.createNewProgramSymbol(programID, module, symbol,
                address, size);

        programSymbols.put(programSymbol.getID(), programSymbol);
    } catch (AdaptationException ex) {
        throw new RemoteException("AdaptationException", ex);
    } catch (Exception ex) {
        String msg = "Exception in createProgramSymbol";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        writeLock.unlock();
    }
}

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

public List<ProgramProfilingMessageSymbol> getProgramProfilingMessageSymbols(int configID)
        throws RemoteException {
    log.debug("getProgramProfilingMessageSymbols() called.");

    List<ProgramProfilingMessageSymbol> symbolList;
    symbolList = new ArrayList<ProgramProfilingMessageSymbol>();

    readLock.lock();/*  w w  w . j a  va2s .  co m*/
    try {
        for (ProgramProfilingMessageSymbol i : ppmSymbols.values()) {
            if (i.getProjectDeploymentConfigurationID() == configID) {
                symbolList.add(i);
            }
        }
    } catch (Exception ex) {
        String msg = "Exception in getProgramProfilingMessageSymbols";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return symbolList;
}