Class ExecutorsManager


  • public class ExecutorsManager
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.concurrent.ExecutorService battle  
      static java.util.concurrent.ExecutorService main  
    • Method Summary

      Modifier and Type Method Description
      static java.util.concurrent.Future<?> execute​(java.lang.Runnable r)
      Submit a task to the thread pool
      static <T> java.util.concurrent.Future<T> execute​(java.util.concurrent.Callable<T> r)  
      static java.util.concurrent.ScheduledFuture<?> schedule​(java.lang.Runnable r, long delay, java.util.concurrent.TimeUnit tu)
      Execute a task after some time
      static java.util.concurrent.ScheduledFuture<?> schedule​(java.util.concurrent.ExecutorService es, java.lang.Runnable r, long delay, java.util.concurrent.TimeUnit tu)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • main

        public static final java.util.concurrent.ExecutorService main
      • battle

        public static final java.util.concurrent.ExecutorService battle
    • Constructor Detail

      • ExecutorsManager

        public ExecutorsManager()
    • Method Detail

      • execute

        public static java.util.concurrent.Future<?> execute​(java.lang.Runnable r)
        Submit a task to the thread pool
        Parameters:
        r - task object
        Returns:
        future object
      • execute

        public static <T> java.util.concurrent.Future<T> execute​(java.util.concurrent.Callable<T> r)
      • schedule

        public static java.util.concurrent.ScheduledFuture<?> schedule​(java.lang.Runnable r,
                                                                       long delay,
                                                                       java.util.concurrent.TimeUnit tu)
        Execute a task after some time
        Parameters:
        r - task object
        delay - delay time
        tu - time unit
        Returns:
        future object
      • schedule

        public static java.util.concurrent.ScheduledFuture<?> schedule​(java.util.concurrent.ExecutorService es,
                                                                       java.lang.Runnable r,
                                                                       long delay,
                                                                       java.util.concurrent.TimeUnit tu)