public class SecurityRealmChildWriteAttributeHandler extends RestartParentWriteAttributeHandler
AbstractWriteAttributeHandler.HandbackHolder<T>
Constructor and Description |
---|
SecurityRealmChildWriteAttributeHandler(AttributeDefinition... attributes) |
Modifier and Type | Method and Description |
---|---|
protected org.jboss.msc.service.ServiceName |
getParentServiceName(PathAddress parentAddress) |
protected boolean |
isResourceServiceRestartAllowed(OperationContext context,
org.jboss.msc.service.ServiceController<?> service)
Gets whether a restart of the parent resource's services is allowed.
|
protected void |
recreateParentService(OperationContext context,
PathAddress parentAddress,
org.jboss.dmr.ModelNode parentModel)
Recreate the parent service(s) using the given model.
|
protected void |
removeServices(OperationContext context,
org.jboss.msc.service.ServiceName parentService,
org.jboss.dmr.ModelNode parentModel)
Removes services.
|
protected boolean |
requiresRuntime(OperationContext context)
Gets whether a
OperationContext.Stage.RUNTIME handler should be added. |
applyUpdateToRuntime, getParentAddress, recreateParentService, revertUpdateToRuntime
execute, finishModelStage, getAttributeDefinition, recordCapabilitiesAndRequirements, validateUpdatedModel
public SecurityRealmChildWriteAttributeHandler(AttributeDefinition... attributes)
protected boolean requiresRuntime(OperationContext context)
AbstractWriteAttributeHandler
OperationContext.Stage.RUNTIME
handler should be added. This default implementation
returns true if the process is a normal server
and the process
is not booting
. The rationale for the latter check is if the process is
booting, the resource being modified will have been added as a previous step in the same context, and
the Stage.RUNTIME handling for that add will see a model the reflects the changes made by this handler and
will apply them to the runtime.requiresRuntime
in class AbstractWriteAttributeHandler<org.jboss.dmr.ModelNode>
context
- operation contexttrue
if a runtime stage handler should be added; false
otherwise.protected boolean isResourceServiceRestartAllowed(OperationContext context, org.jboss.msc.service.ServiceController<?> service)
RestartParentWriteAttributeHandler
the context allows resource service restarts
;
subclasses could also check the state of the service
.isResourceServiceRestartAllowed
in class RestartParentWriteAttributeHandler
context
- the operation contextservice
- the parent servicetrue
if a restart is allowed; false
protected void removeServices(OperationContext context, org.jboss.msc.service.ServiceName parentService, org.jboss.dmr.ModelNode parentModel) throws OperationFailedException
RestartParentWriteAttributeHandler
instructs the context to remove the parentService
.
Subclasses could use the provided parentModel
to identify and remove other services.removeServices
in class RestartParentWriteAttributeHandler
context
- the operation contextparentService
- the name of the parent serviceparentModel
- the model associated with the parent resource, including nodes for any child resourcesOperationFailedException
- if there is a problem removing the servicesprotected void recreateParentService(OperationContext context, PathAddress parentAddress, org.jboss.dmr.ModelNode parentModel) throws OperationFailedException
RestartParentWriteAttributeHandler
To provide compatible behavior with previous releases, this default implementation calls the deprecated
RestartParentWriteAttributeHandler.recreateParentService(OperationContext, PathAddress, org.jboss.dmr.ModelNode, ServiceVerificationHandler)
method. It then does nothing with the objects referenced by the verificationHandler
parameter passed to
that method. Subclasses that overrode that method are encouraged to instead override this one.
Subclasses that override this method should not callsuper.recreateParentService(...)
.
recreateParentService
in class RestartParentWriteAttributeHandler
context
- the operation contextparentAddress
- the address of the parent resourceparentModel
- the current configuration model for the parent resource and its childrenOperationFailedException
- if there is a problem installing the servicesprotected org.jboss.msc.service.ServiceName getParentServiceName(PathAddress parentAddress)
getParentServiceName
in class RestartParentWriteAttributeHandler
Copyright © 2023 JBoss by Red Hat. All rights reserved.