@Override protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { this.handler.installServices(context, model); } else { context.revertReloadRequired(); } }
protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { HostAdd.INSTANCE.performRuntime(context, operation, model); } else { context.revertReloadRequired(); } } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { this.handler.removeServices(context, model); } else { context.reloadRequired(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { super.performRuntime(context, operation, model); if (context.isResourceServiceRestartAllowed()) { String cacheType = SecurityDomainAdd.getAuthenticationCacheType(model); String securityDomain = context.getCurrentAddressValue(); if (SecurityDomainResourceDefinition.INFINISPAN_CACHE_TYPE.equals(cacheType)) { for (org.wildfly.clustering.infinispan.spi.InfinispanCacheRequirement requirement : EnumSet.allOf(org.wildfly.clustering.infinispan.spi.InfinispanCacheRequirement.class)) { context.removeService(requirement.getServiceName(context, CACHE_CONTAINER_NAME, securityDomain)); } } } } })
@Override protected void revertUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode valueToRestore, ModelNode resolvedValue, Void handback) throws OperationFailedException { PathAddress address = context.getCurrentAddress(); if (context.isResourceServiceRestartAllowed() && this.getAttributeDefinition(attributeName).getFlags().contains(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) && context.revertResourceRestarted(address, this.handler)) { this.restartServices(context); } }
@Override protected boolean applyUpdateToRuntime(OperationContext context, ModelNode operation, String attributeName, ModelNode resolvedValue, ModelNode currentValue, HandbackHolder<Void> handback) throws OperationFailedException { boolean updated = super.applyUpdateToRuntime(context, operation, attributeName, resolvedValue, currentValue, handback); if (updated) { PathAddress address = context.getCurrentAddress(); if (context.isResourceServiceRestartAllowed() && this.getAttributeDefinition(attributeName).getFlags().contains(AttributeAccess.Flag.RESTART_RESOURCE_SERVICES) && context.markResourceRestarted(address, this.handler)) { this.restartServices(context); // Returning false prevents going into reload required state return false; } } return updated; }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { final ModelNode address = operation.require(OP_ADDR); final PathAddress path = PathAddress.pathAddress(address); final String jndiName = path.getElement(path.size() - 2).getValue(); final String configPropertyName = PathAddress.pathAddress(address).getLastElement().getValue(); ServiceName configPropertyServiceName = XADataSourceConfigService.SERVICE_NAME_BASE.append(jndiName). append("xa-datasource-properties").append(configPropertyName); context.removeService(configPropertyServiceName); } else { context.reloadRequired(); } } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { final ModelNode address = operation.require(OP_ADDR); final PathAddress path = PathAddress.pathAddress(address); final String jndiName = path.getElement(path.size() - 2).getValue(); final String configPropertyName = PathAddress.pathAddress(address).getLastElement().getValue(); ServiceName configPropertyServiceName = DataSourceConfigService.SERVICE_NAME_BASE.append(jndiName) .append("connection-properties").append(configPropertyName); context.removeService(configPropertyServiceName); } else { context.reloadRequired(); } } }
if (context.isResourceServiceRestartAllowed()) { final ModelNode address = operation.require(OP_ADDR); final String dsName = PathAddress.pathAddress(address).getLastElement().getValue();
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { super.performRuntime(context, operation, model); if (context.isResourceServiceRestartAllowed()) { final String securityDomainName = context.getCurrentAddressValue(); context.removeService(new SingleSignOnManagerServiceNameProvider(securityDomainName).getServiceName()); context.removeService(new SingleSignOnSessionFactoryServiceNameProvider(securityDomainName).getServiceName()); } }
if (!context.isResourceServiceRestartAllowed()) { context.reloadRequired(); context.completeStep(new OperationContext.RollbackHandler() {
/** * Gets whether a restart of the parent resource's services is allowed. This default implementation * checks whether {@link OperationContext#isResourceServiceRestartAllowed() the context allows resource service restarts}; * subclasses could also check the state of the {@code service}. * * @param context the operation context * @param service the parent service * @return {@code true} if a restart is allowed; {@code false} */ protected boolean isResourceServiceRestartAllowed(final OperationContext context, final ServiceController<?> service) { return context.isResourceServiceRestartAllowed(); }
/** * Gets whether a restart of the parent resource's services is allowed. This default implementation * checks whether {@link OperationContext#isResourceServiceRestartAllowed() the context allows resource service restarts}; * subclasses could also check the state of the {@code service}. * * @param context the operation context * @param service the parent service * @return {@code true} if a restart is allowed; {@code false} */ protected boolean isResourceServiceRestartAllowed(final OperationContext context, final ServiceController<?> service) { return context.isResourceServiceRestartAllowed(); }
/** * Gets whether a restart of the parent resource's services is allowed. This default implementation * checks whether {@link OperationContext#isResourceServiceRestartAllowed() the context allows resource service restarts}; * subclasses could also check the state of the {@code service}. * * @param context the operation context * @param service the parent service * @return {@code true} if a restart is allowed; {@code false} */ protected boolean isResourceServiceRestartAllowed(final OperationContext context, final ServiceController<?> service) { return context.isResourceServiceRestartAllowed(); }
/** * Gets whether a restart of the parent resource's services is allowed. This default implementation * checks whether {@link OperationContext#isResourceServiceRestartAllowed() the context allows resource service restarts}; * subclasses could also check the state of the {@code service}. * * @param context the operation context * @param service the parent service * @return {@code true} if a restart is allowed; {@code false} */ protected boolean isResourceServiceRestartAllowed(final OperationContext context, final ServiceController<?> service) { return context.isResourceServiceRestartAllowed(); }
protected void recoverServices(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { HostAdd.INSTANCE.performRuntime(context, operation, model); } else { context.revertReloadRequired(); } } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { removeRuntimeService(context, operation); } else { context.reloadRequired(); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) throws OperationFailedException { if (context.isResourceServiceRestartAllowed()) { removeRuntimeService(context, operation); } else { context.reloadRequired(); } }
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { String name = context.getCurrentAddressValue(); ServiceName svcName = SOCKET_BINDING_CAPABILITY.getCapabilityServiceName(name); ServiceRegistry registry = context.getServiceRegistry(true); ServiceController<?> controller = registry.getService(svcName); ServiceController.State state = controller == null ? null : controller.getState(); if (!context.isResourceServiceRestartAllowed() || (state == ServiceController.State.UP)) { context.reloadRequired(); } else { context.removeService(svcName); } }
@Override protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model) { super.performRuntime(context, operation, model); if (context.isResourceServiceRestartAllowed()) { final String securityDomainName = context.getCurrentAddressValue(); context.removeService(new SingleSignOnManagerServiceNameProvider(securityDomainName).getServiceName()); context.removeService(new SingleSignOnSessionFactoryServiceNameProvider(securityDomainName).getServiceName()); } }