Class SerialExecutor

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class SerialExecutor
    extends java.lang.Object
    implements java.lang.AutoCloseable
    Will execute a set of tasks in order of submit.
    • Constructor Summary

      Constructors 
      Constructor Description
      SerialExecutor​(java.util.concurrent.Executor executor)
      The executor to use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      void run​(java.lang.Runnable runnable)
      Run the runnable in order of submission.
      <T> org.osgi.util.promise.Promise<T> submit​(java.util.concurrent.Callable<T> callable)
      Run serial in order of submission and return a promise
      • Methods inherited from class java.lang.Object

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

      • SerialExecutor

        public SerialExecutor​(java.util.concurrent.Executor executor)
        The executor to use.
        Parameters:
        executor -
    • Method Detail

      • submit

        public <T> org.osgi.util.promise.Promise<T> submit​(java.util.concurrent.Callable<T> callable)
        Run serial in order of submission and return a promise
        Type Parameters:
        T - the return type
        Parameters:
        callable - the callable providing the data
        Returns:
        the promise
      • run

        public void run​(java.lang.Runnable runnable)
        Run the runnable in order of submission.
        Parameters:
        runnable - the runnable
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable