Search in sources :

Example 1 with ThreadFactory

use of io.fabric8.utils.ThreadFactory in project fabric8 by jboss-fuse.

the class MavenDownloadProxyServlet method start.

@Override
public synchronized void start() throws IOException {
    // Create a thread pool with the given maxmimum number of threads
    // All threads will time out after 60 seconds
    int nbThreads = threadMaximumPoolSize > 0 ? threadMaximumPoolSize : 8;
    executorService = new ThreadPoolExecutor(0, nbThreads, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(), new ThreadFactory("MavenDownloadProxyServlet"));
    if (this.timeout <= 0) {
        // default
        this.timeout = 5000;
    }
    LOGGER.info("Starting maven download servlet. Using async timeout value: " + this.timeout + "ms");
    super.start();
}
Also used : ThreadFactory(io.fabric8.utils.ThreadFactory) ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) LinkedBlockingQueue(java.util.concurrent.LinkedBlockingQueue)

Aggregations

ThreadFactory (io.fabric8.utils.ThreadFactory)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1