Package org.jboss.messaging.util

Examples of org.jboss.messaging.util.CompatibleExecutor


   }

   public void testExecutionOrder()
   {
      OrderedExecutorFactory factory = new OrderedExecutorFactory(Executors.newCachedThreadPool(new JBMThreadFactory("test-thread-factory")));
      CompatibleExecutor executor = factory.getExecutor("test executor");

      final int numTasks = 200000;

      CounterRunnable[] tasks = new CounterRunnable[numTasks];

      for (int i = 0; i < numTasks; ++i)
      {
         tasks[i] = new CounterRunnable(this);
      }
      exeQueue.clear();
      for (int i = 0; i < numTasks; ++i)
      {
         executor.execute(tasks[i]);
      }

      executor.shutdownAfterProcessingCurrentlyQueuedTasks();
      assertTrue(exeQueue.size() == numTasks);

      for (int i = 0; i < numTasks; ++i)
      {
         CounterRunnable finTask = exeQueue.get(i);
View Full Code Here

TOP

Related Classes of org.jboss.messaging.util.CompatibleExecutor

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.