public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if(! context.isNormalServer()) { context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); return; } final MBeanServer mbs = TransactionExtension.getMBeanServer(context); if (mbs != null) { // Get the log-store resource final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); assert resource instanceof LogStoreResource; final LogStoreResource logStore = (LogStoreResource) resource; // Get the expose-all-logs parameter value final ModelNode subModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final boolean exposeAllLogs = LogStoreConstants.EXPOSE_ALL_LOGS.resolveModelAttribute(context, subModel).asBoolean(); final Resource storeModel = probeTransactions(mbs, exposeAllLogs); // Replace the current model with an updated one context.acquireControllerLock(); // WFLY-3020 -- don't drop the root model storeModel.writeModel(logStore.getModel()); logStore.update(storeModel); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); Map<String, Set<String>> obsoleteContents = this.contentRepository.cleanObsoleteContent(); if (!obsoleteContents.get(ContentRepository.MARKED_CONTENT).isEmpty()) { for (String obsoleteContent : obsoleteContents.get(ContentRepository.MARKED_CONTENT)) { context.getResult().get(ContentRepository.MARKED_CONTENT).add(obsoleteContent); } } if (!obsoleteContents.get(ContentRepository.DELETED_CONTENT).isEmpty()) { for (String obsoleteContent : obsoleteContents.get(ContentRepository.DELETED_CONTENT)) { context.getResult().get(ContentRepository.DELETED_CONTENT).add(obsoleteContent); } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); Map<String, Set<String>> obsoleteContents = this.contentRepository.cleanObsoleteContent(); if (!obsoleteContents.get(ContentRepository.MARKED_CONTENT).isEmpty()) { for (String obsoleteContent : obsoleteContents.get(ContentRepository.MARKED_CONTENT)) { context.getResult().get(ContentRepository.MARKED_CONTENT).add(obsoleteContent); } } if (!obsoleteContents.get(ContentRepository.DELETED_CONTENT).isEmpty()) { for (String obsoleteContent : obsoleteContents.get(ContentRepository.DELETED_CONTENT)) { context.getResult().get(ContentRepository.DELETED_CONTENT).add(obsoleteContent); } } }
public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); context.restartRequired(); context.completeStep(new OperationContext.RollbackHandler() { @Override public void handleRollback(OperationContext context, ModelNode operation) { context.revertRestartRequired(); } }); }
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); context.attach(PathAddressFilter.KEY, DEFAULT_FILTER); context.attach(OrderedChildTypesAttachment.KEY, orderedChildTypesAttachment); context.addStep(operation, GenericModelDescribeOperationHandler.INSTANCE, OperationContext.Stage.MODEL, true); }
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); context.attach(PathAddressFilter.KEY, DEFAULT_FILTER); context.attach(OrderedChildTypesAttachment.KEY, orderedChildTypesAttachment); context.addStep(operation, GenericModelDescribeOperationHandler.INSTANCE, OperationContext.Stage.MODEL, true); }
private void executeRuntime(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); execute(context, operation, getInstallationManager(context), getPatchStreamName(context)); }
private void executeRuntime(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); execute(context, operation, getInstallationManager(context), getPatchStreamName(context)); }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // if the calling process has already acquired a lock, don't relock. if (lock) { // Acquire the lock to make sure that nobody can modify the model before the slave has applied it context.acquireControllerLock(); } final Transformers.TransformationInputs transformationInputs = new Transformers.TransformationInputs(context); final ReadMasterDomainModelUtil readUtil = ReadMasterDomainModelUtil.readMasterDomainResourcesForInitialConnect(transformers, transformationInputs, ignoredTransformationRegistry, transformationInputs.getRootResource()); context.getResult().set(readUtil.getDescribedResources()); }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // if the calling process has already acquired a lock, don't relock. if (lock) { // Acquire the lock to make sure that nobody can modify the model before the slave has applied it context.acquireControllerLock(); } final Transformers.TransformationInputs transformationInputs = new Transformers.TransformationInputs(context); final ReadMasterDomainModelUtil readUtil = ReadMasterDomainModelUtil.readMasterDomainResourcesForInitialConnect(transformers, transformationInputs, ignoredTransformationRegistry, transformationInputs.getRootResource()); context.getResult().set(readUtil.getDescribedResources()); }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // Acquire the lock context.acquireControllerLock(); // Transform the model final Resource untransformedRoot = context.readResource(PathAddress.EMPTY_ADDRESS,true); final Resource root = transformResource(context, untransformedRoot); // Get the list of all resources registered in this model context.getResult().set(describeAsNodeList(root)); // The HC registration process will hijack the operationPrepared call and push // the model to a registering host-controller context.stepCompleted(); }
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); // Update the operation permit final int permit = operation.require("operation-id").asInt(); operationIDUpdater.updateOperationID(permit); super.execute(context, operation); } }
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); // Update the operation permit final int permit = operation.require("operation-id").asInt(); operationIDUpdater.updateOperationID(permit); super.execute(context, operation); } }
@Override public void execute(final OperationContext context, final ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); // Update the operation permit final int permit = operation.require("operation-id").asInt(); operationIDUpdater.updateOperationID(permit); super.execute(context, operation); } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // if the calling process has already acquired a lock, don't relock. if (lock) { context.acquireControllerLock(); } final Transformers.ResourceIgnoredTransformationRegistry ignoredTransformationRegistry; final Resource resource = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); // The host info is only null in the tests if (hostInfo == null) { ignoredTransformationRegistry = Transformers.DEFAULT; } else { final ReadMasterDomainModelUtil.RequiredConfigurationHolder rc = hostInfo.populateRequiredConfigurationHolder(resource, extensionRegistry); ignoredTransformationRegistry = ReadMasterDomainModelUtil.createHostIgnoredRegistry(hostInfo, rc); } final OperationStepHandler handler = new ReadDomainModelHandler(ignoredTransformationRegistry, transformers, lock); context.addStep(handler, OperationContext.Stage.MODEL); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { // if the calling process has already acquired a lock, don't relock. if (lock) { context.acquireControllerLock(); } final Transformers.ResourceIgnoredTransformationRegistry ignoredTransformationRegistry; final Resource resource = context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS); // The host info is only null in the tests if (hostInfo == null) { ignoredTransformationRegistry = Transformers.DEFAULT; } else { final ReadMasterDomainModelUtil.RequiredConfigurationHolder rc = hostInfo.populateRequiredConfigurationHolder(resource, extensionRegistry); ignoredTransformationRegistry = ReadMasterDomainModelUtil.createHostIgnoredRegistry(hostInfo, rc); } final OperationStepHandler handler = new ReadDomainModelHandler(ignoredTransformationRegistry, transformers, lock); context.addStep(handler, OperationContext.Stage.MODEL); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); // Filter the information to only include configuration for the given server-group or socket-binding group final Set<ServerConfigInfo> serverConfigs = IgnoredNonAffectedServerGroupsUtil.createConfigsFromModel(operation); final ReadMasterDomainModelUtil.RequiredConfigurationHolder rc = new ReadMasterDomainModelUtil.RequiredConfigurationHolder(); for (final ServerConfigInfo serverConfig : serverConfigs) { ReadMasterDomainModelUtil.processServerConfig(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS), rc, serverConfig, extensionRegistry); } final Transformers.ResourceIgnoredTransformationRegistry manualExcludes = HostInfo.createIgnoredRegistry(operation); final Transformers.ResourceIgnoredTransformationRegistry ignoredTransformationRegistry = ReadMasterDomainModelUtil.createServerIgnoredRegistry(rc, manualExcludes); final ReadDomainModelHandler handler = new ReadDomainModelHandler(ignoredTransformationRegistry, transformers, true); context.addStep(handler, OperationContext.Stage.MODEL); }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { context.acquireControllerLock(); // Filter the information to only include configuration for the given server-group or socket-binding group final Set<ServerConfigInfo> serverConfigs = IgnoredNonAffectedServerGroupsUtil.createConfigsFromModel(operation); final ReadMasterDomainModelUtil.RequiredConfigurationHolder rc = new ReadMasterDomainModelUtil.RequiredConfigurationHolder(); for (final ServerConfigInfo serverConfig : serverConfigs) { ReadMasterDomainModelUtil.processServerConfig(context.readResourceFromRoot(PathAddress.EMPTY_ADDRESS), rc, serverConfig, extensionRegistry); } final Transformers.ResourceIgnoredTransformationRegistry manualExcludes = HostInfo.createIgnoredRegistry(operation); final Transformers.ResourceIgnoredTransformationRegistry ignoredTransformationRegistry = ReadMasterDomainModelUtil.createServerIgnoredRegistry(rc, manualExcludes); final ReadDomainModelHandler handler = new ReadDomainModelHandler(ignoredTransformationRegistry, transformers, true); context.addStep(handler, OperationContext.Stage.MODEL); }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if(! context.isNormalServer()) { context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); return; } final MBeanServer mbs = TransactionExtension.getMBeanServer(context); if (mbs != null) { // Get the log-store resource final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); assert resource instanceof LogStoreResource; final LogStoreResource logStore = (LogStoreResource) resource; // Get the expose-all-logs parameter value final ModelNode subModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final boolean exposeAllLogs = LogStoreConstants.EXPOSE_ALL_LOGS.resolveModelAttribute(context, subModel).asBoolean(); final Resource storeModel = probeTransactions(mbs, exposeAllLogs); // Replace the current model with an updated one context.acquireControllerLock(); // WFLY-3020 -- don't drop the root model storeModel.writeModel(logStore.getModel()); logStore.update(storeModel); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); }
public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if(! context.isNormalServer()) { context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); return; } final MBeanServer mbs = TransactionExtension.getMBeanServer(context); if (mbs != null) { // Get the log-store resource final Resource resource = context.readResource(PathAddress.EMPTY_ADDRESS); assert resource instanceof LogStoreResource; final LogStoreResource logStore = (LogStoreResource) resource; // Get the expose-all-logs parameter value final ModelNode subModel = context.readResource(PathAddress.EMPTY_ADDRESS).getModel(); final boolean exposeAllLogs = LogStoreConstants.EXPOSE_ALL_LOGS.resolveModelAttribute(context, subModel).asBoolean(); final Resource storeModel = probeTransactions(mbs, exposeAllLogs); // Replace the current model with an updated one context.acquireControllerLock(); // WFLY-3020 -- don't drop the root model storeModel.writeModel(logStore.getModel()); logStore.update(storeModel); } context.completeStep(OperationContext.RollbackHandler.NOOP_ROLLBACK_HANDLER); }