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) 

Source Link

Document

Constructs a RemoteException with the specified detail message.

Usage

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public CreateKeyPairResponseType createKeyPair(CreateKeyPairType createKeyPairRequestMsg)
        throws RemoteException {

    try {/* w w  w .  java2s  .  co m*/
        this.findSecurity();
        if (this.security != null) {
            return this.security.createKeyPair(createKeyPairRequestMsg);
        } else {
            return super.createKeyPair(createKeyPairRequestMsg);
        }
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "createKeyPair"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public DescribeKeyPairsResponseType describeKeyPairs(DescribeKeyPairsType describeKeyPairsRequestMsg)
        throws RemoteException {

    try {//from   w ww.j a  va  2 s . com
        this.findSecurity();
        if (this.security != null) {
            return this.security.describeKeyPairs(describeKeyPairsRequestMsg);
        } else {
            return super.describeKeyPairs(describeKeyPairsRequestMsg);
        }
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "describeKeyPairs"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public DeleteKeyPairResponseType deleteKeyPair(DeleteKeyPairType deleteKeyPairRequestMsg)
        throws RemoteException {

    try {/*from   ww  w. j  ava2  s  .  c  om*/
        this.findSecurity();
        if (this.security != null) {
            return this.security.deleteKeyPair(deleteKeyPairRequestMsg);
        } else {
            return super.deleteKeyPair(deleteKeyPairRequestMsg);
        }
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "deleteKeyPair"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public DescribeImagesResponseType describeImages(DescribeImagesType req) throws RemoteException {

    try {/*from  ww w .  java2s  . c  o m*/
        if (this.image == null) {
            this.findImage();
        }
        return this.image.describeImages(req);
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "describeImages"));
    }
}

From source file:ORG.oclc.os.SRW.DSpaceLucene.LuceneQueryResult.java

public LuceneQueryResult(QueryArgs qArgs) throws InstantiationException {
    this.qArgs = qArgs;
    try {/*from   w w  w.  ja va  2 s.c  om*/
        dspaceContext = new Context();
        if (log.isDebugEnabled()) {
            Exception e = new Exception("in LuceneQueryResult constructor called by:");
            log.debug(e, e);
            log.debug("dspaceContext.isValid()=" + dspaceContext.isValid());
            log.debug("getPageSize=" + qArgs.getPageSize() + ", getQuery=" + qArgs.getQuery() + ", getStart="
                    + qArgs.getStart());
            //                new Exception().printStackTrace();
        }
        result = DSQuery.doQuery(dspaceContext, qArgs);
        if (log.isDebugEnabled())
            log.debug(result.getHitHandles().size() + " handles found");

        // now instantiate the results and put them in their buckets
        Integer myType;
        List collectionHandles = new ArrayList(), communityHandles = new ArrayList(),
                itemHandles = new ArrayList();
        String myHandle;
        for (int i = 0; i < result.getHitHandles().size(); i++) {
            myHandle = (String) result.getHitHandles().get(i);
            myType = (Integer) result.getHitTypes().get(i);

            // add the handle to the appropriate lists
            switch (myType.intValue()) {
            case Constants.ITEM:
                itemHandles.add(myHandle);
                break;

            case Constants.COLLECTION:
                collectionHandles.add(myHandle);
                break;

            case Constants.COMMUNITY:
                communityHandles.add(myHandle);
                break;
            }
        }

        int numItems = itemHandles.size();
        if (log.isDebugEnabled())
            log.debug(numItems + " items found");
        resultItems = new Item[numItems];
        for (int i = 0; i < numItems; i++) {
            myHandle = (String) itemHandles.get(i);
            if (log.isDebugEnabled())
                log.debug("about to resolveToObject");
            Object o = HandleManager.resolveToObject(dspaceContext, myHandle);
            if (log.isDebugEnabled())
                log.debug("did resolveToObject");

            resultItems[i] = (Item) o;
            if (resultItems[i] == null)
                throw new RemoteException(
                        "Query \"" + qArgs.getQuery() + "\" returned unresolvable handle: " + myHandle);
        }

        int postings = result.getHitCount();
        //            int postings=itemHandles.size();
        if (log.isDebugEnabled())
            log.debug("'" + qArgs.getQuery() + "'==> " + postings);
    } catch (Exception e) {
        if (dspaceContext != null)
            dspaceContext.abort();
        throw new InstantiationException(e.getMessage());
    }
}

From source file:org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.java

public IJSpace getSpaceDirect(ServiceID serviceID) throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }// w  w w.  j  av a2  s.c o m
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    Method spaceServiceId = serviceDetails.getClass().getMethod("getServiceID");
                    if (spaceServiceId.invoke(serviceDetails).equals(serviceID)) {
                        Field spaceDetails = serviceDetails.getClass().getDeclaredField("directSpace");
                        spaceDetails.setAccessible(true);
                        return (IJSpace) spaceDetails.get(serviceDetails);
                    }
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get space", e);
            }
        }
    }
    return null;
}

From source file:org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.java

public RuntimeHolder getSpaceRuntimeHolder(ServiceID serviceID) throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }// w  w  w.j a  v  a  2  s .c  om
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    Method spaceServiceId = serviceDetails.getClass().getMethod("getServiceID");
                    if (spaceServiceId.invoke(serviceDetails).equals(serviceID)) {
                        Field spaceDetails = serviceDetails.getClass().getDeclaredField("directSpaceAdmin");
                        spaceDetails.setAccessible(true);
                        IInternalRemoteJSpaceAdmin spaceAdmin = (IInternalRemoteJSpaceAdmin) spaceDetails
                                .get(serviceDetails);
                        return spaceAdmin.getRuntimeHolder();
                    }
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get runtime holder", e);
            }
        }
    }
    return null;
}

From source file:org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.java

public StatisticsHolder getSpaceStatisticsHolder(ServiceID serviceID) throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }/*  ww w.  j  a v a2  s  . c  om*/
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    Method spaceServiceId = serviceDetails.getClass().getMethod("getServiceID");
                    if (spaceServiceId.invoke(serviceDetails).equals(serviceID)) {
                        Field spaceDetails = serviceDetails.getClass().getDeclaredField("directSpaceAdmin");
                        spaceDetails.setAccessible(true);
                        IInternalRemoteJSpaceAdmin spaceAdmin = (IInternalRemoteJSpaceAdmin) spaceDetails
                                .get(serviceDetails);
                        return ((StatisticsAdmin) spaceAdmin).getHolder();
                    }
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get statistics holder", e);
            }
        }
    }
    return null;
}

From source file:org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.java

public SpaceURL[] listSpacesURLs() throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }//from w w w.  j  a  v a2 s .  c o m
    List<SpaceURL> spaceUrls = new ArrayList<SpaceURL>();
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    IJSpace space = getSpaceFromServiceDetails(serviceDetails);
                    spaceUrls.add(space.getFinderURL());
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get space url", e);
            }
        }
    }
    return spaceUrls.toArray(new SpaceURL[spaceUrls.size()]);
}

From source file:org.openspaces.pu.container.servicegrid.PUServiceBeanImpl.java

public SpaceMode[] listSpacesModes() throws RemoteException {
    if (puDetails == null) {
        throw new RemoteException("processing unit shutdown");
    }// w  ww. j a  v a 2  s .  c o m
    List<SpaceMode> spacesModes = new ArrayList<SpaceMode>();
    for (Object serviceDetails : puDetails.getDetails()) {
        if (isSpaceServiceDetails(serviceDetails)) {
            try {
                if (containsEmbeddedSpace(serviceDetails)) {
                    IJSpace space = getSpaceFromServiceDetails(serviceDetails);
                    spacesModes.add(((IInternalRemoteJSpaceAdmin) space.getAdmin()).getSpaceMode());
                }
            } catch (Exception e) {
                throw new RemoteException("Failed to get space mode", e);
            }
        }
    }
    return spacesModes.toArray(new SpaceMode[spacesModes.size()]);
}