Package org.apache.cocoon.thread

Examples of org.apache.cocoon.thread.ThreadPool


    public void init() throws Exception {
        if (workerThreadPools != null) {
            final Iterator iter = workerThreadPools.keySet().iterator();
            while (iter.hasNext()) {
                final String key = (String) iter.next();
                final ThreadPool pool = (ThreadPool) workerThreadPools.get(key);
                synchronized (pools) {
                    pools.put(pool.getName(), pool);
                }
            }
        }

        // Check if a "default" pool has been created
        final ThreadPool defaultThreadPool = (ThreadPool) pools.get(ThreadPool.DEFAULT_THREADPOOL_NAME);

        if (null == defaultThreadPool) {
            createPool(ThreadPool.DEFAULT_THREADPOOL_NAME, ThreadPool.DEFAULT_QUEUE_SIZE,
                            ThreadPool.DEFAULT_MAX_POOL_SIZE, ThreadPool.DEFAULT_MIN_POOL_SIZE,
                            convertPriority(ThreadPool.DEFAULT_THREAD_PRIORITY), ThreadPool.DEFAULT_DAEMON_MODE,
View Full Code Here


        if (interval < 0) {
            throw new IllegalArgumentException("interval < 0");
        }

        ThreadPool pool = (ThreadPool) pools.get(threadPoolName);

        if (null == pool) {
            getLogger().warn(
                            "ThreadPool \"" + threadPoolName + "\" is not known. Will use ThreadPool \""
                                            + ThreadPool.DEFAULT_THREADPOOL_NAME + "\"");
            pool = (ThreadPool) pools.get(ThreadPool.DEFAULT_THREADPOOL_NAME);
        }

        if (getLogger().isDebugEnabled()) {
            getLogger().debug(
                            "Command entered: " + command + ", pool=" + (null == pool ? "null" : pool.getName())
                                            + ", delay=" + delay + ", interval=" + interval);
        }

        new ExecutionInfo(pool, command, delay, interval, getLogger());
    }
View Full Code Here

TOP

Related Classes of org.apache.cocoon.thread.ThreadPool

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.