Examples of ThreadPool


Examples of anvil.java.lang.ThreadPool

  {
    context.checkAccess(AnyThreadPool.CAN_USE);
    if (name == null) {
      name = "Pool";
    }
    ThreadPool pool = new ThreadPool(name);
    if (threads > 0) {
      pool.setMaxThreads(threads);
    }
    if (tasks > 0) {
      pool.setMaxTasks(tasks);
    }   
    return new AnyThreadPool(pool);
  }
View Full Code Here

Examples of com.avaje.ebeaninternal.server.lib.thread.ThreadPool

    int shutdownSecs = GlobalProperties.getInt("backgroundExecutor.shutdownSecs", 30);

    boolean useTrad = GlobalProperties.getBoolean("backgroundExecutor.traditional", true);
    if (useTrad) {
      // this pool will use Idle seconds to maintain the thread count between min and max
      ThreadPool pool = new ThreadPool(namePrefix, true, null, minPoolSize, maxPoolSize, idleSecs*1000);
      return new TraditionalBackgroundExecutor(pool, schedulePoolSize, shutdownSecs, namePrefix);
    } else {
      return new DefaultBackgroundExecutor(schedulePoolSize, maxPoolSize, idleSecs, shutdownSecs, namePrefix);
    }
  }
View Full Code Here

Examples of com.caucho.env.thread.ThreadPool

      } finally {
        thread.setContextClassLoader(oldLoader);
        _thread = null;
        _isDone = true;

        ThreadPool threadPool = _threadPool;
       
        if (threadPool != null)
          threadPool.completeExecutorTask();

        // alarm

        removeFuture(this);
View Full Code Here

Examples of com.caucho.env.thread.ThreadPool

        && _threadExecutorTaskMax > 0
        && _threadMax < _threadExecutorTaskMax)
      throw new ConfigException(L.l("<thread-executor-task-max> ({0}) must be less than <thread-max> ({1})",
                                    _threadExecutorTaskMax, _threadMax));

    ThreadPool threadPool = ThreadPool.getThreadPool();

    if (_threadMax > 0)
      threadPool.setThreadMax(_threadMax);

    if (_threadIdleMin > 0)
      threadPool.setIdleMin(_threadIdleMin);
   
    if (_threadIdleTimeout > 0)
      threadPool.setIdleTimeout(_threadIdleTimeout);

    threadPool.setExecutorTaskMax(_threadExecutorTaskMax);
   
    /*
    if (_keepaliveSelectEnable) {
      try {
        Class<?> cl = Class.forName("com.caucho.server.connection.JniSelectManager");
View Full Code Here

Examples of com.caucho.util.ThreadPool

        && _threadExecutorTaskMax > 0
        && _threadMax < _threadExecutorTaskMax)
      throw new ConfigException(L.l("<thread-executor-task-max> ({0}) must be less than <thread-max> ({1})",
                                    _threadExecutorTaskMax, _threadMax));

    ThreadPool threadPool = ThreadPool.getThreadPool();

    if (_threadMax > 0)
      threadPool.setThreadMax(_threadMax);

    if (_threadIdleMax > 0)
      threadPool.setThreadIdleMax(_threadIdleMax);

    if (_threadIdleMin > 0)
      threadPool.setThreadIdleMin(_threadIdleMin);

    threadPool.setExecutorTaskMax(_threadExecutorTaskMax);

    /*
    if (_keepaliveSelectEnable) {
      try {
        Class<?> cl = Class.forName("com.caucho.server.connection.JniSelectManager");
View Full Code Here

Examples of com.google.enterprise.connector.instantiator.ThreadPool

        PusherFactory pusherFactory =
            new DocPusherFactory(new MockFileFeedConnection(out));

        MockInstantiator instantiator =
            new MockInstantiator(new ThreadPool(300, new SystemClock()));

        Traverser traverser = new QueryTraverser(pusherFactory, qtm,
            instantiator.getTraversalStateStore(connectorName),
            connectorName, null, new SystemClock());
View Full Code Here

Examples of com.googlecode.psiprobe.model.ThreadPool

        MBeanServer server = getContainerWrapper().getResourceResolver().getMBeanServer();

        for (Iterator it = executorNames.iterator(); it.hasNext();) {
            ObjectName executorName = (ObjectName) it.next();

            ThreadPool threadPool = new ThreadPool();
            threadPool.setName(executorName.getKeyProperty("name"));
            threadPool.setMaxThreads(JmxTools.getIntAttr(server, executorName, "maxThreads"));
            threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, executorName, "largestPoolSize"));
            threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, executorName, "minSpareThreads"));
            threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, executorName, "activeCount"));
            threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, executorName, "poolSize"));

            threadPools.add(threadPool);
        }

        for (Iterator it = poolNames.iterator(); it.hasNext();) {

            ThreadPoolObjectName threadPoolObjectName = (ThreadPoolObjectName) it.next();
            try {
                ObjectName poolName = threadPoolObjectName.getThreadPoolName();

                ThreadPool threadPool = new ThreadPool();
                threadPool.setName(poolName.getKeyProperty("name"));
                threadPool.setMaxThreads(JmxTools.getIntAttr(server, poolName, "maxThreads"));

                if (JmxTools.hasAttribute(server, poolName, "maxSpareThreads")) {
                    threadPool.setMaxSpareThreads(JmxTools.getIntAttr(server, poolName, "maxSpareThreads"));
                    threadPool.setMinSpareThreads(JmxTools.getIntAttr(server, poolName, "minSpareThreads"));
                }

                threadPool.setCurrentThreadsBusy(JmxTools.getIntAttr(server, poolName, "currentThreadsBusy"));
                threadPool.setCurrentThreadCount(JmxTools.getIntAttr(server, poolName, "currentThreadCount"));

                // Tomcat 6.0.21+ will return -1 for maxThreads if the connector uses an executor for its threads.
                // In this case, don't add its ThreadPool to the results.
                if (threadPool.getMaxThreads() > -1) {
                    threadPools.add(threadPool);
                }
            } catch (InstanceNotFoundException e) {
                logger.error("Failed to query entire thread pool " + threadPoolObjectName);
                logger.debug(e);
View Full Code Here

Examples of com.icegreen.greenmail.util.ThreadPool

            workers[i] = new SmtpThreadPoolWorker(new SmtpHandler(new SmtpCommandRegistry(),
                managers.getSmtpManager(), new InMemoryWorkspace()));
            workers[i].setName(this.getProtocol() + " Thread Pool Worker " + i);
        }

        threadPool = new ThreadPool(workers);
    }
View Full Code Here

Examples of com.sun.corba.ee.spi.orbutil.threadpool.ThreadPool

        ThreadPoolWork work = new ThreadPoolWork(classLoader, target);

        try {
            ThreadPoolManager threadpoolMgr =
                S1ASThreadPoolManager.getThreadPoolManager();
            ThreadPool threadpool = threadpoolMgr.getDefaultThreadPool();
            threadpool.getAnyWorkQueue().addWork(work);
        } catch (Throwable th) {
            String errMsg =  "Error while adding work to orb threadpool. "
                + "Hence doing it in current thread";
            _ejbLogger.log(Level.WARNING, errMsg, th);
            work.doWork();
View Full Code Here

Examples of com.sun.corba.ee.spi.threadpool.ThreadPool

        }
*/

        // Mutiplied the idleTimeoutInSeconds by 1000 to convert to milliseconds
        ThreadPoolFactory threadPoolFactory = new ThreadPoolFactory();
        ThreadPool threadpool =
                threadPoolFactory.create(minThreads, maxThreads,
                        idleTimeoutInSeconds * 1000L, threadpoolId,
                        _iiopUtils.getCommonClassLoader());

        // Add the threadpool instance to the threadpoolList
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.