final TimerExecutor te = systemInstance.getComponent(TimerExecutor.class);
if (te != null) {
if (te.executor == executor) {
if (te.decr()) {
doShutdownExecutor(waitForJobsToComplete);
systemInstance.removeComponent(TimerExecutor.class);
} else { // flush jobs, maybe not all dedicated to this threadpool if shared but shouldn't be an issue
final ThreadPoolExecutor tpe = ThreadPoolExecutor.class.cast(executor);
if (waitForJobsToComplete) {
final Collection<Runnable> jobs = new ArrayList<>();
tpe.getQueue().drainTo(jobs);