ContainerStateChangeReport awaitContainerStateChangeReport(int count) throws InterruptedException { synchronized (this) { while (busyServiceCount.get() > count) { wait(); } return createContainerStateChangeReport(false); } }
ContainerStateChangeReport awaitContainerStateChangeReport() throws InterruptedException { monitor.awaitStability(failed, problems); return createContainerStateChangeReport(false); }
/** * Await service container stability and then report on container state changes. Does not reset change history, * so another run of this method with no intervening call to {@link #logContainerStateChangesAndReset()} * will produce a report including any changes included in a report returned by the first run. * * @param timeout maximum period to wait for service container stability * @param timeUnit unit in which {@code timeout} is expressed * * @return a change report, or {@code null} if there is nothing to report * * @throws java.lang.InterruptedException if the thread is interrupted while awaiting service container stability * @throws java.util.concurrent.TimeoutException if service container stability is not reached before the specified timeout */ ContainerStateChangeReport awaitContainerStateChangeReport(long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException { if (monitor.awaitStability(timeout, timeUnit, failed, problems)) { return createContainerStateChangeReport(false); } throw new TimeoutException(); }
/** * Await service container stability and then report on container state changes. Does not reset change history, * so another run of this method with no intervening call to {@link #logContainerStateChangesAndReset()} * will produce a report including any changes included in a report returned by the first run. * * @param timeout maximum period to wait for service container stability * @param timeUnit unit in which {@code timeout} is expressed * * @return a change report, or {@code null} if there is nothing to report * * @throws java.lang.InterruptedException if the thread is interrupted while awaiting service container stability * @throws java.util.concurrent.TimeoutException if service container stability is not reached before the specified timeout */ ContainerStateChangeReport awaitContainerStateChangeReport(long timeout, TimeUnit timeUnit) throws InterruptedException, TimeoutException { if (monitor.awaitStability(timeout, timeUnit, failed, problems)) { return createContainerStateChangeReport(false); } throw new TimeoutException(); }
/** * Tick down the count, triggering a deployment status report when the count is zero. */ private void tick() { int tick = busyServiceCount.decrementAndGet(); synchronized (this) { notifyAll(); if (tick == 0) { ContainerStateChangeReport changeReport = createContainerStateChangeReport(true); if (changeReport != null) { final String msg = createChangeReportLogMessage(changeReport); ROOT_LOGGER.info(msg); } } } }
/** * Log a report of any problematic container state changes and reset container state change history * so another run of this method or of {@link #awaitContainerStateChangeReport(long, java.util.concurrent.TimeUnit)} * will produce a report not including any changes included in a report returned by this run. */ void logContainerStateChangesAndReset() { ContainerStateChangeReport changeReport = createContainerStateChangeReport(true); if (changeReport != null) { final String msg = createChangeReportLogMessage(changeReport, false); ROOT_LOGGER.info(msg); } }
void release() { ContainerStateChangeReport changeReport = createContainerStateChangeReport(true); if (changeReport != null) { final String msg = createChangeReportLogMessage(changeReport); ROOT_LOGGER.info(msg); } }
/** * Log a report of any problematic container state changes and reset container state change history * so another run of this method or of {@link #awaitContainerStateChangeReport(long, java.util.concurrent.TimeUnit)} * will produce a report not including any changes included in a report returned by this run. */ void logContainerStateChangesAndReset() { ContainerStateChangeReport changeReport = createContainerStateChangeReport(true); if (changeReport != null) { final String msg = createChangeReportLogMessage(changeReport, false); ROOT_LOGGER.info(msg); } }