Package org.mortbay.thread

Examples of org.mortbay.thread.QueuedThreadPool


    webServer.addConnector(listener);

    int maxThreads = conf.getInt(HTTP_MAX_THREADS, -1);
    // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
    // default value (currently 254).
    QueuedThreadPool threadPool = maxThreads == -1 ?
        new QueuedThreadPool() : new QueuedThreadPool(maxThreads);
    webServer.setThreadPool(threadPool);

    final String appDir = getWebAppsPath(name);
    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

                        }
                        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

  RSSServlet servlet;
   
  public MockRSSService(int docsPerFeed)
  {
    server = new Server(8189);
    server.setThreadPool(new QueuedThreadPool(35));
    servlet = new RSSServlet(docsPerFeed);
    Context asContext = new Context(server,"/rss",Context.SESSIONS);
    asContext.addServlet(new ServletHolder(servlet), "/gen.php");
  }
View Full Code Here

    webServer.addConnector(listener);

    int maxThreads = conf.getInt(HTTP_MAX_THREADS, -1);
    // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
    // default value (currently 250).
    QueuedThreadPool threadPool = maxThreads == -1 ?
        new QueuedThreadPool() : new QueuedThreadPool(maxThreads);
    threadPool.setDaemon(true);
    webServer.setThreadPool(threadPool);

    final String appDir = getWebAppsPath(name);
    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

    Preconditions.checkNotNull(webAppContext);

    int maxThreads = conf.getInt(HTTP_MAX_THREADS, -1);
    // If HTTP_MAX_THREADS is not configured, QueueThreadPool() will use the
    // default value (currently 250).
    QueuedThreadPool threadPool = maxThreads == -1 ? new QueuedThreadPool()
        : new QueuedThreadPool(maxThreads);
    threadPool.setDaemon(true);
    webServer.setThreadPool(threadPool);

    ContextHandlerCollection contexts = new ContextHandlerCollection();
    RequestLog requestLog = HttpRequestLog.getRequestLog(name);
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

        http.setConnectorType(HttpClient.CONNECTOR_SELECT_CHANNEL);
        // http.setConnectorType(HttpClient.CONNECTOR_SOCKET);
        http.setMaxConnectionsPerAddress(20000);

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

    }
View Full Code Here

     * @param synchronous True if message delivery will be synchronized on the client.
     */
    public BayeuxService(Bayeux bayeux,String name, int maxThreads, boolean synchronous)
    {
        if (maxThreads>0)
            setThreadPool(new QueuedThreadPool(maxThreads));
        _name=name;
        _bayeux=bayeux;
        _client=_bayeux.newClient(name);
        _listener=(synchronous)?new SyncListen():new  AsyncListen();
        _client.addListener(_listener);
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.