Package org.mortbay.thread

Examples of org.mortbay.thread.QueuedThreadPool


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


                        }
                        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

        _httpClient.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
        // http.setConnectorType(HttpClient.CONNECTOR_SOCKET);
        _httpClient.setMaxConnectionsPerAddress(40000);

        QueuedThreadPool pool = new QueuedThreadPool();
        pool.setMaxThreads(500);
        pool.setDaemon(true);
        _httpClient.setThreadPool(pool);
        _httpClient.start();

    }
View Full Code Here

    
        String base="../../..";
       
        // Manually contruct context to avoid hassles with webapp classloaders for now.
        Server server = new Server();
        QueuedThreadPool qtp = new QueuedThreadPool();
        qtp.setMinThreads(5);
        qtp.setMaxThreads(200);
        server.setThreadPool(qtp);
       
        SelectChannelConnector connector=new SelectChannelConnector();
        // SocketConnector connector=new SocketConnector();
        connector.setPort(port);
View Full Code Here

                        }
                        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

            catch (Throwable e) {mex.add(e);}
        }
       
        if (_threadPool==null)
        {
            QueuedThreadPool tp=new QueuedThreadPool();
            setThreadPool(tp);
        }
       
        if (_sessionIdManager!=null)
            _sessionIdManager.start();
View Full Code Here

    listener = createBaseListener(conf);
    listener.setHost(bindAddress);
    listener.setPort(port);
    webServer.addConnector(listener);

    webServer.setThreadPool(new QueuedThreadPool());

    final String appDir = getWebAppsPath();
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    webServer.setHandler(contexts);
View Full Code Here

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

    {
      log.error("defaulting max.ideltime to 2000");
      maxIdleTime=2000;
    }
   
    QueuedThreadPool threadPool = new QueuedThreadPool();
    threadPool.setName("server(jetty) threads");
    threadPool.setMinThreads(minThread);
    threadPool.setMaxThreads(maxThread);
    threadPool.setMaxIdleTimeMs(maxIdleTime);
    threadPool.start();
   
    log.info("request threadpool started.");
   
    final Server server = new Server();
    server.setThreadPool(threadPool);
View Full Code Here

      listener = connector;
    }
   
    webServer.addConnector(listener);

    webServer.setThreadPool(new QueuedThreadPool());

    final String appDir = getWebAppsPath();
    ContextHandlerCollection contexts = new ContextHandlerCollection();
    webServer.setHandler(contexts);
View Full Code Here

TOP

Related Classes of org.mortbay.thread.QueuedThreadPool

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.