Package org.eclipse.jetty.util.thread

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


        CertificateManager.addListener(certificateListener);

        adminPort = JiveGlobals.getXMLProperty("adminConsole.port", 9090);
        adminSecurePort = JiveGlobals.getXMLProperty("adminConsole.securePort", 9091);
        adminServer = new Server();
        final QueuedThreadPool tp = new QueuedThreadPool(254);
        tp.setName("Jetty-QTP-AdminConsole");
        adminServer.setThreadPool(tp);
       
        // Do not send Jetty info in HTTP headers
        adminServer.setSendServerVersion(false);
View Full Code Here


     * @param port the port to start the normal (unsecured) HTTP Bind service on.
     * @param securePort the port to start the TLS (secure) HTTP Bind service on.
     */
    private synchronized void configureHttpBindServer(int port, int securePort) {
        httpBindServer = new Server();
        final QueuedThreadPool tp = new QueuedThreadPool(254);
        tp.setName("Jetty-QTP-BOSH");
        httpBindServer.setThreadPool(tp);
       
        createConnector(port);
        createSSLConnector(securePort);
        if (httpConnector == null && httpsConnector == null) {
View Full Code Here

            httpClient.setProxy(new Address(host, port));
        }

        // use QueueThreadPool as the default bounded is deprecated (see SMXCOMP-157)
        if (getHttpClientThreadPool() == null) {
            QueuedThreadPool qtp = new QueuedThreadPool();
            if (httpClientMinThreads != null) {
                qtp.setMinThreads(httpClientMinThreads.intValue());
            }
            if (httpClientMaxThreads != null) {
                qtp.setMaxThreads(httpClientMaxThreads.intValue());
            }
            // let the thread names indicate they are from the client
            qtp.setName("CamelJettyClient(" + ObjectHelper.getIdentityHashCode(httpClient) + ")");
            try {
                qtp.start();
            } catch (Exception e) {
                throw new RuntimeCamelException("Error starting JettyHttpClient thread pool: " + qtp, e);
            }
            setHttpClientThreadPool(qtp);
        }
View Full Code Here

        // configure thread pool if min/max given
        if (minThreads != null || maxThreads != null) {
            if (getThreadPool() != null) {
                throw new IllegalArgumentException("You cannot configure both minThreads/maxThreads and a custom threadPool on JettyHttpComponent: " + this);
            }
            QueuedThreadPool qtp = new QueuedThreadPool();
            if (minThreads != null) {
                qtp.setMinThreads(minThreads.intValue());
            }
            if (maxThreads != null) {
                qtp.setMaxThreads(maxThreads.intValue());
            }
            // let the thread names indicate they are from the server
            qtp.setName("CamelJettyServer(" + ObjectHelper.getIdentityHashCode(server) + ")");
            try {
                qtp.start();
            } catch (Exception e) {
                throw new RuntimeCamelException("Error starting JettyServer thread pool: " + qtp, e);
            }
            server.setThreadPool(qtp);
        }
View Full Code Here

          "org.apache.ambari.server.resources.api.rest");
      root.addServlet(resources, "/resources/*");
      resources.setInitOrder(6);

      //Set jetty thread pool
      serverForAgent.setThreadPool(new QueuedThreadPool(25));
      server.setThreadPool(new QueuedThreadPool(25));

      /* Configure the API server to use the NIO connectors */
      SelectChannelConnector apiConnector;

      if (configs.getApiSSLAuthentication()) {
View Full Code Here

            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

          "true");
      root.addServlet(resources, "/resources/*");
      resources.setInitOrder(6);

      //Set jetty thread pool
      serverForAgent.setThreadPool(new QueuedThreadPool(25));
      server.setThreadPool(new QueuedThreadPool(25));

      /* Configure the API server to use the NIO connectors */
      SelectChannelConnector apiConnector;

      if (configs.getApiSSLAuthentication()) {
View Full Code Here

                httpClient.setProxy(new Address(host, port));
            }

            // use QueueThreadPool as the default bounded is deprecated (see SMXCOMP-157)
            if (getHttpClientThreadPool() == null) {
                QueuedThreadPool qtp = new QueuedThreadPool();
                if (httpClientMinThreads != null) {
                    qtp.setMinThreads(httpClientMinThreads.intValue());
                }
                if (httpClientMaxThreads != null) {
                    qtp.setMaxThreads(httpClientMaxThreads.intValue());
                }
                try {
                    qtp.start();
                } catch (Exception e) {
                    throw new RuntimeCamelException("Error starting JettyHttpClient thread pool: " + qtp, e);
                }
                setHttpClientThreadPool(qtp);
            }
View Full Code Here

            httpClient.setProxy(new Address(host, port));
        }

        // use QueueThreadPool as the default bounded is deprecated (see SMXCOMP-157)
        if (getHttpClientThreadPool() == null) {
            QueuedThreadPool qtp = new QueuedThreadPool();
            if (httpClientMinThreads != null) {
                qtp.setMinThreads(httpClientMinThreads.intValue());
            }
            if (httpClientMaxThreads != null) {
                qtp.setMaxThreads(httpClientMaxThreads.intValue());
            }
            // let the thread names indicate they are from the client
            qtp.setName("CamelJettyClient(" + ObjectHelper.getIdentityHashCode(httpClient) + ")");
            try {
                qtp.start();
            } catch (Exception e) {
                throw new RuntimeCamelException("Error starting JettyHttpClient thread pool: " + qtp, e);
            }
            setHttpClientThreadPool(qtp);
        }
View Full Code Here

        // configure thread pool if min/max given
        if (minThreads != null || maxThreads != null) {
            if (getThreadPool() != null) {
                throw new IllegalArgumentException("You cannot configure both minThreads/maxThreads and a custom threadPool on JettyHttpComponent: " + this);
            }
            QueuedThreadPool qtp = new QueuedThreadPool();
            if (minThreads != null) {
                qtp.setMinThreads(minThreads.intValue());
            }
            if (maxThreads != null) {
                qtp.setMaxThreads(maxThreads.intValue());
            }
            // let the thread names indicate they are from the server
            qtp.setName("CamelJettyServer(" + ObjectHelper.getIdentityHashCode(server) + ")");
            try {
                qtp.start();
            } catch (Exception e) {
                throw new RuntimeCamelException("Error starting JettyServer thread pool: " + qtp, e);
            }
            server.setThreadPool(qtp);
        }
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.util.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.