Class ExecutorAllCompletionService

  • All Implemented Interfaces:
    java.util.concurrent.CompletionService<java.lang.Void>

    public class ExecutorAllCompletionService
    extends java.lang.Object
    implements java.util.concurrent.CompletionService<java.lang.Void>
    Exectues given tasks in provided executor.
    Author:
    Radim Vansa <rvansa@redhat.com>
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getCompletedTasks()  
      java.util.concurrent.ExecutionException getFirstException()  
      long getScheduledTasks()  
      boolean isAllCompleted()  
      boolean isExceptionThrown()  
      java.util.concurrent.Future<java.lang.Void> poll()  
      java.util.concurrent.Future<java.lang.Void> poll​(long timeout, java.util.concurrent.TimeUnit unit)  
      java.util.concurrent.Future<java.lang.Void> submit​(java.lang.Runnable task, java.lang.Void result)  
      java.util.concurrent.Future<java.lang.Void> submit​(java.util.concurrent.Callable<java.lang.Void> task)  
      java.util.concurrent.Future<java.lang.Void> take()  
      void waitUntilAllCompleted()  
      • Methods inherited from class java.lang.Object

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

      • ExecutorAllCompletionService

        public ExecutorAllCompletionService​(java.util.concurrent.Executor executor)
    • Method Detail

      • submit

        public java.util.concurrent.Future<java.lang.Void> submit​(java.util.concurrent.Callable<java.lang.Void> task)
        Specified by:
        submit in interface java.util.concurrent.CompletionService<java.lang.Void>
      • submit

        public java.util.concurrent.Future<java.lang.Void> submit​(java.lang.Runnable task,
                                                                  java.lang.Void result)
        Specified by:
        submit in interface java.util.concurrent.CompletionService<java.lang.Void>
      • isAllCompleted

        public boolean isAllCompleted()
        Returns:
        True if all currently scheduled tasks have already been completed, false otherwise;
      • getScheduledTasks

        public long getScheduledTasks()
      • getCompletedTasks

        public long getCompletedTasks()
      • waitUntilAllCompleted

        public void waitUntilAllCompleted()
      • isExceptionThrown

        public boolean isExceptionThrown()
      • getFirstException

        public java.util.concurrent.ExecutionException getFirstException()
      • take

        public java.util.concurrent.Future<java.lang.Void> take()
                                                         throws java.lang.InterruptedException
        Specified by:
        take in interface java.util.concurrent.CompletionService<java.lang.Void>
        Throws:
        java.lang.InterruptedException
      • poll

        public java.util.concurrent.Future<java.lang.Void> poll()
        Specified by:
        poll in interface java.util.concurrent.CompletionService<java.lang.Void>
      • poll

        public java.util.concurrent.Future<java.lang.Void> poll​(long timeout,
                                                                java.util.concurrent.TimeUnit unit)
                                                         throws java.lang.InterruptedException
        Specified by:
        poll in interface java.util.concurrent.CompletionService<java.lang.Void>
        Throws:
        java.lang.InterruptedException