/** * Release executor services managed by this instance if the condition passed in the parameter is fulfilled. * Executor services obtained via JNDI lookup won't be shut down. * * @param shutDownCondition condition that will be evaluated before executor services are released and they will be * released only if the condition is evaluated to {@code true}. The condition will be * evaluated in a synchronized block in order to make the process of its evaluation * and executor services release an atomic operation. */ protected void shutdown(ShutDownCondition shutDownCondition) { synchronized (EXECUTORS_CLEAN_UP_LOCK) { if (shutDownCondition.evaluate()) { shutdown(); } } }
/** * Release executor services managed by this instance if the condition passed in the parameter is fulfilled. * Executor services obtained via JNDI lookup won't be shut down. * * @param shutDownCondition condition that will be evaluated before executor services are released and they will be * released only if the condition is evaluated to {@code true}. The condition will be * evaluated in a synchronized block in order to make the process of its evaluation * and executor services release an atomic operation. */ protected void shutdown(ShutDownCondition shutDownCondition) { synchronized (EXECUTORS_CLEAN_UP_LOCK) { if (shutDownCondition.evaluate()) { shutdown(); } } }