try {
UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
} catch (RemoteException e) {
throw new IllegalStateException("failed exporting result sequence", e);
}
ret = new RemoteSequence(remote, result.getType());
_executors.execute(remote);
} else {
assert (returnType == ReturnType.REDIRECTABLE_MARSHALLED_SEQUENCE) : returnType;
ret = new MarshalledSequence(result, dynEnv);
}
break;
}
case REMOTE_SEQUENCE: {
final RemoteSequenceProxy remote = new RemoteSequenceProxy(result, request);
try {
UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
} catch (RemoteException e) {
throw new IllegalStateException("failed exporting result sequence", e);
}
ret = new RemoteSequence(remote, result.getType());
break;
}
case ASYNC_REMOTE_SEQUENCE: {
final RunnableRemoteSequenceProxy remote = new RunnableRemoteSequenceProxy(result, request);
try {
UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
} catch (RemoteException e) {
throw new IllegalStateException("failed exporting result sequence", e);
}
ret = new RemoteSequence(remote, result.getType());
_executors.execute(remote);
break;
}
case THROTTLED_ASYNC_REMOTE_SEQUENCE: {
final ThrottedRemoteSequenceProxy remote = new ThrottedRemoteSequenceProxy(_throttle, result, request);
try {
UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
} catch (RemoteException e) {
throw new IllegalStateException("failed exporting result sequence", e);
}
ret = new RemoteSequence(remote, result.getType());
_executors.execute(remote);
break;
}
case STRING:
ret = result.toString();