public static void serialize( XQueryContext context, SequenceIterator siNode, Properties outputProperties, OutputStream os) throws IOException { LOG.debug("Serializing started."); SAXSerializer sax = (SAXSerializer) SerializerPool.getInstance().borrowObject(SAXSerializer.class); try { String encoding = outputProperties.getProperty(OutputKeys.ENCODING, "UTF-8"); Writer writer = new OutputStreamWriter(os, encoding); sax.setOutput(writer, outputProperties); Serializer serializer = context.getBroker().getSerializer(); serializer.reset(); serializer.setProperties(outputProperties); serializer.setReceiver(sax); sax.startDocument(); while (siNode.hasNext()) { NodeValue next = (NodeValue) siNode.nextItem(); serializer.toSAX(next); } sax.endDocument(); writer.close(); } catch (Exception e) { String txt = "A problem ocurred while serializing the node set"; LOG.debug(txt + ".", e); throw new ExistIOException(txt + ": " + e.getMessage(), e); } finally { LOG.debug("Serializing done."); SerializerPool.getInstance().returnObject(sax); } }
public Validation(XQueryContext context, FunctionSignature signature) { super(context, signature); brokerPool = context.getBroker().getBrokerPool(); validator = new Validator(brokerPool); }
public Jing(XQueryContext context, FunctionSignature signature) { super(context, signature); brokerPool = context.getBroker().getBrokerPool(); }
/** * ScheduleFunctions Constructor * * @param context The Context of the calling XQuery */ public ScheduleFunctions(XQueryContext context, FunctionSignature signature) { super(context, signature); scheduler = context.getBroker().getBrokerPool().getScheduler(); }