Examples of QueuedThreadPool


Examples of com.facebook.presto.jdbc.internal.jetty.util.thread.QueuedThreadPool

        String name = HttpClient.class.getSimpleName() + "@" + hashCode();

        if (executor == null)
        {
            QueuedThreadPool threadPool = new QueuedThreadPool();
            threadPool.setName(name);
            executor = threadPool;
        }
        addBean(executor);

        if (byteBufferPool == null)
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

  @Before
  public void setUp() throws Exception
  {
    _connector = new UdpConnector();
    _connector.setPort(5040);
    _connector.setThreadPool(new QueuedThreadPool());
    _connector.setHandler(new TestHandler());
    _connector.start();
    _message = null;
  }
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

  public void testLifeCycle() throws Exception
  {
    UdpConnector connector = new UdpConnector();
    connector.setHost("localhost");
    connector.setPort(5070);
    connector.setThreadPool(new QueuedThreadPool());
    for (int i = 0; i < 10; i++)
    {
      connector.start();
      assertTrue(connector.isRunning());
      connector.stop();
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

  private UdpConnector connector;
 
  protected void doStart() throws Exception
  {
    connector = new UdpConnector();
    connector.setThreadPool(new QueuedThreadPool());
    //connector.setHandler(this);
    connector.start();
  }
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

  @Before
  public void setUp()
  {
    _connectorManager = new ConnectorManager();
    Server server = new Server();
    server.setSipThreadPool(new QueuedThreadPool(255));
    _connectorManager.setServer(server);
  }
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

    Log.info("cipango-" + __sipVersion);

    MultiException mex = new MultiException();
   
    if (_sipThreadPool == null)
      setSipThreadPool(new QueuedThreadPool());
   
    if (_sessionManager == null)
      setSessionManager(new SessionManager());
   
    try
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

  protected void doStart() throws Exception
  {
    _connections = new HashMap<String, TcpConnection>();
   
        if (_tcpThreadPool == null)
          _tcpThreadPool = new QueuedThreadPool();
       
    if (_tcpThreadPool instanceof LifeCycle)
      ((LifeCycle) _tcpThreadPool).start();
   
    super.doStart();
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

            ThreadPool pool = aconn.getThreadPool();
            if (pool == null) {
                pool = aconn.getServer().getThreadPool();
            }
            if (pool == null) {
                pool = new QueuedThreadPool();
                aconn.getServer().setThreadPool(pool);
                aconn.setThreadPool(pool);
            }
            //threads for the acceptors and selectors are taken from
            //the pool so we need to have room for those
            int acc = aconn.getAcceptors() * 2;
            if (getThreadingParameters().isSetMaxThreads()
                && getThreadingParameters().getMaxThreads() <= acc) {
                throw new Fault(new Message("NOT_ENOUGH_THREADS", LOG,
                                            port,
                                            acc + 1,
                                            getThreadingParameters().getMaxThreads(),
                                            acc));
            }
            if (pool instanceof QueuedThreadPool) {
                QueuedThreadPool pl = (QueuedThreadPool)pool;
                if (getThreadingParameters().isSetMinThreads()) {
                    pl.setMinThreads(getThreadingParameters().getMinThreads());
                }
                if (getThreadingParameters().isSetMaxThreads()) {
                    pl.setMaxThreads(getThreadingParameters().getMaxThreads());
                }
            } else {
                try {
                    if (getThreadingParameters().isSetMinThreads()) {
                        pool.getClass().getMethod("setMinThreads", Integer.TYPE)
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

   
    @Override
    protected void doStart() throws Exception {
        if (getThreadPool() == null) {
            // if there is no thread pool then create a default thread pool using daemon threads
            QueuedThreadPool qtp = new QueuedThreadPool();
            // 16 max threads is the default in the http client
            qtp.setMaxThreads(16);
            qtp.setDaemon(true);
            // let the thread names indicate they are from the client
            qtp.setName("CamelJettyClient(" + ObjectHelper.getIdentityHashCode(this) + ")");
            setThreadPool(qtp);
        }
        if (isSupportRedirect()) {
            // setup the listener for it
            this.registerListener(CamelRedirectListener.class.getName());
View Full Code Here

Examples of org.eclipse.jetty.util.thread.QueuedThreadPool

            if (minThreads == null || maxThreads == null) {
                throw new IllegalArgumentException("Both min and max thread pool sizes must be provided.");
            }

            // use QueueThreadPool as the default bounded is deprecated (see SMXCOMP-157)
            QueuedThreadPool qtp = new QueuedThreadPool();
            qtp.setMinThreads(minThreads.intValue());
            qtp.setMaxThreads(maxThreads.intValue());
            // and we want to use daemon threads
            qtp.setDaemon(true);
            // let the thread names indicate they are from the client
            qtp.setName("CamelJettyClient(" + ObjectHelper.getIdentityHashCode(httpClient) + ")");
            httpClient.setThreadPool(qtp);
        }
       
        if (LOG.isDebugEnabled()) {
            if (minThreads != null) {
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.