Package org.jgroups.util

Examples of org.jgroups.util.DefaultThreadFactory


          : "list A=" + list_a + "\nlist B=" + list_b;
    }


    protected TCPConnectionMap createConnectionMap(InetAddress bind_addr, int port) throws Exception {
        return new TCPConnectionMap("conn", new DefaultThreadFactory("ConnectionMapTest", true, true),
                                    new DefaultSocketFactory(), null, bind_addr, null, 0, port,port);
    }
View Full Code Here


            public Object down(Event evt) {
                return null;
            }

            public ThreadFactory getThreadFactory() {
                return new DefaultThreadFactory("foo",false,true);
            }
        });

        start=System.currentTimeMillis();
        ver.up(new Event(Event.SUSPECT, a));
View Full Code Here

        }
    }

    protected static class NoopProtocol extends Protocol {
        public Object down(Event evt) {return null;}
        public ThreadFactory getThreadFactory() {return new DefaultThreadFactory("y",false,true);}
View Full Code Here

   private void fixProtocolThreadFactories(TP tp, ThreadDecoratorImpl threadDecorator)
   {
      ThreadFactory stackFactory = tp.getThreadFactory();
      if (stackFactory == null)
      {
         stackFactory = new DefaultThreadFactory(Util.getGlobalThreadGroup(), "", false);
         tp.setThreadFactory(stackFactory);
      }
      fixThreadManager(stackFactory, threadDecorator, "TP.getThreadFactory()");
     
      log.debug("Fixed thread factory for " + tp);
     
      ThreadFactory timerFactory = tp.getTimerThreadFactory();
      if (timerFactory == null)
      {
         timerFactory = new LazyThreadFactory(Util.getGlobalThreadGroup(), "Timer", true, true);
         tp.setTimerThreadFactory(timerFactory);           
      }
      fixThreadManager(timerFactory, threadDecorator, "TP.getTimerThreadFactory()");
     
      log.debug("Fixed timer thread factory for " + tp);
     
      ThreadGroup pool_thread_group = null;
      if (tp.isDefaulThreadPoolEnabled())
      {
         ThreadFactory defaultPoolFactory = tp.getDefaultThreadPoolThreadFactory();
         if (defaultPoolFactory == null)
         {
            pool_thread_group=new ThreadGroup(Util.getGlobalThreadGroup(), "Thread Pools");
            defaultPoolFactory = new DefaultThreadFactory(pool_thread_group, "Incoming", false, true);
            tp.setThreadFactory(defaultPoolFactory);
         }
         fixThreadManager(defaultPoolFactory, threadDecorator, "TP.getDefaultThreadPoolThreadFactory()");
        
         log.debug("Fixed default pool thread factory for " + tp);
      }
     
      if (tp.isOOBThreadPoolEnabled())
      {
         ThreadFactory oobPoolFactory = tp.getOOBThreadPoolThreadFactory();
         if (oobPoolFactory == null)
         {
            if (pool_thread_group == null)
               pool_thread_group=new ThreadGroup(Util.getGlobalThreadGroup(), "Thread Pools");
            oobPoolFactory = new DefaultThreadFactory(pool_thread_group, "OOB", false, true);
            tp.setThreadFactory(oobPoolFactory);
         }
         fixThreadManager(oobPoolFactory, threadDecorator, "TP.getOOBThreadPoolThreadFactory()");
        
         log.debug("Fixed oob pool thread factory for " + tp);
View Full Code Here

TOP

Related Classes of org.jgroups.util.DefaultThreadFactory

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.