public class ReloadRequiredAddStepHandler extends AbstractAddStepHandler
runtime stage
but put the process in
reload-required state. It does nothing at all in the runtime stage during boot.
Use case for this handler is for resources that only represent configuration data of their parent. During boot in the runtime stage the parent reads the child model and configures its services accordingly. Thereafter any change to the child model should put the process in reload-required.
The RestartParentResourceAddHandler
performs a similar function, but
allows restart of the parent resource.
RestartParentResourceAddHandler
AbstractAddStepHandler.Parameters
attributes
Constructor and Description |
---|
ReloadRequiredAddStepHandler(AbstractAddStepHandler.Parameters parameters) |
ReloadRequiredAddStepHandler(AttributeDefinition... attributes) |
ReloadRequiredAddStepHandler(Collection<AttributeDefinition> attributes) |
ReloadRequiredAddStepHandler(RuntimeCapability capability,
AttributeDefinition... attributes)
Deprecated.
|
ReloadRequiredAddStepHandler(Set<RuntimeCapability> capabilities,
Collection<AttributeDefinition> attributes)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
performRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
Resource resource)
Make any runtime changes necessary to effect the changes indicated by the given
operation . |
protected boolean |
requiresRuntime(OperationContext context)
Gets whether a
OperationContext.Stage.RUNTIME step should be added to call
AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource) }. |
protected void |
rollbackRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
Resource resource)
Rollback runtime changes made in
AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource) . |
createResource, createResource, execute, getAttributes, performRuntime, populateModel, populateModel, populateModel, recordCapabilitiesAndRequirements, rollbackRuntime
public ReloadRequiredAddStepHandler(AttributeDefinition... attributes)
public ReloadRequiredAddStepHandler(Collection<AttributeDefinition> attributes)
@Deprecated public ReloadRequiredAddStepHandler(RuntimeCapability capability, AttributeDefinition... attributes)
@Deprecated public ReloadRequiredAddStepHandler(Set<RuntimeCapability> capabilities, Collection<AttributeDefinition> attributes)
public ReloadRequiredAddStepHandler(AbstractAddStepHandler.Parameters parameters)
protected boolean requiresRuntime(OperationContext context)
AbstractAddStepHandler
OperationContext.Stage.RUNTIME
step should be added to call
AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
}.
This default implementation will return true
for a normal server running in normal (non admin-only) mode.
If running on a host controller, it will return true
if it is the active copy of the host controller subsystem.
Subclasses that perform no runtime update could override and return false
. This method is
invoked during OperationContext.Stage.MODEL
.requiresRuntime
in class AbstractAddStepHandler
context
- operation contexttrue
if performRuntime
should be invoked; false
otherwise.protected void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
AbstractAddStepHandler
operation
. Executes
after AbstractAddStepHandler.populateModel(org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
, so the given resource
parameter will reflect any changes made in that method. This method is
invoked during OperationContext.Stage.RUNTIME
. Subclasses that wish to make
changes to runtime services should override either this method or the
AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
variant. Override
this one if you wish to make use of the resource
parameter beyond simply
accessing its model property
.
This default implementation simply calls the
AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
variant.
Subclasses that override this method should not call super.performRuntime(...)
.
performRuntime
in class AbstractAddStepHandler
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration resource that corresponds to the address of operation
protected void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
AbstractAddStepHandler
AbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
.
Any services that were added in OperationContext.Stage.RUNTIME
will be automatically removed after this
method executes. Called from the OperationContext.ResultHandler
or
OperationContext.RollbackHandler
passed to OperationContext.completeStep(...)
.
To provide compatible behavior with previous releases, this default implementation calls the deprecated
AbstractAddStepHandler.rollbackRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode, java.util.List)
variant, passing in an empty list for the controllers
parameter. Subclasses that overrode that method are
encouraged to instead override this one. Subclasses that override this method should not call
super.rollbackRuntime(...).
rollbackRuntime
in class AbstractAddStepHandler
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration model node that corresponds to the address of operation
Copyright © 2020 JBoss by Red Hat. All rights reserved.