protected void exceptionIfDependenciesNotActive() { for (LifeCycle dependency : dependencies) { if (dependency.getStatus().compareTo(Status.ACTIVE) != 0) { throw new IllegalStateException(String.format("Illegal state: %s for component: %s", dependency.getStatus(), dependency)); } } }
protected void exceptionIfDependenciesNotActive() { for (LifeCycle dependency : dependencies) { if (dependency.getStatus().compareTo(Status.ACTIVE) != 0) { throw new IllegalStateException(String.format("Illegal state: %s for component: %s", dependency.getStatus(), dependency)); } } }
protected void exceptionIfDependenciesNotActive() { for (LifeCycle dependency : dependencies) { if (dependency.getStatus().compareTo(Status.ACTIVE) != 0) { throw new IllegalStateException(String.format("Illegal state: %s for component: %s", dependency.getStatus(), dependency)); } } }
@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); }
public void shutdown(long waitMs) { synchronized (this.statusLock) { if (this.status.compareTo(Status.ACTIVE) > 0) { return; } this.status = Status.SHUTDOWN_REQUEST; try { awaitShutdown(waitMs); } catch (InterruptedException ignore) { } } }
protected void exceptionIfDependenciesNotActive() { for (LifeCycle dependency : dependencies) { if (dependency.getStatus().compareTo(Status.ACTIVE) != 0) { throw new IllegalStateException(String.format("Illegal state: %s for component: %s", dependency.getStatus(), dependency)); } } }
protected void exceptionIfDependenciesNotActive() { for (LifeCycle dependency : dependencies) { if (dependency.getStatus().compareTo(Status.ACTIVE) != 0) { throw new IllegalStateException(String.format("Illegal state: %s for component: %s", dependency.getStatus(), dependency)); } } }
public void shutdown(long waitMs) { synchronized (this.statusLock) { if (this.status.compareTo(Status.ACTIVE) > 0) { return; } this.status = Status.SHUTDOWN_REQUEST; try { awaitShutdown(waitMs); } catch (InterruptedException ignore) { } } }
protected void exceptionIfDependenciesNotActive() { for (LifeCycle dependency : dependencies) { if (dependency.getStatus().compareTo(Status.ACTIVE) != 0) { throw new IllegalStateException(String.format("Illegal state: %s for component: %s", dependency.getStatus(), dependency)); } } }
public void shutdown(long waitMs) { synchronized (this.statusLock) { if (this.status.compareTo(Status.ACTIVE) > 0) { return; } this.status = Status.SHUTDOWN_REQUEST; try { awaitShutdown(waitMs); } catch (InterruptedException ignore) { } } }
public void shutdown(long waitMs) { synchronized (this.statusLock) { if (this.status.compareTo(Status.ACTIVE) > 0) { return; } this.status = Status.SHUTDOWN_REQUEST; try { awaitShutdown(waitMs); } catch (InterruptedException ignore) { } } }
public void shutdown(long waitMs) { synchronized (this.statusLock) { if (this.status.compareTo(Status.ACTIVE) > 0) { return; } this.status = Status.SHUTDOWN_REQUEST; try { awaitShutdown(waitMs); } catch (InterruptedException ignore) { } } }
public void shutdown(long waitMs) { synchronized (this.statusLock) { if (this.status.compareTo(Status.ACTIVE) > 0) { return; } this.status = Status.SHUTDOWN_REQUEST; try { awaitShutdown(waitMs); } catch (InterruptedException ignore) { } } }