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:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSDataCluster getDataCluster(WSGetDataCluster wsDataClusterGet) throws RemoteException {
    try {/*  w w w. j a v  a 2  s  .  c  o m*/
        return XConverter.VO2WS(Util.getDataClusterCtrlLocal()
                .getDataCluster(new DataClusterPOJOPK(wsDataClusterGet.getWsDataClusterPK().getPk())));
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSBoolean existsDataCluster(WSExistsDataCluster wsExistsDataCluster) throws RemoteException {
    try {//from   ww w . j a  v  a  2  s  . c o m
        return new WSBoolean(Util.getDataClusterCtrlLocal().existsDataCluster(
                new DataClusterPOJOPK(wsExistsDataCluster.getWsDataClusterPK().getPk())) != null);
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

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

@Override
public WSPathwayInfo createPathway(String gpml, WSAuth auth) throws RemoteException {
    try {//from ww  w  .j  a  v a  2 s.  c  o  m
        Map<String, String> map = new HashMap<String, String>();
        map.put("gpml", gpml);
        map.put("auth", auth.getKey());
        map.put("username", auth.getUser());

        String url = baseUrl + "/createPathway";

        HttpPost httpost = new HttpPost(url);
        // Adding all form parameters in a List of type NameValuePair
        List<NameValuePair> nvps = new ArrayList<NameValuePair>();
        for (String key : map.keySet()) {
            nvps.add(new BasicNameValuePair(key, map.get(key)));
        }
        httpost.addHeader("Accept-Encoding", "application/xml");
        httpost.setEntity(new UrlEncodedFormEntity(nvps, Consts.UTF_8));
        HttpResponse response = client.execute(httpost);

        SAXBuilder jdomBuilder = new SAXBuilder();
        Document jdomDocument = jdomBuilder.build(response.getEntity().getContent());
        Element root = jdomDocument.getRootElement();
        Element p = root.getChild("pathwayInfo", WSNamespaces.NS1);
        return Utils.parseWSPathwayInfo(p);
    } catch (Exception e) {
        e.printStackTrace();
        throw new RemoteException(e.getMessage(), e.getCause());
    }
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSBoolean existsDBDataCluster(WSExistsDBDataCluster wsExistsDataCluster) throws RemoteException {
    try {/*from www .  j a  va2s  .c om*/
        String clusterName = wsExistsDataCluster.getName();
        boolean exist = Util.getXmlServerCtrlLocal().existCluster(clusterName);
        return new WSBoolean(exist);
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSDataClusterPKArray getDataClusterPKs(WSRegexDataClusterPKs regexp) throws RemoteException {
    try {/*from   w ww  . j av  a2 s  .  co  m*/
        WSDataClusterPKArray array = new WSDataClusterPKArray();
        ArrayList<WSDataClusterPK> l = new ArrayList<WSDataClusterPK>();
        Collection<DataClusterPOJOPK> vos = Util.getDataClusterCtrlLocal().getDataClusterPKs(regexp.getRegex());
        for (DataClusterPOJOPK pk : vos) {
            l.add(new WSDataClusterPK(pk.getUniqueId()));
        }
        array.setWsDataClusterPKs(l.toArray(new WSDataClusterPK[l.size()]));
        return array;
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSDataClusterPK deleteDataCluster(WSDeleteDataCluster wsDeleteDataCluster) throws RemoteException {
    try {//from w w w .  j ava  2s. com
        return new WSDataClusterPK(Util.getDataClusterCtrlLocal()
                .removeDataCluster(new DataClusterPOJOPK(wsDeleteDataCluster.getWsDataClusterPK().getPk()))
                .getUniqueId());
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSBoolean putDBDataCluster(WSPutDBDataCluster wsDataCluster) throws RemoteException {
    try {/*from   w w  w.  java2 s. com*/
        Util.getXmlServerCtrlLocal().createCluster(wsDataCluster.getName());
        DataClusterPOJO pojo = new DataClusterPOJO(wsDataCluster.getName(), "", ""); //$NON-NLS-1$ //$NON-NLS-2$
        pojo.store();
        return new WSBoolean(true);
    } catch (Exception e) {
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:com.vmware.identity.SharedUtils.java

@Override
public IIdentityManager Login(String hash) throws RemoteException, SecurityException {
    ILoginManager loginManager;/*  ww w .jav  a 2 s .  com*/
    try {
        loginManager = getLoginManager();
    } catch (MalformedURLException | NotBoundException e) {
        throw new RemoteException("Unable to get real ILoginManager", e);
    }
    return loginManager.Login(hash);
}

From source file:com.amalto.core.delegator.IXtentisWSDelegator.java

@Override
public WSView getView(WSGetView wsViewGet) throws RemoteException {
    try {//w  w  w  . ja  v a  2s. co m
        return XConverter
                .VO2WS(Util.getViewCtrlLocal().getView(new ViewPOJOPK(wsViewGet.getWsViewPK().getPk())));
    } catch (Exception e) {
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug(e.getMessage(), e);
        }
        throw new RemoteException(
                (e.getCause() == null ? e.getLocalizedMessage() : e.getCause().getLocalizedMessage()), e);
    }
}

From source file:com.vmware.identity.SharedUtils.java

@Override
public File getSecretFile() throws RemoteException {
    ILoginManager loginManager;/*from  w w w . j  a  v  a2  s. c o  m*/
    try {
        loginManager = getLoginManager();
        return loginManager.getSecretFile();
    } catch (MalformedURLException | NotBoundException e) {
        throw new RemoteException("Unable to get real ILoginManager", e);
    }
}