All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.payneteasy.mysql.scheduler.util.ExecutorServiceUtils Maven / Gradle / Ivy

package com.payneteasy.mysql.scheduler.util;

import com.payneteasy.mysql.scheduler.SchedulerConfig;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;

public class ExecutorServiceUtils {

    private static final Logger LOG = LoggerFactory.getLogger(ExecutorServiceUtils.class);

    public static void shutdownAndAwaitTermination(ExecutorService aExecutor, String aExecutorName) throws InterruptedException {
        LOG.info("{}: Stopping executor ...", aExecutorName);

        aExecutor.shutdown();
        final int WAIT_COUNT = SchedulerConfig.getIntConfig(SchedulerConfig.Config.WAIT_SHUTDOWN_SECONDS);
        final int INCREMENT = 10;
        for(int i=0; i




© 2015 - 2024 Weber Informatics LLC | Privacy Policy