<commit_before>package com.pearson.statsagg.utilities;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <NAME>
 */
public abstract class InvokerThread implements Runnable {
    
    private static final Logger logger = LoggerFactory.getLogger(InvokerThread.class.getName());
    
    protected boolean continueRunning_ = true;
    protected boolean isShutdown_ = false;
    protected ExecutorService threadExecutor_ = Executors.newCachedThreadPool();

    protected final Object lockObject_ = new Object();
    
    @Override
    public void run() {}

    public void shutdown() {

        continueRunning_ = false;

        if (threadExecutor_ == null) {
            return;
        }

        try {
            synchronized (lockObject_) {
                lockObject_.notifyAll();
            }
            
            Threads.shutdownThreadExecutor(threadExecutor_, getThreadExecutorShutdownWaitTime(), TimeUnit.MILLISECONDS, true, false);
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }
    }

    public boolean continueRunning() {
        return continueRunning_;
    }

    public void setContinueRunning(boolean continueRunning) {
        continueRunning_ = continueRunning;
    }
    
    public boolean isShutdown() {
        return isShutdown_;
    }
    
    public abstract long getThreadExecutorShutdownWaitTime();
    
}<commit_msg>expose a public method for getThreadExecutorService<commit_after>package com.pearson.statsagg.utilities;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author <NAME>
 */
public abstract class InvokerThread implements Runnable {
    
    private static final Logger logger = LoggerFactory.getLogger(InvokerThread.class.getName());
    
    protected boolean continueRunning_ = true;
    protected boolean isShutdown_ = false;
    protected ExecutorService threadExecutor_ = Executors.newCachedThreadPool();

    protected final Object lockObject_ = new Object();
    
    @Override
    public void run() {}

    public void shutdown() {

        continueRunning_ = false;

        if (threadExecutor_ == null) {
            return;
        }

        try {
            synchronized (lockObject_) {
                lockObject_.notifyAll();
            }
            
            Threads.shutdownThreadExecutor(threadExecutor_, getThreadExecutorShutdownWaitTime(), TimeUnit.MILLISECONDS, true, false);
        }
        catch (Exception e) {
            logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e));
        }
    }

    public boolean continueRunning() {
        return continueRunning_;
    }

    public void setContinueRunning(boolean continueRunning) {
        continueRunning_ = continueRunning;
    }
    
    public boolean isShutdown() {
        return isShutdown_;
    }
    
    public ExecutorService getThreadExecutorService() {
        return threadExecutor_;
    }
    
    public abstract long getThreadExecutorShutdownWaitTime();
    
}
{'fraction_non_alphanumeric': 0.08231068542352589, 'fraction_numerical': 0.001197246333433104, 'mean_word_length': 2.7720090293453725, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '137584', 'n_tokens_mistral': 875, 'n_tokens_neox': 855, 'n_words': 194}