@Override public ControlledProcessState.State getProcessState() { return processState.getState(); }
@Override public ControlledProcessState.State getProcessState() { return processState.getState(); }
public State getProcessState() { return processState.getState(); }
@Override public ControlledProcessState.State getProcessState() { return processState.getState(); }
public State getProcessState() { return processState.getState(); }
public State getProcessState() { return processState.getState(); }
@Override public ModelNode getModel() { assert serverName != null && !serverName.isEmpty() : "ServerName is null"; ModelNode model = super.getModel(); if (processState.getState() == ControlledProcessState.State.STARTING) { getAutoStart(serverName, model); } else if (processState.getState() == ControlledProcessState.State.RUNNING) { persistAutoStart(serverName, model); } return model; }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { String name = operation.get(NAME).asString(); // WFCORE-43 introduces a new attribute "runtime-configuration-state" // rather than introduce a new value into the ControlledProcessState enum, we map the new value here // this could be add in a future major release to be part of the enum. if (RUNTIME_CONFIGURATION_STATE.equals(name)) { if (processState.getState() == ControlledProcessState.State.RUNNING) { context.getResult().set(ClientConstants.CONTROLLER_PROCESS_STATE_OK); return; } } context.getResult().set(processState.getState().toString()); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { String name = operation.get(NAME).asString(); // WFCORE-43 introduces a new attribute "runtime-configuration-state" // rather than introduce a new value into the ControlledProcessState enum, we map the new value here // this could be add in a future major release to be part of the enum. if (RUNTIME_CONFIGURATION_STATE.equals(name)) { if (processState.getState() == ControlledProcessState.State.RUNNING) { context.getResult().set(ClientConstants.CONTROLLER_PROCESS_STATE_OK); return; } } context.getResult().set(processState.getState().toString()); }
@Override public ModelNode getModel() { assert serverName != null && !serverName.isEmpty() : "ServerName is null"; ModelNode model = super.getModel(); if (processState.getState() == ControlledProcessState.State.STARTING) { getAutoStart(serverName, model); } else if (processState.getState() == ControlledProcessState.State.RUNNING) { persistAutoStart(serverName, model); } return model; }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.getResult().set(processState.getState().toString()); context.stepCompleted(); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.getResult().set(processState.getState().toString()); context.stepCompleted(); }
private CapabilityRegistry.RuntimeStatus getStepExecutionStatus(Step step) { if (booting || currentStage != Stage.RUNTIME || !RUNTIME_LIMITED_STATES.contains(processState.getState()) || (step.operationDefinition != null && (step.operationDefinition.getFlags().contains(OperationEntry.Flag.READ_ONLY) || step.operationDefinition.getFlags().contains(OperationEntry.Flag.RUNTIME_ONLY)))) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } ImmutableManagementResourceRegistration mrr = step.getManagementResourceRegistration(getManagementModel()); if (mrr != null) { if (mrr.isRuntimeOnly()) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } String opName = step.operationDefinition != null ? step.operationDefinition.getName() : null; if ((WRITE_ATTRIBUTE_OPERATION.equals(opName) || UNDEFINE_ATTRIBUTE_OPERATION.equals(opName)) && step.operation.hasDefined(NAME)) { String attrName = step.operation.get(NAME).asString(); AttributeAccess aa = mrr.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (aa != null && aa.getStorageType() == AttributeAccess.Storage.RUNTIME) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } } } return getStepCapabilityStatus(step); }
private CapabilityRegistry.RuntimeStatus getStepExecutionStatus(Step step) { if (booting || currentStage != Stage.RUNTIME || !RUNTIME_LIMITED_STATES.contains(processState.getState()) || (step.operationDefinition != null && (step.operationDefinition.getFlags().contains(OperationEntry.Flag.READ_ONLY) || step.operationDefinition.getFlags().contains(OperationEntry.Flag.RUNTIME_ONLY)))) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } ImmutableManagementResourceRegistration mrr = step.getManagementResourceRegistration(getManagementModel()); if (mrr != null) { if (mrr.isRuntimeOnly()) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } String opName = step.operationDefinition != null ? step.operationDefinition.getName() : null; if ((WRITE_ATTRIBUTE_OPERATION.equals(opName) || UNDEFINE_ATTRIBUTE_OPERATION.equals(opName)) && step.operation.hasDefined(NAME)) { String attrName = step.operation.get(NAME).asString(); AttributeAccess aa = mrr.getAttributeAccess(PathAddress.EMPTY_ADDRESS, attrName); if (aa != null && aa.getStorageType() == AttributeAccess.Storage.RUNTIME) { return RuntimeCapabilityRegistry.RuntimeStatus.NORMAL; } } } return getStepCapabilityStatus(step); }
ControlledProcessState.State state = processState.getState(); switch (state) { case RELOAD_REQUIRED:
protected ModelNode executeReadOnlyOperation(final ModelNode operation, final ManagementModelImpl model, final OperationTransactionControl control, final OperationStepHandler prepareStep, AbstractOperationContext delegateContext) { final ModelNode response = new ModelNode(); @SuppressWarnings("deprecation") final int operationId = CurrentOperationIdHolder.getCurrentOperationID(); final OperationTransactionControl txControl = control == null ? null : new OperationTransactionControl() { @Override public void operationPrepared(OperationTransaction transaction, ModelNode result) { control.operationPrepared(transaction, response); } }; // Use a read-only context final ReadOnlyContext context = new ReadOnlyContext(processType, runningModeControl.getRunningMode(), txControl, processState, false, model, delegateContext, this, operationId, securityIdentitySupplier); context.addStep(response, operation, prepareStep, OperationContext.Stage.MODEL); context.executeOperation(); if (!response.hasDefined(RESPONSE_HEADERS) || !response.get(RESPONSE_HEADERS).hasDefined(PROCESS_STATE)) { ControlledProcessState.State state = processState.getState(); switch (state) { case RELOAD_REQUIRED: case RESTART_REQUIRED: response.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default: break; } } return response; }
protected ModelNode executeReadOnlyOperation(final ModelNode operation, final ManagementModelImpl model, final OperationTransactionControl control, final OperationStepHandler prepareStep, AbstractOperationContext delegateContext) { final ModelNode response = new ModelNode(); @SuppressWarnings("deprecation") final int operationId = CurrentOperationIdHolder.getCurrentOperationID(); final OperationTransactionControl txControl = control == null ? null : new OperationTransactionControl() { @Override public void operationPrepared(OperationTransaction transaction, ModelNode result) { control.operationPrepared(transaction, response); } }; // Use a read-only context final ReadOnlyContext context = new ReadOnlyContext(processType, runningModeControl.getRunningMode(), txControl, processState, false, model, delegateContext, this, operationId, securityIdentitySupplier); context.addStep(response, operation, prepareStep, OperationContext.Stage.MODEL); context.executeOperation(); if (!response.hasDefined(RESPONSE_HEADERS) || !response.get(RESPONSE_HEADERS).hasDefined(PROCESS_STATE)) { ControlledProcessState.State state = processState.getState(); switch (state) { case RELOAD_REQUIRED: case RESTART_REQUIRED: response.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default: break; } } return response; }
if (!failed && ps.getState() == ControlledProcessState.State.RUNNING) { suspend(sc);
if (!failed && ps.getState() == ControlledProcessState.State.RUNNING) { suspend(sc);
protected void assertServerState(final KernelServices services, String expected) { ModelTestModelControllerService controllerService = extractField(services, "controllerService"); ControlledProcessState processState = extractField(controllerService, "processState"); assertEquals(expected, processState.getState().toString()); }