ee.telekom.workflow.util.ExecutorServiceUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of workflow-engine Show documentation
Show all versions of workflow-engine Show documentation
Telekom-workflow-engine core provides the runtime environment for workflow execution together with all the supporting services (clustering, persistence, error handling etc).
package ee.telekom.workflow.util;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
public class ExecutorServiceUtil{
public static void shutDownSynchronously( ExecutorService executorService ){
if( executorService != null ){
executorService.shutdown();
while( !executorService.isTerminated() ){
try{
executorService.awaitTermination( 1, TimeUnit.MINUTES );
}
catch( InterruptedException e ){
// Do not return on interrupts, but wait until all submitted tasks are completed.
}
}
}
}
}