Package xbird.engine.remote

Examples of xbird.engine.remote.RemoteSequence


                try {
                    UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
                } catch (RemoteException e) {
                    throw new IllegalStateException("failed exporting result sequence", e);
                }
                final RemoteSequence ret = new RemoteSequence(remote, result.getType());
                new Thread(remote, "QueryTask[" + task.getTaskId() + "]#AsyncQueryProcessor").start();
                return ret;
            } else {
                if(LOG.isInfoEnabled()) {
                    LOG.info("Response method for a task [" + task.getTaskId() + "]: DataShipping");
View Full Code Here


                    UnicastRemoteObject.exportObject(remote, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
                } catch (RemoteException e) {
                    LOG.error(e.getMessage(), e);
                    throw new IllegalStateException("failed exporting result sequence", e);
                }
                final RemoteSequence ret = new RemoteSequence(remote, result.getType());
                final Thread th = new Thread(remote, "LocalQueryTask[" + task.getTaskId()
                        + "]#AsyncQueryProcessor(RemoteSequence)");
                th.start();
                return ret;
            } else {
View Full Code Here

        XQEngine engine = new XQEngineClient("//" + bindHost + ":1099/xbird/srv-01");

        QueryRequest request1 = new QueryRequest("1+2", ReturnType.REMOTE_SEQUENCE);

        Object result1 = engine.execute(request1);
        RemoteSequence remoteSequence = (RemoteSequence) result1;

        Assert.assertFalse(remoteSequence.isEmpty());
        IFocus<Item> focus = remoteSequence.iterator();
        Assert.assertEquals(new XInteger(3), focus.next());
        Assert.assertFalse(focus.hasNext());
    }
View Full Code Here

                    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();
View Full Code Here

            out.writeObject(value);
        } else {
            out.writeBoolean(true);
            if(result instanceof RemoteSequence) {
                out.writeBoolean(true);
                RemoteSequence remote = (RemoteSequence) result;
                remote.writeExternal(out);
            } else {
                out.writeBoolean(false);
                final StopWatch sw = new StopWatch("Elapsed time for encoding `$" + getName()
                        + '\'');
                final XQEventEncoder encoder = new XQEventEncoder(out);
View Full Code Here

            try {
                UnicastRemoteObject.exportObject(proxy, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
            } catch (RemoteException e) {
                throw new XQueryException("failed exporting variable: " + shippedVar.getName(), e);
            }
            final RemoteSequence remote = new RemoteSequence(proxy, result.getType());
            shippedVar.setResult(remote);
        }
    }
View Full Code Here

            try {
                UnicastRemoteObject.exportObject(proxy, 0, TimeoutSocketProdiver.createClientSocketFactory(), TimeoutSocketProdiver.createServerSocketFactory());
            } catch (RemoteException e) {
                throw new XQueryException("failed exporting variable: " + varname, e);
            }
            RemoteSequence remote = new RemoteSequence(proxy, result.getType());
            shiped = new ShippedVariable(varname, remote);
        }
        return shiped;
    }
View Full Code Here

            out.writeObject(value);
        } else {
            out.writeBoolean(true);
            if(result instanceof RemoteSequence) {
                out.writeBoolean(true);
                RemoteSequence remote = (RemoteSequence) result;
                remote.writeExternal(out);
            } else {
                out.writeBoolean(false);
                final StopWatch sw = new StopWatch("Elapsed time for encoding `$" + getName()
                        + '\'');
                final XQEventEncoder encoder = new XQEventEncoder(out);
View Full Code Here

                    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();
View Full Code Here

TOP

Related Classes of xbird.engine.remote.RemoteSequence

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.