@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
public S awaitValue() throws IllegalStateException, InterruptedException { assert !holdsLock(this); if (!(service instanceof Service)) { throw new UnsupportedOperationException(); } synchronized (this) { for (;;) switch (state.getState()) { case UP: { return ((Service<S>) service).getValue(); } case START_FAILED: { throw new IllegalStateException("Failed to start service", startException); } case REMOVED: { throw new IllegalStateException("Service was removed"); } default: { wait(); } } } }
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 retry() { assert !holdsLock(this); final List<Runnable> tasks; synchronized (this) { final boolean leavingRestState = isStableRestState(); if (failCount > 0 || state.getState() != ServiceController.State.START_FAILED) return; startException = null; tasks = transition(); addAsyncTasks(tasks.size()); updateStabilityState(leavingRestState); } doExecute(tasks); }
void addChild(final ServiceControllerImpl<?> child) { assert !holdsLock(this); synchronized (this) { if (state.getState() != State.STARTING && state.getState() != State.UP) { throw new IllegalStateException("Children cannot be added in state " + state.getState()); } children.add(child); newDependent(child); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@SuppressWarnings({ "rawtypes", "unchecked" }) public void transition(ServiceController controller, Transition transition) { if(!typeToTrack.isParentOf(controller.getName())) { return; } if(transition.getAfter().getState().equals(State.UP)) { serviceCollection.add((S) controller.getValue()); } else { serviceCollection.remove(controller.getValue()); } }
@Override public void retry() { assert !holdsLock(this); final List<Runnable> tasks; synchronized (this) { final boolean leavingRestState = isStableRestState(); if (failCount > 0 || state.getState() != ServiceController.State.START_FAILED) return; startException = null; tasks = transition(); addAsyncTasks(tasks.size()); updateStabilityState(leavingRestState); } doExecute(tasks); }
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)); } }
public ServiceController.State getState() { synchronized (this) { return state.getState(); } }
void addChild(final ServiceControllerImpl<?> child) { assert !holdsLock(this); synchronized (this) { if (state.getState() != State.STARTING && state.getState() != State.UP) { throw new IllegalStateException("Children cannot be added in state " + state.getState()); } children.add(child); newDependent(child); } }
public ServiceController.State getState() { synchronized (this) { return state.getState(); } }