Adjusting based on comments.
This commit is contained in:
parent
8fa0d8e905
commit
ea2792e278
|
@ -46,11 +46,8 @@ public abstract class AbstractLifecycleRunnable extends AbstractRunnable {
|
||||||
* @throws NullPointerException if any parameter is {@code null}
|
* @throws NullPointerException if any parameter is {@code null}
|
||||||
*/
|
*/
|
||||||
public AbstractLifecycleRunnable(Lifecycle lifecycle, ESLogger logger) {
|
public AbstractLifecycleRunnable(Lifecycle lifecycle, ESLogger logger) {
|
||||||
Objects.requireNonNull(lifecycle, "lifecycle must not be null");
|
this.lifecycle = Objects.requireNonNull(lifecycle, "lifecycle must not be null");
|
||||||
Objects.requireNonNull(logger, "logger must not be null");
|
this.logger = Objects.requireNonNull(logger, "logger must not be null");
|
||||||
|
|
||||||
this.lifecycle = lifecycle;
|
|
||||||
this.logger = logger;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,7 +60,7 @@ public abstract class AbstractLifecycleRunnable extends AbstractRunnable {
|
||||||
protected final void doRun() throws Exception {
|
protected final void doRun() throws Exception {
|
||||||
// prevent execution if the service is stopped
|
// prevent execution if the service is stopped
|
||||||
if (lifecycle.stoppedOrClosed()) {
|
if (lifecycle.stoppedOrClosed()) {
|
||||||
logger.trace("service is stopping. exiting");
|
logger.trace("lifecycle is stopping. exiting");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue