Examples of ThreadPool


Examples of org.apache.axis2.util.threadpool.ThreadPool

                connectionManagerParams.setTcpNoDelay(true);
                connectionManagerParams.setStaleCheckingEnabled(true);
                connectionManagerParams.setLinger(0);
                connectionManager.setParams(connectionManagerParams);
                httpClient = new HttpClient(connectionManager);
                configContext.setThreadPool(new ThreadPool(1, 5));
                configContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT, Boolean.TRUE);
                configContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
            }
   
            serviceClient = new ServiceClient(configContext, axisClientSideService);
View Full Code Here

Examples of org.apache.catalina.tribes.transport.ThreadPool

     * @throws IOException
     * @todo Implement this org.apache.catalina.tribes.ChannelReceiver method
     */
    public void start() throws IOException {
        try {
            setPool(new ThreadPool(new Object(),getMaxThreads(),getMinThreads(),this));
        } catch (Exception e) {
            log.error("ThreadPool can initilzed. Listener not started", e);
            return;
        }
        try {
View Full Code Here

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

Examples of org.apache.excalibur.thread.ThreadPool

     *            invalid or named pool does not exist
     */
    public ThreadPool getThreadPool( final String name )
        throws IllegalArgumentException
    {
        final ThreadPool threadPool = (ThreadPool)m_threadPools.get( name );

        if( null == threadPool )
        {
            final String message = "Unable to locate ThreadPool named " + name;
            throw new IllegalArgumentException( message );
View Full Code Here

Examples of org.apache.geronimo.pool.ThreadPool

    private Object userKey = "test user info";

    protected void setUp() throws Exception {
        userTaskFactory = new MockUserTaskFactory();
        threadPool = new ThreadPool(30, "TestPool", 10000, this.getClass().getClassLoader(), "foo:bar=baz");
        WorkerPersistence workerPersistence = new VMWorkerPersistence();
        timer = new ThreadPooledTimer(executableWorkFactory, workerPersistence, threadPool, transactionContextManager);
        timer.doStart();

        counter.set(0);
View Full Code Here

Examples of org.apache.geronimo.pool.ThreadPool

    private GeronimoWorkManager workManager;

    protected void setUp() throws Exception {
        TransactionContextManager transactionContextManager = new TransactionContextManager();
        ThreadPool pool = new ThreadPool(1, "Connector Test", 30000, ThreadPool.class.getClassLoader(), "foo:test=bar");
        pool.setWaitWhenBlocked(true);
        workManager = new GeronimoWorkManager(pool, pool, pool, transactionContextManager);
        workManager.doStart();
    }
View Full Code Here

Examples of org.apache.geronimo.pool.ThreadPool

*/
public class BootstrapContextTest extends TestCase {
    ThreadPool pool;
    protected void setUp() throws Exception {
        super.setUp();
        pool = new ThreadPool(1, "Connector Test", 30000, ThreadPool.class.getClassLoader(), "foo:test=bar");
    }
View Full Code Here

Examples of org.apache.geronimo.pool.ThreadPool

    private Object userKey = "test user info";

    protected void setUp() throws Exception {
        userTaskFactory = new MockUserTaskFactory();
        threadPool = new ThreadPool(30, "TestPool", 10000, this.getClass().getClassLoader(), "foo:bar=baz");
        WorkerPersistence workerPersistence = new VMWorkerPersistence();
        timer = new ThreadPooledTimer(executableWorkFactory, workerPersistence, threadPool, transactionContextManager);
        timer.doStart();

        counter.set(0);
View Full Code Here

Examples of org.apache.geronimo.system.ThreadPool

    }

    class ClientAction implements PrivilegedExceptionAction {

        public Object run() throws Exception {
            ThreadPool tp = new ThreadPool();
            tp.setKeepAliveTime(1 * 1000);
            tp.setMinimumPoolSize(1);
            tp.setMaximumPoolSize(5);
            tp.setPoolName("Client TP");
            tp.doStart();

            ClockPool cp = new ClockPool();
            cp.setPoolName("Client CP");
            cp.doStart();

            SelectorManager sm = new SelectorManager();
            sm.setThreadPool(tp);
            sm.setThreadName("Client Selector Manager");
            sm.doStart();

            ControlClientProtocolStack clientStack = new ControlClientProtocolStack();
            clientStack.setClassLoader(Thread.currentThread().getContextClassLoader());
            clientStack.setThreadPool(tp);
            clientStack.setClockPool(cp);
            clientStack.setSelectorManager(sm);

            SocketProtocol sp = new SocketProtocol();
            sp.setTimeout(1000 * 1000); //todo reset to 10s
            sp.setInterface(new InetSocketAddress(ssa.getConnectURI().getHost(), 0));
            sp.setAddress(new InetSocketAddress(ssa.getConnectURI().getHost(), ssa.getConnectURI().getPort()));
            sp.setSelectorManager(sm);

            clientStack.push(sp);

            ControlClientProtocol ccp = new ControlClientProtocol();
            ccp.setTimeout(1000 * 1000); //todo set to 10s

            clientStack.push(ccp);

            clientStack.setup();
            Thread.sleep(5 * 1000); //todo delete

            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());
            clientStack.sendDown(getPlainPacket());

            Thread.sleep(5 * 1000); //todo back to 5s

            clientStack.drain();

            shutdownLatch.release();

            sm.doStop();

            cp.doStop();

            tp.doStop();

            stopLatch.release();

            return null;
        }
View Full Code Here

Examples of org.apache.geronimo.system.threads.ThreadPool

        fakeRepo = "http://nowhere.com/";
        String url = getClass().getResource("/geronimo-plugins.xml").toString();
        int pos = url.lastIndexOf("/");
        testRepo = url.substring(0, pos);
        installer = new PluginInstallerGBean(new MockConfigManager(), new MockWritableListableRepository(), new MockConfigStore(),
                new BasicServerInfo("."), new ThreadPool() {
            public int getPoolSize() {
                return 0;
            }

            public int getMaximumPoolSize() {
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.