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:org.panbox.desktop.windows.service.PanboxServiceSession.java

@Override
public String getOnlineFilename(VolumeParams p, String fileName)
        throws RemoteException, FileNotFoundException, ObfuscationException {
    String shareid = FilenameUtils.getName(p.path); // Dropbox share name
    String path = File.separator + username + File.separator + p.shareName + File.separator + fileName;
    PanboxFS fs;//from  w  w  w .  j a  v  a  2  s.  co m
    try {
        fs = VFSManager.getInstance().getVFS();
        String obf = fs.backingStorage.obfuscatePath(path, false);
        String windowsPath = obf.replace(p.shareName, shareid);
        return windowsPath.replace("\\", "/");
    } catch (ConfigurationException | IllegalArgumentException | IllegalAccessException
            | InvocationTargetException e) {
        throw new RemoteException("Error obtaining VFS manager instance", e);
    }
}

From source file:org.speechforge.cairo.server.resource.ReceiverResource.java

public void bye(String sessionId) throws RemoteException {
    ResourceSession session = ResourceSession.getSession(sessionId);
    Map<String, ChannelResources> sessionChannels = session.getChannels();
    for (ChannelResources channel : sessionChannels.values()) {
        //always close the mrcp channel (common to resources)
        _mrcpServer.closeChannel(channel.getChannelId());

        //then do resource specific cleanup
        //TODO: remove instanceof if statements (and casting) and add specific code to resources class (abstract method)
        //issue is that each resource needs a reference to a different pool so a common cleanup method will be hard
        //maybe just pass in an interface to "this" to the cleanup method that can get access to pools.
        if (channel instanceof RecognizerResources) {
            RecognizerResources r = (RecognizerResources) channel;
            //r.getRecog().closeProcessor();
            r.getReplicator().shutdown();
            try {
                _replicatorPool.returnObject(r.getReplicator());
            } catch (Exception e) {
                _logger.debug(e, e);/*from   w  w w  . j a  va  2 s . c  o  m*/
                throw new RemoteException(e.getMessage(), e);
            }
        } else if (channel instanceof RecorderResources) {
            RecorderResources r = (RecorderResources) channel;
            //r.getRecorder().closeProcessor();
            try {
                _replicatorPool.returnObject(r.getRecorderReplicator());
            } catch (Exception e) {
                _logger.debug(e, e);
                throw new RemoteException(e.getMessage(), e);
            }
        } else {
            _logger.warn("Unsupported channle resource of type " + channel.toString());
        }

    }
    ResourceSession.removeSession(session);
}