final ModelNode model = Resource.Tools.readModel(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS, true));
context.addStep(new OperationStepHandler() {
@Override
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
final ServerStatus origStatus = serverInventory.determineServerStatus(serverName);
if (origStatus != ServerStatus.STARTED) {
throw new OperationFailedException(new ModelNode(MESSAGES.cannotRestartServer(serverName, origStatus)));
}
final ServerStatus status = serverInventory.restartServer(serverName, -1, model, blocking);
context.getResult().set(status.toString());
context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER);
}
}, OperationContext.Stage.RUNTIME);
context.stepCompleted();