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

public List<MoteTestbedAssignment> getMoteTestbedAssignmentList(int testbedID) throws RemoteException {
    log.debug("getMoteTestbedAssignmentList() called");
    List<MoteTestbedAssignment> mtbaList = new ArrayList<MoteTestbedAssignment>();
    readLock.lock();/*from   w w  w  .j av a  2s.  co  m*/
    try {
        for (MoteTestbedAssignment i : moteTestbedAssignments.values()) {
            if (i.getTestbedID() == testbedID) {
                mtbaList.add(i);
            }
        }
    } catch (Exception ex) {
        String msg = "Exception in getMoteTestbedAssignmentList";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return mtbaList;
}

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

public List<ProgramMessageSymbol> getProgramMessageSymbolList() throws RemoteException {
    log.debug("getProgramMessageSymbolList() called");
    List<ProgramMessageSymbol> pmsList = null;

    readLock.lock();// w  w w .  j  a  va  2  s .co  m
    try {
        pmsList = new ArrayList<ProgramMessageSymbol>(programMessageSymbols.values());
    } catch (Exception ex) {
        String msg = "Exception in getProgramMessageSymbolList";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return pmsList;
}

From source file:edu.clemson.cs.nestbed.server.management.instrumentation.ProgramWeaverManagerImpl.java

public void weaveInComponents(int programID, Map<String, String> updatedComponents) throws RemoteException {
    try {/*from   w  ww. j  a  v a 2 s.co m*/
        ProgramManager progMgr = ProgramManagerImpl.getInstance();
        Program program = progMgr.getProgram(programID);
        weaveInComponents(new File(program.getSourcePath()), updatedComponents);
    } catch (Exception ex) {
        throw new RemoteException("Exception", ex);
    }
}

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

public List<Project> getProjectList(int testbedID) throws RemoteException {
    log.debug("getProjectList() called");
    List<Project> projectList = new ArrayList<Project>();

    readLock.lock();//from   w ww  .ja  v  a 2 s. c  o  m
    try {
        for (Project i : projects.values()) {
            if (i.getTestbedID() == testbedID) {
                projectList.add(i);
            }
        }
    } catch (Exception ex) {
        String msg = "Exception in getProjectList";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return projectList;
}

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

private TestbedManagerImpl() throws RemoteException {
    super();/*from ww w  .j a  v a 2  s .c o m*/

    try {
        this.managerLock = new ReentrantReadWriteLock(true);
        this.readLock = managerLock.readLock();
        this.writeLock = managerLock.writeLock();
        testbedAdapter = AdapterFactory.createTestbedAdapter(AdapterType.SQL);
        testbeds = testbedAdapter.readTestbeds();

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

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

public List<ProgramProfilingMessageSymbol> getProgramProfilingMessageSymbolList() throws RemoteException {
    log.debug("getProgramProfilingMessageSymbolList() called");
    List<ProgramProfilingMessageSymbol> ppmsList = null;

    readLock.lock();//from w ww . j  av  a2s.  co m
    try {
        ppmsList = new ArrayList<ProgramProfilingMessageSymbol>(ppmSymbols.values());
    } catch (Exception ex) {
        String msg = "Exception in getProgramProfilingMessageSymbolList";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return ppmsList;
}

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

public List<Mote> getMoteList() throws RemoteException {
    List<Mote> moteList = null;

    readLock.lock();/*www .j a va 2 s  . c o m*/
    try {
        moteList = new ArrayList<Mote>(motes.values());
    } catch (Exception ex) {
        String msg = "Exception in getMoteList";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return moteList;
}

From source file:edu.umn.msi.tropix.storage.service.impl.UploadTransferServiceContextFactory.java

/**
 * This method is nearly identical to TransferServiceHelper.createTransferContext(DataDescriptor, DataStagedCallback) but makes sure the resource objects do not expire until after the corresponding context has been terminated.
 * /*from  w  ww  . j a  v a  2s .  c  om*/
 * @param dd
 * @param callback
 * @return
 * @throws RemoteException
 */
public static TransferServiceContextReference createTransferContext(final DataDescriptor dd,
        final DataStagedCallback callback) throws RemoteException {
    EndpointReferenceType epr = null; // new org.apache.axis.message.addressing.EndpointReferenceType(); - created object was never used

    final String homeName = "java:comp/env/services/cagrid/TransferServiceContext/home";
    try {
        final Context initialContext = new InitialContext();
        final TransferServiceContextResourceHome home = (TransferServiceContextResourceHome) initialContext
                .lookup(homeName);
        final ResourceKey resourceKey = home.createResource();

        // Grab the newly created resource
        final TransferServiceContextResource thisResource = (TransferServiceContextResource) home
                .find(resourceKey);
        thisResource.setSecurityDescriptor(SecurityUtils.createCreatorOnlyResourceSecurityDescriptor());
        LOG.debug("Calling stage on resource with callback " + callback);
        thisResource.stage(dd, callback);
        String transportURL = (String) MessageContext.getCurrentContext()
                .getProperty(org.apache.axis.MessageContext.TRANS_URL);
        transportURL = transportURL.substring(0, transportURL.lastIndexOf('/') + 1);
        transportURL += "TransferServiceContext";
        epr = AddressingUtils.createEndpointReference(transportURL, resourceKey);
        storeReference(thisResource);
    } catch (final Exception e) {
        throw new RemoteException("Error looking up TransferServiceContext home:" + e.getMessage(), e);
    }

    // return the typed EPR
    final TransferServiceContextReference ref = new TransferServiceContextReference();
    ref.setEndpointReference(epr);
    LOG.debug("Returning ref");
    return ref;
}

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

@Override
public WSSearchResult[] findPathwaysByLiterature(String query) throws RemoteException {
    try {//from  ww  w  .j  av  a2  s  .com
        query = query.replace(" ", "+");
        String url = baseUrl + "/findPathwaysByLiterature?query=" + query;
        Document jdomDocument = Utils.connect(url, client);
        Element root = jdomDocument.getRootElement();
        List<Element> list = root.getChildren("result", WSNamespaces.NS1);
        WSSearchResult[] res = new WSSearchResult[list.size()];
        for (int i = 0; i < list.size(); i++) {
            res[i] = Utils.parseWSSearchResult(list.get(i));
        }
        return res;
    } catch (Exception e) {
        throw new RemoteException(e.getMessage(), e.getCause());
    }
}

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

public List<ProgramProfilingSymbol> getProgramProfilingSymbols(int configID) throws RemoteException {
    log.debug("getProgramProfilingSymbols() called.");
    List<ProgramProfilingSymbol> symbolList;
    symbolList = new ArrayList<ProgramProfilingSymbol>();

    readLock.lock();/* w w w .  jav a  2s. c  o  m*/
    try {
        for (ProgramProfilingSymbol i : progProfSymbols.values()) {
            if (i.getProjectDeploymentConfigurationID() == configID) {
                symbolList.add(i);
            }
        }
    } catch (Exception ex) {
        String msg = "Exception in getProgramProfilingSymbols";
        log.error(msg, ex);
        throw new RemoteException(msg, ex);
    } finally {
        readLock.unlock();
    }

    return symbolList;
}