ContainerStateMonitor.ContainerStateChangeReport awaitContainerStateChangeReport(final int count) throws InterruptedException { return stateMonitor.awaitContainerStateChangeReport(count); }
/** * 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 acquireContainerMonitor() { stateMonitor.acquire(); }
void awaitContainerMonitor(final boolean interruptibly, final int count) throws InterruptedException { if (interruptibly) { stateMonitor.await(count); } else { stateMonitor.awaitUninterruptibly(count); } }
ContainerStateChangeReport awaitContainerStateChangeReport(int count) throws InterruptedException { synchronized (this) { while (busyServiceCount.get() > count) { wait(); } return createContainerStateChangeReport(false); } }
for (Map.Entry<ServiceName, MissingDependencyInfo> entry : changeReport.getMissingServices().entrySet()) { if (!entry.getValue().isUnavailable()) { msg.append(MESSAGES.serviceStatusReportMissing(entry.getKey(), createDependentsString(entry.getValue().getDependents()))); } else { msg.append(MESSAGES.serviceStatusReportUnavailable(entry.getKey(), createDependentsString(entry.getValue().getDependents())));
final ModelControllerImpl controller = new ModelControllerImpl(container, target, rootResourceRegistration, new ContainerStateMonitor(container, serviceController), configurationPersister, processType, runningModeControl, prepareStep, processState, executorService, expressionResolver);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // We only need to report if our response has no failure description already // and if no other verification handler has reported a failure (which they may have done // against a different response object that is invisible to us at this point, // hence the use of the FAILURE_REPORTED_ATTACHMENT) if (!context.hasFailureDescription() && context.getAttachment(FAILURE_REPORTED_ATTACHMENT) == null) { throw new OperationFailedException(ContainerStateMonitor.createChangeReportLogMessage(changeReport, true)); } } }
void releaseContainerMonitor() { stateMonitor.release(); }
ContainerStateChangeReport awaitContainerStateChangeReport() throws InterruptedException { monitor.awaitStability(failed, problems); return createContainerStateChangeReport(false); }
for (Map.Entry<ServiceName, MissingDependencyInfo> entry : changeReport.getMissingServices().entrySet()) { if (!entry.getValue().isUnavailable()) { msg.append(MESSAGES.serviceStatusReportMissing(entry.getKey(), createDependentsString(entry.getValue().getDependents()))); } else { msg.append(MESSAGES.serviceStatusReportUnavailable(entry.getKey(), createDependentsString(entry.getValue().getDependents())));
final ModelControllerImpl controller = new ModelControllerImpl(container, target, rootResourceRegistration, new ContainerStateMonitor(container), configurationPersister, processType, runningModeControl, prepareStep, processState, executorService, expressionResolver, authorizer, auditLogger, notificationSupport);
void awaitContainerMonitor(final boolean interruptibly) throws InterruptedException { if (interruptibly) { stateMonitor.await(); } else { stateMonitor.awaitUninterruptibly(); } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // We only need to report if our response has no failure description already // and if no other verification handler has reported a failure (which they may have done // against a different response object that is invisible to us at this point, // hence the use of the FAILURE_REPORTED_ATTACHMENT) if (!context.hasFailureDescription() && context.getAttachment(FAILURE_REPORTED_ATTACHMENT) == null) { throw new OperationFailedException(ContainerStateMonitor.createChangeReportLogMessage(changeReport, true)); } } }
void releaseContainerMonitor() { stateMonitor.release(); }
void release() { ContainerStateChangeReport changeReport = createContainerStateChangeReport(true); if (changeReport != null) { final String msg = createChangeReportLogMessage(changeReport); ROOT_LOGGER.info(msg); } }
/** * 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(); }
ContainerStateMonitor.ContainerStateChangeReport awaitContainerStateChangeReport() throws InterruptedException { return stateMonitor.awaitContainerStateChangeReport(); }
first = false; msg.append(ControllerLogger.ROOT_LOGGER.serviceStatusReportMissing(entry.getKey(), createDependentsString(entry.getValue().getDependents()))); } else { transitiveDownCount++;
final ModelControllerImpl controller = new ModelControllerImpl(container, target, rootResourceRegistration, new ContainerStateMonitor(container, getStabilityMonitor()), configurationPersister, processType, runningModeControl, prepareStep, processState, executorService, expressionResolver, authorizer, securityIdentitySupplier, auditLogger, notificationSupport,