@Override protected boolean requiresRuntime(OperationContext context) { return !context.isBooting() && context.isDefaultRequiresRuntime(); }
@Override protected final void rollbackRuntime(OperationContext context, ModelNode operation, Resource resource) { if (context.isBooting()) { super.rollbackRuntime(context, operation, resource); } else { context.revertReloadRequired(); } } }
@Override protected final void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { if (context.isBooting()) { context.addStep(new DeploymentChainStep(this.deploymentChainContributor), OperationContext.Stage.RUNTIME); super.performRuntime(context, operation, resource); } else { context.reloadRequired(); } }
/** * {@inheritDoc} */ @Override protected void performRuntime(final OperationContext context, final ModelNode operation, final ModelNode model) throws OperationFailedException { PathAddress address = PathAddress.pathAddress(operation.get(OP_ADDR)); final String jndiName = address.getLastElement().getValue(); final String tableName = CMResourceResourceDefinition.CM_TABLE_NAME.resolveModelAttribute(context, model).asString(); final int batchSize = CMResourceResourceDefinition.CM_TABLE_BATCH_SIZE.resolveModelAttribute(context, model).asInt(); final boolean immediateCleanup = CMResourceResourceDefinition.CM_TABLE_IMMEDIATE_CLEANUP.resolveModelAttribute(context, model).asBoolean(); ROOT_LOGGER.debugf("adding commit-markable-resource: jndi-name=%s, table-name=%s, batch-size=%d, immediate-cleanup=%b", jndiName, tableName, batchSize, immediateCleanup); CMResourceService service = new CMResourceService(jndiName, tableName, immediateCleanup, batchSize); context.getServiceTarget().addService(TxnServices.JBOSS_TXN_CMR.append(jndiName), service) .addDependency(TxnServices.JBOSS_TXN_JTA_ENVIRONMENT, JTAEnvironmentBean.class, service.getJTAEnvironmentBeanInjector()) .setInitialMode(ServiceController.Mode.ACTIVE) .install(); if (!context.isBooting()) { context.reloadRequired(); } } }
@Override public void installServices(OperationContext context, ModelNode model) throws OperationFailedException { if (!context.isBooting()) return;
@Override protected void finishModelStage(OperationContext context, ModelNode operation, String attributeName, ModelNode newValue, ModelNode oldValue, Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); if (!context.isBooting()) { TransformerOperationAttachment attachment = TransformerOperationAttachment.getOrCreate(context); InitialAttributeValueOperationContextAttachment valuesAttachment = attachment.getAttachment(InitialAttributeValueOperationContextAttachment.INITIAL_VALUES_ATTACHMENT); if (valuesAttachment == null) { valuesAttachment = new InitialAttributeValueOperationContextAttachment(); attachment.attach(InitialAttributeValueOperationContextAttachment.INITIAL_VALUES_ATTACHMENT, valuesAttachment); } valuesAttachment.putIfAbsentInitialValue(Operations.getPathAddress(operation), attributeName, oldValue); } }
@Override protected void finishModelStage(OperationContext context, ModelNode operation, String attributeName, ModelNode newValue, ModelNode oldValue, Resource model) throws OperationFailedException { super.finishModelStage(context, operation, attributeName, newValue, oldValue, model); if (!context.isBooting()) { TransformerOperationAttachment attachment = TransformerOperationAttachment.getOrCreate(context); InitialAttributeValueOperationContextAttachment valuesAttachment = attachment.getAttachment(InitialAttributeValueOperationContextAttachment.INITIAL_VALUES_ATTACHMENT); if (valuesAttachment == null) { valuesAttachment = new InitialAttributeValueOperationContextAttachment(); attachment.attach(InitialAttributeValueOperationContextAttachment.INITIAL_VALUES_ATTACHMENT, valuesAttachment); } valuesAttachment.putIfAbsentInitialValue(Operations.getPathAddress(operation), attributeName, oldValue); } } }
if (context.getProcessType().isServer() && !context.isBooting() && name.equals("ejb")) { PathElement ejbPath = PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, "ejb3"); Resource ejbResource = safeGetResource(context, ejbPath);
if (context.getProcessType().isServer() && !context.isBooting()) { if (context.readResourceFromRoot(address.getParent(),false).hasChild(PathElement.pathElement(ModelDescriptionConstants.SUBSYSTEM, "infinispan"))) {
} else { RaOperationUtil.installRaServicesAndDeployFromModule(context, name, resourceAdapter, archiveOrModuleName, newControllers); if (context.isBooting()) { context.addStep(new OperationStepHandler() { public void execute(final OperationContext context, ModelNode operation) throws OperationFailedException {
@Override protected boolean requiresRuntime(OperationContext context) { // vault is used regardless of running mode, so that's not a factor return !context.isBooting(); }
@Override protected boolean requiresRuntime(OperationContext context) { // Management interfaces run in all modes including ADMIN_ONLY return !context.isBooting(); }
private static void revertReload(OperationContext context) { if (!context.isBooting()) { context.revertReloadRequired(); } } }
public static TransformerOperationAttachment getOrCreate(OperationContext context) { assert !context.isBooting() : "Only usable once booted"; TransformerOperationAttachment attachment = new TransformerOperationAttachment(); TransformerOperationAttachment original = context.attachIfAbsent(KEY, attachment); return original == null ? attachment : original; }
/** * Overrides the superclass to additionally call {@link OperationContext#revertReloadRequired()} * if {@link OperationContext#isBooting()} returns {@code false}. */ @Override protected void rollbackRuntime(OperationContext context, ModelNode operation, ModelNode model, List<ServiceController<?>> controllers) { super.rollbackRuntime(context, operation, model, controllers); if (!context.isBooting()) { context.revertReloadRequired(); } } }
@Override protected void rollbackRuntime(OperationContext context, ModelNode operation, ModelNode model, List<ServiceController<?>> controllers) { if (context.isBooting()) { super.rollbackRuntime(context, operation, model, controllers); } else { context.revertReloadRequired(); } } }
/** * Overrides the superclass to additionally call {@link OperationContext#revertReloadRequired()} * if {@link OperationContext#isBooting()} returns {@code false}. */ @Override protected void rollbackRuntime(OperationContext context, ModelNode operation, ModelNode model, List<ServiceController<?>> controllers) { super.rollbackRuntime(context, operation, model, controllers); if (!context.isBooting()) { context.revertReloadRequired(); } } }
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (authorizerConfiguration.addRoleMappingPrincipal(roleName, principalType, matchType, name, realm, context.isBooting())) { registerRollbackHandler(context, roleName, principalType, name, realm); } else { throw DomainManagementLogger.ROOT_LOGGER.inconsistentRbacRuntimeState(); } } }, Stage.RUNTIME);
@Override public void execute(OperationContext context, ModelNode operation) throws OperationFailedException { if (!context.isBooting()) { throw new IllegalStateException(); } ModelNode model = context.readResourceForUpdate(PathAddress.EMPTY_ADDRESS).getModel(); ServerRootResourceDefinition.SERVER_GROUP.validateAndSet(operation, model); ServerRootResourceDefinition.HOST.validateAndSet(operation, model); } }
@Override protected final void performRuntime(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { if (context.isBooting()) { context.addStep(new DeploymentChainStep(this.deploymentChainContributor), OperationContext.Stage.RUNTIME); super.performRuntime(context, operation, resource); } else { context.reloadRequired(); } }