/** * @return false if any dependencies are inactive, or we are inactive, or we have a global * exception. */ protected boolean shouldDoWork() { try { exceptionIfDependenciesNotActive(); } catch (IllegalStateException e) { return false; } return status.equals(Status.ACTIVE) && exception.get() == null; }
/** * @return false if any dependencies are inactive, or we are inactive, or we have a global * exception. */ protected boolean shouldDoWork() { try { exceptionIfDependenciesNotActive(); } catch (IllegalStateException e) { return false; } return status.equals(Status.ACTIVE) && exception.get() == null; }
/** * @return false if any dependencies are inactive, or we are inactive, or we have a global * exception. */ protected boolean shouldDoWork() { try { exceptionIfDependenciesNotActive(); } catch (IllegalStateException e) { return false; } return status.equals(Status.ACTIVE) && exception.get() == null; }
/** * @return false if any dependencies are inactive, or we are inactive, or we have a global * exception. */ protected boolean shouldDoWork() { try { exceptionIfDependenciesNotActive(); } catch (IllegalStateException e) { return false; } return status.equals(Status.ACTIVE) && exception.get() == null; }
/** * @return false if any dependencies are inactive, or we are inactive, or we have a global * exception. */ protected boolean shouldDoWork() { try { exceptionIfDependenciesNotActive(); } catch (IllegalStateException e) { return false; } return status.equals(Status.ACTIVE) && exception.get() == null; }
/** * @return false if any dependencies are inactive, or we are inactive, or we have a global * exception. */ protected boolean shouldDoWork() { try { exceptionIfDependenciesNotActive(); } catch (IllegalStateException e) { return false; } return status.equals(Status.ACTIVE) && exception.get() == null; }
@PostConstruct public void start() { logger.info("Starting %s", this); synchronized (this.statusLock) { if (this.status.compareTo(Status.SHUTDOWN_REQUEST) >= 0) { doShutdown(); this.status = Status.SHUT_DOWN; this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.ACTIVE) == 0) { this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.INACTIVE) != 0) { throw new IllegalStateException("Illegal state: " + this.status); } exceptionIfDependenciesNotActive(); this.status = Status.ACTIVE; } userExecutor.execute(this); }
@PostConstruct public void start() { logger.info("Starting %s", this); synchronized (this.statusLock) { if (this.status.compareTo(Status.SHUTDOWN_REQUEST) >= 0) { doShutdown(); this.status = Status.SHUT_DOWN; this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.ACTIVE) == 0) { this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.INACTIVE) != 0) { throw new IllegalStateException("Illegal state: " + this.status); } exceptionIfDependenciesNotActive(); this.status = Status.ACTIVE; } userExecutor.execute(this); }
@PostConstruct public void start() { logger.info("Starting %s", this); synchronized (this.statusLock) { if (this.status.compareTo(Status.SHUTDOWN_REQUEST) >= 0) { doShutdown(); this.status = Status.SHUT_DOWN; this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.ACTIVE) == 0) { this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.INACTIVE) != 0) { throw new IllegalStateException("Illegal state: " + this.status); } exceptionIfDependenciesNotActive(); this.status = Status.ACTIVE; } userExecutor.execute(this); }
@PostConstruct public void start() { logger.info("Starting %s", this); synchronized (this.statusLock) { if (this.status.compareTo(Status.SHUTDOWN_REQUEST) >= 0) { doShutdown(); this.status = Status.SHUT_DOWN; this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.ACTIVE) == 0) { this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.INACTIVE) != 0) { throw new IllegalStateException("Illegal state: " + this.status); } exceptionIfDependenciesNotActive(); this.status = Status.ACTIVE; } userExecutor.execute(this); }
@PostConstruct public void start() { logger.info("Starting %s", this); synchronized (this.statusLock) { if (this.status.compareTo(Status.SHUTDOWN_REQUEST) >= 0) { doShutdown(); this.status = Status.SHUT_DOWN; this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.ACTIVE) == 0) { this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.INACTIVE) != 0) { throw new IllegalStateException("Illegal state: " + this.status); } exceptionIfDependenciesNotActive(); this.status = Status.ACTIVE; } userExecutor.execute(this); }
@PostConstruct public void start() { logger.info("Starting %s", this); synchronized (this.statusLock) { if (this.status.compareTo(Status.SHUTDOWN_REQUEST) >= 0) { doShutdown(); this.status = Status.SHUT_DOWN; this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.ACTIVE) == 0) { this.statusLock.notifyAll(); return; } if (this.status.compareTo(Status.INACTIVE) != 0) { throw new IllegalStateException("Illegal state: " + this.status); } exceptionIfDependenciesNotActive(); this.status = Status.ACTIVE; } userExecutor.execute(this); }