Examples of XQEngineClient


Examples of xbird.engine.XQEngineClient

        if(LOG.isInfoEnabled()) {
            LOG.info("Invoking remote query at [" + endpoint + "]:\n " + query);
        }

        XQEngineClient client = new XQEngineClient(endpoint);
        QueryRequest request = new QueryRequest(query, RETURN_TYPE);
        StaticContext statEnv = dynEnv.getStaticContext();
        URI baseUri = statEnv.getBaseURI();
        if(baseUri == null) {
            baseUri = statEnv.getSystemBaseURI();
        }
        request.setBaseUri(baseUri);
        prepareVariablesToShip(request, argv, dynEnv);
        final Object result;
        try {
            result = client.execute(request);
        } catch (RemoteException e) {
            throw new XQueryException(e.getMessage(), e.getCause());
        } finally {
            try {
                client.close();
            } catch (RemoteException e) {
                LOG.warn("shutdown failed for `" + endpoint + '\'', e);
            }
        }
        Sequence resultSeq = (Sequence) result;
View Full Code Here

Examples of xbird.engine.XQEngineClient

    }

    @Test(dataProvider = "scenario01", invocationCount = 20, threadPoolSize = 20)
    public void scenario01(String remoteEndpoint, String fileName) throws FileNotFoundException,
            IOException, XQueryException {
        XQEngine engine = new XQEngineClient(remoteEndpoint);
        String query = IOUtils.toString(new FileInputStream(fileName));
        QueryRequest request = new QueryRequest(query, ReturnType.ASYNC_REMOTE_SEQUENCE);
        Sequence<Item> resultSeq = (Sequence<Item>) engine.execute(request);
        Writer writer = new NoopWriter();
        SAXWriter saxwr = new SAXWriter(writer, "UTF-8");
        Serializer ser = new SAXSerializer(saxwr, writer);
        ser.emit(resultSeq);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.