Package xbird.engine.remote

Examples of xbird.engine.remote.ThrottedRemoteSequenceProxy


        if(doForwarding) {
            if(queryShipping) {// TODO take CPU usage into consideration
                if(LOG.isInfoEnabled()) {
                    LOG.info("Response method for a task [" + task.getTaskId() + "]: QueryShipping");
                }
                final ThrottedRemoteSequenceProxy remote = new ThrottedRemoteSequenceProxy(result);
                try {
                    UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
                } catch (RemoteException e) {
                    throw new IllegalStateException("failed exporting result sequence", e);
                }
View Full Code Here


                if(LOG.isInfoEnabled()) {
                    LOG.info("Response method for a task [" + task.getTaskId()
                            + "]: QueryShipping [type:" + ClassUtils.getSimpleClassName(result)
                            + ']');
                }
                final ThrottedRemoteSequenceProxy remote = new ThrottedRemoteSequenceProxy(result);
                try {
                    UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
                } catch (RemoteException e) {
                    LOG.error(e.getMessage(), e);
                    throw new IllegalStateException("failed exporting result sequence", e);
View Full Code Here

                } else if(returnType == ReturnType.REMOTE_PADED_SEQUENCE) {
                    MarshalledSequence seq = new MarshalledSequence(result, dynEnv);
                    seq.setRemotePaging(true);
                    ret = seq;
                } else if(returnType == ReturnType.AUTO) {// treat as 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);
                } 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);
                }
View Full Code Here

                } else if(returnType == ReturnType.REMOTE_PADED_SEQUENCE) {
                    MarshalledSequence seq = new MarshalledSequence(result, dynEnv);
                    seq.setRemotePaging(true);
                    ret = seq;
                } else if(returnType == ReturnType.AUTO) {// treat as 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);
                } 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);
                }
View Full Code Here

TOP

Related Classes of xbird.engine.remote.ThrottedRemoteSequenceProxy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.