Search in sources :

Example 1 with NokogiriBlockingQueueInputStream

use of nokogiri.internals.NokogiriBlockingQueueInputStream in project nokogiri by sparklemotion.

the class XmlSaxPushParser method initialize_task.

private void initialize_task(ThreadContext context) throws IOException {
    if (futureTask == null || stream == null) {
        stream = new NokogiriBlockingQueueInputStream();
        parserTask = new ParserTask(context, saxParser);
        futureTask = new FutureTask<XmlSaxParserContext>(parserTask);
        executor = Executors.newSingleThreadExecutor(new ThreadFactory() {

            @Override
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r);
                t.setName("XmlSaxPushParser");
                t.setDaemon(true);
                return t;
            }
        });
        executor.submit(futureTask);
    }
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) NokogiriBlockingQueueInputStream(nokogiri.internals.NokogiriBlockingQueueInputStream)

Example 2 with NokogiriBlockingQueueInputStream

use of nokogiri.internals.NokogiriBlockingQueueInputStream in project gocd by gocd.

the class XmlSaxPushParser method initialize_task.

private void initialize_task(ThreadContext context) throws IOException {
    if (futureTask == null || stream == null) {
        stream = new NokogiriBlockingQueueInputStream();
        parserTask = new ParserTask(context, saxParser);
        futureTask = new FutureTask<XmlSaxParserContext>(parserTask);
        executor = Executors.newSingleThreadExecutor(new ThreadFactory() {

            @Override
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r);
                t.setName("XmlSaxPushParser");
                t.setDaemon(true);
                return t;
            }
        });
        executor.submit(futureTask);
    }
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) NokogiriBlockingQueueInputStream(nokogiri.internals.NokogiriBlockingQueueInputStream)

Example 3 with NokogiriBlockingQueueInputStream

use of nokogiri.internals.NokogiriBlockingQueueInputStream in project gocd by gocd.

the class HtmlSaxPushParser method initialize_task.

private void initialize_task(ThreadContext context) throws IOException {
    if (futureTask == null || stream == null) {
        stream = new NokogiriBlockingQueueInputStream();
        parserTask = new ParserTask(context, saxParser);
        futureTask = new FutureTask<HtmlSaxParserContext>(parserTask);
        executor = Executors.newSingleThreadExecutor(new ThreadFactory() {

            @Override
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r);
                t.setName("HtmlSaxPushParser");
                t.setDaemon(true);
                return t;
            }
        });
        executor.submit(futureTask);
    }
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) NokogiriBlockingQueueInputStream(nokogiri.internals.NokogiriBlockingQueueInputStream)

Example 4 with NokogiriBlockingQueueInputStream

use of nokogiri.internals.NokogiriBlockingQueueInputStream in project nokogiri by sparklemotion.

the class HtmlSaxPushParser method initialize_task.

private void initialize_task(ThreadContext context) throws IOException {
    if (futureTask == null || stream == null) {
        stream = new NokogiriBlockingQueueInputStream();
        parserTask = new ParserTask(context, saxParser);
        futureTask = new FutureTask<HtmlSaxParserContext>(parserTask);
        executor = Executors.newSingleThreadExecutor(new ThreadFactory() {

            @Override
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r);
                t.setName("HtmlSaxPushParser");
                t.setDaemon(true);
                return t;
            }
        });
        executor.submit(futureTask);
    }
}
Also used : ThreadFactory(java.util.concurrent.ThreadFactory) NokogiriBlockingQueueInputStream(nokogiri.internals.NokogiriBlockingQueueInputStream)

Aggregations

ThreadFactory (java.util.concurrent.ThreadFactory)4 NokogiriBlockingQueueInputStream (nokogiri.internals.NokogiriBlockingQueueInputStream)4