public abstract class AbstractBoottimeAddStepHandler extends AbstractAddStepHandler
OperationStepHandler
implementations that add managed resources and also perform runtime
processing that should only occur during server boot. An example of such processing would be installing a
deployment unit processor.
Do not extend this class for operations that can run after server boot. Typically it should only be extended for operations that add a deployment unit processor.
If an operation handled via an extension of this class is executed on a server after boot, the server's persistent
configuration model will be updated, but the
performBoottime
method will not be invoked. Instead the server will be put into "reload required" state
.
AbstractAddStepHandler.Parameters
attributes
Modifier | Constructor and Description |
---|---|
protected |
AbstractBoottimeAddStepHandler() |
|
AbstractBoottimeAddStepHandler(AbstractAddStepHandler.Parameters parameters) |
protected |
AbstractBoottimeAddStepHandler(AttributeDefinition... attributes) |
protected |
AbstractBoottimeAddStepHandler(Collection<? extends AttributeDefinition> attributes) |
protected |
AbstractBoottimeAddStepHandler(RuntimeCapability capability,
AttributeDefinition... attributes)
Deprecated.
|
protected |
AbstractBoottimeAddStepHandler(RuntimeCapability capability,
Collection<? extends AttributeDefinition> attributes)
Deprecated.
|
protected |
AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities,
AttributeDefinition... attributes)
Deprecated.
|
protected |
AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities,
Collection<? extends AttributeDefinition> attributes)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected void |
performBoottime(OperationContext context,
org.jboss.dmr.ModelNode operation,
org.jboss.dmr.ModelNode model)
Make any runtime changes necessary to effect the changes indicated by the given
operation . |
protected void |
performBoottime(OperationContext context,
org.jboss.dmr.ModelNode operation,
Resource resource)
Make any runtime changes necessary to effect the changes indicated by the given
operation . |
protected void |
performRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
Resource resource)
If
OperationContext.isBooting() returns true , invokes
performBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource) ,
else invokes OperationContext.reloadRequired() . |
protected void |
rollbackRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
org.jboss.dmr.ModelNode model,
List<org.jboss.msc.service.ServiceController<?>> controllers)
Deprecated.
|
protected void |
rollbackRuntime(OperationContext context,
org.jboss.dmr.ModelNode operation,
Resource resource)
Overrides the superclass to call
OperationContext.revertReloadRequired()
if OperationContext.isBooting() returns false . |
createResource, createResource, execute, performRuntime, populateModel, populateModel, populateModel, recordCapabilitiesAndRequirements, requiresRuntime
protected AbstractBoottimeAddStepHandler()
protected AbstractBoottimeAddStepHandler(Collection<? extends AttributeDefinition> attributes)
@Deprecated protected AbstractBoottimeAddStepHandler(RuntimeCapability capability, Collection<? extends AttributeDefinition> attributes)
@Deprecated protected AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities, Collection<? extends AttributeDefinition> attributes)
@Deprecated protected AbstractBoottimeAddStepHandler(RuntimeCapability capability, AttributeDefinition... attributes)
protected AbstractBoottimeAddStepHandler(AttributeDefinition... attributes)
@Deprecated protected AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities, AttributeDefinition... attributes)
public AbstractBoottimeAddStepHandler(AbstractAddStepHandler.Parameters parameters)
protected final void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
OperationContext.isBooting()
returns true
, invokes
performBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
,
else invokes OperationContext.reloadRequired()
.
Make any runtime changes necessary to effect the changes indicated by the given 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
OperationFailedException
- if operation
is invalid or updating the runtime otherwise failsprotected void performBoottime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
operation
. Will only be
invoked if OperationContext.isBooting()
returns true
. 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 this method or the
performBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
variant.
This default implementation simply calls the
performBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
variant.
Subclasses that override this method should not callsuper.performBoottime(...)
.
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration resource that corresponds to the address of operation
OperationFailedException
- if operation
is invalid or updating the runtime otherwise failsprotected void performBoottime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
operation
. Will only be
invoked if OperationContext.isBooting()
returns true
. 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 this method or the
performBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
variant.context
- the operation contextoperation
- the operation being executedmodel
- persistent configuration model from the resource that corresponds to the address of operation
OperationFailedException
- if operation
is invalid or updating the runtime otherwise failsprotected void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
OperationContext.revertReloadRequired()
if OperationContext.isBooting()
returns false
.
Rollback runtime changes made in 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
@Deprecated protected void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model, List<org.jboss.msc.service.ServiceController<?>> controllers)
OperationContext.revertReloadRequired()
if OperationContext.isBooting()
returns false
.
Deprecated. Subclasses wishing for custom rollback behavior should instead override
AbstractAddStepHandler.rollbackRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
.
This default implementation does nothing. Subclasses that override this method should not call
super.performRuntime(...)
.
rollbackRuntime
in class AbstractAddStepHandler
context
- the operation contextoperation
- the operation being executedmodel
- persistent configuration model node that corresponds to the address of operation
controllers
- will always be an empty listCopyright © 2019 JBoss by Red Hat. All rights reserved.