Examples of emit()


Examples of xbird.xquery.dm.coder.XQEventEncoder.emit()

        final XQEventEncoder encoder = new XQEventEncoder(objOut);
        if(remotePaing) {
            encoder.setRemotePaging(true);
        }
        try {
            encoder.emit(entity);
            objOut.flush();
        } catch (XQueryException xqe) {
            throw new IllegalStateException("failed encoding", xqe);
        } catch (Throwable e) {
            LOG.fatal(e);
View Full Code Here

Examples of xbird.xquery.dm.coder.XQEventEncoder.emit()

        if(encodedSequence != null) {
            final FastByteArrayOutputStream bufOut = new FastByteArrayOutputStream(16384);
            final ObjectOutputStream objOut = new ObjectOutputStream(bufOut);
            final XQEventEncoder encoder = new XQEventEncoder(objOut);
            try {
                encoder.emit(actualSequence);
                objOut.flush();
            } catch (XQueryException xqe) {
                throw new IOException(PrintUtils.prettyPrintStackTrace(xqe));
            } catch (Throwable e) {
                LOG.fatal(e);
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

        processor.compile(mod);
        System.err.println(mod.getExpression().toString());
        Sequence result = processor.execute(mod);
        StringWriter res_sw = new StringWriter();
        Serializer ser = new SAXSerializer(new SAXWriter(res_sw), res_sw);
        ser.emit(result);
        String swresult = sw.toString();
        long used = SystemUtils.getHeapUsedMemory();
        stdbuf.append(", used(before GC): " + StringUtils.displayBytesSize(used));
        System.gc();
        used = SystemUtils.getHeapUsedMemory();
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

    }

    public void writeItemToSAX(ContentHandler saxhdlr) throws XQException {
        final SAXSerializer ser = new SAXSerializer(saxhdlr);
        try {
            ser.emit(item_);
        } catch (XQueryException e) {
            final XQException xqe = new XQException(e.getMessage());
            xqe.initCause(e);
            throw xqe;
        }
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

            throw new XQueryException("failed to execute a query", e);
        }

        SAXWriter saxwr = prepareSAXWriter(writer);
        Serializer ser = new SAXSerializer(saxwr, writer);
        ser.emit(resultSeq);
        if(_wrap) {
            try {
                writer.write("\n</root>\n");
            } catch (IOException e) {
                throw new IllegalStateException(e);
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

        SAXWriter saxwr = prepareSAXWriter(writer);
        Serializer ser = new SAXSerializer(saxwr, writer);
        Sequence<? extends Item> result = proc.execute(module);
        if(_timing) {
            final StopWatch sw = new StopWatch("print time");
            ser.emit(result);
            if(_timing_in_msec) {
                System.out.println('\n' + sw.elapsed() + " msec");
            } else {
                System.out.println();
                System.out.println(sw);
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

            } else {
                System.out.println();
                System.out.println(sw);
            }
        } else {
            ser.emit(result);
        }
        if(_wrap) {
            try {
                writer.write("\n</root>\n");
            } catch (IOException e) {
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

        }
        // serialize       
        SAXWriter writer = new SAXWriter(out);
        Serializer ser = new SAXSerializer(writer);
        try {
            ser.emit(result);
        } catch (XQueryException e) {
            reportError("Serialization failed: " + queryPath, e, out);
            return;
        }
    }
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

        QueryRequest request = new QueryRequest(query, ReturnType.ASYNC_REMOTE_SEQUENCE);
        Sequence<Item> resultSeq = (Sequence<Item>) engine.execute(request);
        Writer writer = new FastBufferedWriter(new OutputStreamWriter(System.out), 4096);
        SAXWriter saxwr = new SAXWriter(writer, "UTF-8");
        Serializer ser = new SAXSerializer(saxwr, writer);
        ser.emit(resultSeq);
        writer.flush();
    }

    public static void main(String[] args) {
        TestListenerAdapter adapter = new TestListenerAdapter();
View Full Code Here

Examples of xbird.xquery.dm.ser.SAXSerializer.emit()

        final XQueryProcessor processor = new XQueryProcessor();
        XQueryModule mod = processor.parse(new FileInputStream(queryFile), new File(queryFile).toURI());
        Sequence result = processor.execute(mod);
        StringWriter res_sw = new StringWriter();
        final Serializer ser = new SAXSerializer(new SAXWriter(res_sw), res_sw);
        ser.emit(result);
        String swresult = sw.toString();
        long used = SystemUtils.getHeapUsedMemory();
        stdbuf.append(", used(before GC): " + StringUtils.displayBytesSize(used));
        if(RUN_ONLY) {
            res_sw.close();
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.