Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.ThreadFactory


        return clockDaemon;
    }

    public void doStart() throws Exception {
        clockDaemon = new ClockDaemon();
        clockDaemon.setThreadFactory(new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r, poolName + " ");
                t.setDaemon(true);
                return t;
            }
View Full Code Here


   {
      PooledExecutor threadPool = new PooledExecutor(max_pool);
      threadPool.waitWhenBlocked();
      threadPool.setMinimumPoolSize(1);
      threadPool.setKeepAliveTime(pool_thread_keep_alive);
      threadPool.setThreadFactory(new ThreadFactory()
      {

         public Thread newThread(final Runnable command)
         {
            synchronized (poolLock)
View Full Code Here

        Properties      tmp=new Properties();

        if(output != null)
            this.output=new FileWriter(output, false);

        response_sender.setThreadFactory(new ThreadFactory() {
            public Thread newThread(Runnable runnable) {
                return new Thread(runnable, "Test.ResponseSender");
            }
        });
View Full Code Here

      long keepAlive = 30*1000;
        PooledExecutor executor = new PooledExecutor(5);
        executor.setMinimumPoolSize(1);
        executor.waitWhenBlocked();
        executor.setKeepAliveTime(keepAlive);
        executor.setThreadFactory(new ThreadFactory() {
            public Thread newThread(final Runnable command) {
              synchronized (poolLock) {
                    count++;
                }
                return new Thread("poolid=" +count) {
View Full Code Here

        return clockDaemon;
    }

    public void doStart() throws Exception {
        clockDaemon = new ClockDaemon();
        clockDaemon.setThreadFactory(new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r, poolName + " ");
                t.setDaemon(true);
                return t;
            }
View Full Code Here

    * @param threadGroup threadGroup
    */
   public BasicThreadPool(String name, ThreadGroup threadGroup)
   {
      trace = log.isTraceEnabled();
      ThreadFactory factory = new ThreadPoolThreadFactory();

      queue = new BoundedLinkedQueue(1024);

      executor = new MinPooledExecutor(queue, 100);
      executor.setMinimumPoolSize(100);
View Full Code Here

    * @param threadGroup threadGroup
    */
   public BasicThreadPool(String name, ThreadGroup threadGroup)
   {
      trace = log.isTraceEnabled();
      ThreadFactory factory = new ThreadPoolThreadFactory();

      queue = new BoundedLinkedQueue(1024);

      executor = new MinPooledExecutor(queue, 100);
      executor.setMinimumPoolSize(4);
View Full Code Here

     */
    private synchronized void startReaper() {
        if (_daemon == null) {
            _daemon = new ClockDaemon();
            if (_idlePeriod > 0) {
                _daemon.setThreadFactory(new ThreadFactory() {
                    public Thread newThread(Runnable command) {
                        Thread thread = new Thread(command, "Reaper");
                        thread.setDaemon(true);
                        return thread;
                    }
View Full Code Here

        return clockDaemon;
    }

    public void doStart() throws Exception {
        clockDaemon = new ClockDaemon();
        clockDaemon.setThreadFactory(new ThreadFactory() {
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r, poolName + " ");
                t.setDaemon(true);
                return t;
            }
View Full Code Here

        final int maxPoolSize = Math.max(( m_processors * m_threadsPerProcessor ) + 1, m_processors + 1);
        m_threadPool = new PooledExecutor( m_processors + 1 );
        m_threadPool.setMinimumPoolSize( 2 ); // at least two threads
        m_threadPool.setMaximumPoolSize( maxPoolSize );
        m_threadPool.waitWhenBlocked();
        m_threadPool.setThreadFactory( new ThreadFactory() {
            public Thread newThread(Runnable run) {
                Thread newThread = new Thread(run);

                newThread.setDaemon( true );
                newThread.setPriority( Thread.MIN_PRIORITY );
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.ThreadFactory

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.