Package org.mortbay.thread

Examples of org.mortbay.thread.BoundedThreadPool


  /**
   * Set the min, max number of worker threads (simultaneous connections).
   */
  public void setThreads(int min, int max) {
    BoundedThreadPool pool = (BoundedThreadPool) webServer.getThreadPool();
    pool.setMinThreads(min);
    pool.setMaxThreads(max);
  }
View Full Code Here


        return connectionPool;
    }
   
    public org.mortbay.jetty.client.HttpClient getNewJettyClient(HttpComponent comp) throws Exception {
        org.mortbay.jetty.client.HttpClient tempClient = new org.mortbay.jetty.client.HttpClient();
        BoundedThreadPool btp = new BoundedThreadPool();
        btp.setMaxThreads(comp.getConfiguration().getJettyClientThreadPoolSize());
        tempClient.setThreadPool(btp);
        tempClient.start();
        return tempClient;
    }
View Full Code Here

                server.start();
              
                AbstractConnector aconn = (AbstractConnector) connector;
                if (aconn.getThreadPool() instanceof BoundedThreadPool
                    && isSetThreadingParameters()) {
                    BoundedThreadPool pool = (BoundedThreadPool)aconn.getThreadPool();
                    if (getThreadingParameters().isSetMinThreads()) {
                        pool.setMinThreads(getThreadingParameters().getMinThreads());
                    }
                    if (getThreadingParameters().isSetMaxThreads()) {
                        pool.setMaxThreads(getThreadingParameters().getMaxThreads());
                    }
                }
            } catch (Exception e) {
                LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage()});
                //problem starting server
View Full Code Here

                server.start();
              
                AbstractConnector aconn = (AbstractConnector) connector;
                if (aconn.getThreadPool() instanceof BoundedThreadPool
                    && isSetThreadingParameters()) {
                    BoundedThreadPool pool = (BoundedThreadPool)aconn.getThreadPool();
                    if (getThreadingParameters().isSetMinThreads()) {
                        pool.setMinThreads(getThreadingParameters().getMinThreads());
                    }
                    if (getThreadingParameters().isSetMaxThreads()) {
                        pool.setMaxThreads(getThreadingParameters().getMaxThreads());
                    }
                }
            } catch (Exception e) {
                LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage()});
                //problem starting server
View Full Code Here

    public void init() throws Exception {
        try {
            state = STARTING;
            server = new Server();
            if (scheduler == null) {
                BoundedThreadPool threadPool = new BoundedThreadPool();
                threadPool.setMaxThreads(100);
                server.setThreadPool(threadPool);
            } else {
                server.setThreadPool(new TuscanyThreadPool());
            }
            if (connector == null) {
View Full Code Here

                    setReuseAddress(connector);
                }
                AbstractConnector aconn = (AbstractConnector) connector;
                if (aconn.getThreadPool() instanceof BoundedThreadPool
                    && isSetThreadingParameters()) {
                    BoundedThreadPool pool = (BoundedThreadPool)aconn.getThreadPool();
                    if (getThreadingParameters().isSetMinThreads()) {
                        pool.setMinThreads(getThreadingParameters().getMinThreads());
                    }
                    if (getThreadingParameters().isSetMaxThreads()) {
                        pool.setMaxThreads(getThreadingParameters().getMaxThreads());
                    }
                }
            } catch (Exception e) {
                LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage()});
                //problem starting server
View Full Code Here

                server.start();
              
                AbstractConnector aconn = (AbstractConnector) connector;
                if (isSetThreadingParameters()) {
                    if (aconn.getThreadPool() instanceof BoundedThreadPool) {
                        BoundedThreadPool pool = (BoundedThreadPool)aconn.getThreadPool();
                        if (getThreadingParameters().isSetMinThreads()) {
                            pool.setMinThreads(getThreadingParameters().getMinThreads());
                        }
                        if (getThreadingParameters().isSetMaxThreads()) {
                            pool.setMaxThreads(getThreadingParameters().getMaxThreads());
                        }
                    } else if (aconn.getThreadPool() instanceof QueuedThreadPool) {
                        QueuedThreadPool pool = (QueuedThreadPool)aconn.getThreadPool();
                        if (getThreadingParameters().isSetMinThreads()) {
                            pool.setMinThreads(getThreadingParameters().getMinThreads());
                        }
                        if (getThreadingParameters().isSetMaxThreads()) {
                            pool.setMaxThreads(getThreadingParameters().getMaxThreads());
                        }
                    }
                }
            } catch (Exception e) {
                LOG.log(Level.SEVERE, "START_UP_SERVER_FAILED_MSG", new Object[] {e.getMessage()});
View Full Code Here

      listener = new SocketConnector();
    }
    listener.setHost(host);
    listener.setPort(port);
    server = new Server();
        BoundedThreadPool btp = new BoundedThreadPool();
        btp.setMaxThreads(getMaxThreads());
        server.setThreadPool(btp);
  }
View Full Code Here

        listener.setProtocol(protocol);
        listener.setSslKeyManagerFactoryAlgorithm(keyManagerFactoryAlgorithm);
        listener.setSslTrustManagerFactoryAlgorithm(trustManagerFactoryAlgorithm);
        listener.setKeystoreType(keyStoreType);
    server = new Server();
        BoundedThreadPool btp = new BoundedThreadPool();
        btp.setMaxThreads(getMaxThreads());
        server.setThreadPool(btp);
  }
View Full Code Here

            listener = new SocketConnector();
        }
        listener.setHost(host);
        listener.setPort(port);
        server = new Server();
        BoundedThreadPool btp = new BoundedThreadPool();
        btp.setMaxThreads(getMaxThreads());
        server.setThreadPool(btp);
    }
View Full Code Here

TOP

Related Classes of org.mortbay.thread.BoundedThreadPool

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.