public org.jboss.msc.service.ServiceController.Substate getSubstate() { return controller.getSubstate(); }
public org.jboss.msc.service.ServiceController.Substate getSubstate() { return controller.getSubstate(); }
public synchronized void listenerAdded(final ServiceController<?> controller) { set.add(controller); if (!controller.getSubstate().isRestState()) { outstanding++; } }
/** {@inheritDoc} */ @Override @Deprecated public Substate getSubstate() { return getDelegate().getSubstate(); }
/** {@inheritDoc} */ @Override @Deprecated public Substate getSubstate() { return getDelegate().getSubstate(); }
private int getUninstallOptions(BundleManager bundleManager) { ServiceContainer serviceContainer = bundleManager.getServiceContainer(); ServiceController<?> controller = serviceContainer.getRequiredService(Services.JBOSS_SERVER_CONTROLLER); boolean stopRequested = controller.getSubstate() == Substate.STOP_REQUESTED; return stopRequested ? Bundle.STOP_TRANSIENT : 0; } }
private static Set<ServiceName> findAllMissingServices(ServiceContainer container) { Set<ServiceName> result = new HashSet<ServiceName>(); for (ServiceName serviceName : container.getServiceNames()) { ServiceController<?> controller = container.getService(serviceName); if (controller != null && controller.getMode() != ServiceController.Mode.NEVER && controller.getMode() != ServiceController.Mode.REMOVE && controller.getSubstate() == ServiceController.Substate.PROBLEM) { result.addAll(controller.getImmediateUnavailableDependencies()); } } return result; } }
private static Set<ServiceName> findAllMissingServices(ServiceContainer container) { Set<ServiceName> result = new HashSet<ServiceName>(); for (ServiceName serviceName : container.getServiceNames()) { ServiceController<?> controller = container.getService(serviceName); if (controller != null && controller.getMode() != ServiceController.Mode.NEVER && controller.getMode() != ServiceController.Mode.REMOVE && controller.getSubstate() == ServiceController.Substate.PROBLEM) { result.addAll(controller.getImmediateUnavailableDependencies()); } } return result; } }
protected static boolean awaitStability(long timeout, TimeUnit unit, Set<? super ServiceController<?>> failed, Set<? super ServiceController<?>> problem) throws InterruptedException { boolean stable = system.awaitStability(timeout, unit, failed, problem); if (!stable) { log.warn("awaitStability() may require an increased timeout duration."); } if (failed != null && !failed.isEmpty()) { Iterator<? super ServiceController<?>> failedIterator = failed.iterator(); while (failedIterator.hasNext()) { ServiceController controller = (ServiceController) failedIterator.next(); log.errorf(CONTROLLER_MESSAGE, controller.getName(), controller.getState(), controller.getSubstate(), controller.getMode()); if (controller.getStartException() != null) { controller.getStartException().printStackTrace(); } } } if (problem != null && !problem.isEmpty()) { Iterator<? super ServiceController<?>> problemIterator = problem.iterator(); while (problemIterator.hasNext()) { ServiceController controller = (ServiceController) problemIterator.next(); log.errorf(CONTROLLER_MESSAGE, controller.getName(), controller.getState(), controller.getSubstate(), controller.getMode()); if (controller.getStartException() != null) { controller.getStartException().printStackTrace(); } } } return stable; }
private static void transition(final ServiceController<?> targetController, State targetState) throws StartException { // Short-circuit if the service is already at the target state if (targetController.getState() == targetState) return; final StabilityMonitor monitor = new StabilityMonitor(); try { if (targetController.getSubstate().isRestState()) { // Force service to transition to desired state Mode targetMode = modeToggle.get(targetState).get(targetController.getMode()); if (targetMode != null) { targetController.setMode(targetMode); } } monitor.addController(targetController); monitor.awaitStability(); if (targetState == State.UP) { StartException exception = targetController.getStartException(); if (exception != null) { throw exception; } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } finally { monitor.removeController(targetController); } }
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); String name = address.getLastElement().getValue(); ServiceName svcName = SocketBinding.JBOSS_BINDING_NAME.append(name); ServiceRegistry registry = context.getServiceRegistry(true); ServiceController<?> controller = registry.getService(svcName); ServiceController.Substate substate = controller == null ? null : controller.getSubstate(); if (substate != null && substate.getState() == ServiceController.State.UP && substate.isRestState()) { context.reloadRequired(); } else { context.removeService(SocketBinding.JBOSS_BINDING_NAME.append(name)); } }
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final ModelNode result = context.getResult(); if (!isEnabled) { result.set(AbstractDeploymentUnitService.DeploymentStatus.STOPPED.toString()); } else { final ServiceController<?> controller = context.getServiceRegistry(false).getService(Services.deploymentUnitName(runtimeName)); if (controller != null) { if (controller.getSubstate() == ServiceController.Substate.WONT_START && controller.getState() == ServiceController.State.DOWN) { result.set(AbstractDeploymentUnitService.DeploymentStatus.STOPPED.toString()); } else { result.set(((AbstractDeploymentUnitService) controller.getService()).getStatus().toString()); } } else { result.set(NO_METRICS); } } context.stepCompleted(); } }, OperationContext.Stage.RUNTIME);
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { PathAddress address = PathAddress.pathAddress(operation.require(OP_ADDR)); String name = address.getLastElement().getValue(); ServiceName svcName = SocketBinding.JBOSS_BINDING_NAME.append(name); ServiceRegistry registry = context.getServiceRegistry(true); ServiceController<?> controller = registry.getService(svcName); ServiceController.Substate substate = controller == null ? null : controller.getSubstate(); if (substate != null && substate.getState() == ServiceController.State.UP && substate.isRestState()) { context.reloadRequired(); } else { context.removeService(SocketBinding.JBOSS_BINDING_NAME.append(name)); } }
if (!isDown(service.getSubstate())) { try {
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { final ModelNode result = context.getResult(); if (!isEnabled) { result.set(AbstractDeploymentUnitService.DeploymentStatus.STOPPED.toString()); } else { final ServiceController<?> controller = context.getServiceRegistry(false).getService(Services.deploymentUnitName(element.getValue())); if (controller != null) { if (controller.getSubstate() == ServiceController.Substate.WONT_START && controller.getState() == ServiceController.State.DOWN) { result.set(AbstractDeploymentUnitService.DeploymentStatus.STOPPED.toString()); } else { result.set(((AbstractDeploymentUnitService) controller.getService()).getStatus().toString()); } } else { result.set(NO_METRICS); } } context.stepCompleted(); } }, OperationContext.Stage.RUNTIME);