case RELOAD_REQUIRED: case RESTART_REQUIRED: response.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default:
case RELOAD_REQUIRED: case RESTART_REQUIRED: responseNode.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default:
case RELOAD_REQUIRED: case RESTART_REQUIRED: responseNode.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default:
this.propertyChangeListener = (PropertyChangeEvent evt) -> { if ("currentState".equals(evt.getPropertyName())) { Process.RuntimeConfigurationState oldState = Process.RuntimeConfigurationState.valueOf(((ControlledProcessState.State) evt.getOldValue()).name()); Process.RuntimeConfigurationState newState = Process.RuntimeConfigurationState.valueOf(((ControlledProcessState.State) evt.getNewValue()).name()); transition(oldState, newState);
case RELOAD_REQUIRED: case RESTART_REQUIRED: response.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default:
stateString = CONTROLLER_PROCESS_STATE_OK; } else { stateString = newState.toString(); oldStateString = CONTROLLER_PROCESS_STATE_OK; } else { oldStateString = oldState.toString(); this.state = RuntimeConfigurationState.valueOf(newState.name()); AttributeChangeNotification notification = new AttributeChangeNotification(objectName, sequence.getAndIncrement(), System.currentTimeMillis(),
stateString = CONTROLLER_PROCESS_STATE_OK; } else { stateString = newState.toString(); oldStateString = CONTROLLER_PROCESS_STATE_OK; } else { oldStateString = oldState.toString(); this.state = RuntimeConfigurationState.valueOf(newState.name()); AttributeChangeNotification notification = new AttributeChangeNotification(objectName, sequence.getAndIncrement(), System.currentTimeMillis(),
case RELOAD_REQUIRED: case RESTART_REQUIRED: response.get(RESPONSE_HEADERS, PROCESS_STATE).set(state.toString()); break; default:
assertProcessState(cli, ControlledProcessState.State.RUNNING.toString(), TimeoutUtil.adjust(30000), false); ModelNode firstResult = readResourceTree(cli); cli.sendLine("/system-property=model-parser-util:add(value=true)"); cli.sendLine("/system-property=model-parser-util:remove"); cli.sendLine("reload --admin-only=true"); assertProcessState(cli, ControlledProcessState.State.RUNNING.toString(), TimeoutUtil.adjust(30000), false); ModelNode secondResult = readResourceTree(cli); compare(firstResult, secondResult);
private static ModelNode hostControllerTest(final File originalConfig, final File target, boolean hostXml) throws Exception { File domainDir = new File(target, "domain"); File configCopy = new File(domainDir, "configuration" + File.separatorChar + originalConfig.getName()); FileUtils.copyFile(originalConfig, configCopy); CLIWrapper cli = new CLIWrapper(false); try { String configType = hostXml ? "--host-config=" : "--domain-config="; String line = "embed-host-controller " + configType + originalConfig.getName() + " --std-out=echo --jboss-home=" + target.getCanonicalPath(); cli.sendLine(line); assertProcessState(cli, ControlledProcessState.State.RUNNING.toString(), TimeoutUtil.adjust(30000), true); ModelNode firstResult = readResourceTree(cli); String hostName = firstResult.get(HOST).asProperty().getName(); cli.sendLine("/system-property=model-parser-util:add(value=true)"); cli.sendLine("/system-property=model-parser-util:remove"); cli.sendLine("reload --host=" + hostName + " --admin-only=true"); assertProcessState(cli, ControlledProcessState.State.RUNNING.toString(), TimeoutUtil.adjust(30000), true); ModelNode secondResult = readResourceTree(cli); compare(pruneDomainModel(firstResult, hostXml), pruneDomainModel(secondResult, hostXml)); return secondResult; } finally { try { cli.quit(); } finally { System.clearProperty(ServerEnvironment.SERVER_BASE_DIR); } } }
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; }
@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()); }
protected void assertServerState(final KernelServices services, String expected) { ModelTestModelControllerService controllerService = extractField(services, "controllerService"); ControlledProcessState processState = extractField(controllerService, "processState"); assertEquals(expected, processState.getState().toString()); }
@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(); }