Class AbstractBoottimeAddStepHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractAddStepHandler
-
- org.jboss.as.controller.AbstractBoottimeAddStepHandler
-
- All Implemented Interfaces:
OperationDescriptor
,OperationStepHandler
public abstract class AbstractBoottimeAddStepHandler extends AbstractAddStepHandler
Base class forOperationStepHandler
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 beput into "reload required" state
.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.as.controller.AbstractAddStepHandler
AbstractAddStepHandler.Parameters
-
-
Field Summary
-
Fields inherited from class org.jboss.as.controller.AbstractAddStepHandler
attributes
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBoottimeAddStepHandler()
protected
AbstractBoottimeAddStepHandler(Collection<? extends AttributeDefinition> attributes)
protected
AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities, Collection<? extends AttributeDefinition> attributes)
Deprecated.protected
AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities, AttributeDefinition... attributes)
Deprecated.AbstractBoottimeAddStepHandler(AbstractAddStepHandler.Parameters parameters)
protected
AbstractBoottimeAddStepHandler(AttributeDefinition... attributes)
protected
AbstractBoottimeAddStepHandler(RuntimeCapability capability, Collection<? extends AttributeDefinition> attributes)
Deprecated.protected
AbstractBoottimeAddStepHandler(RuntimeCapability capability, AttributeDefinition... attributes)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
performBoottime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Make any runtime changes necessary to effect the changes indicated by the givenoperation
.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 givenoperation
.protected void
performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
IfOperationContext.isBooting()
returnstrue
, invokesperformBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
, else invokesOperationContext.reloadRequired()
.protected void
rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Overrides the superclass to callOperationContext.revertReloadRequired()
ifOperationContext.isBooting()
returnsfalse
.protected void
rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model, List<org.jboss.msc.service.ServiceController<?>> controllers)
Deprecated.-
Methods inherited from class org.jboss.as.controller.AbstractAddStepHandler
createResource, createResource, execute, getAttributes, performRuntime, populateModel, populateModel, populateModel, recordCapabilitiesAndRequirements, requiresRuntime
-
-
-
-
Constructor Detail
-
AbstractBoottimeAddStepHandler
protected AbstractBoottimeAddStepHandler()
-
AbstractBoottimeAddStepHandler
protected AbstractBoottimeAddStepHandler(Collection<? extends AttributeDefinition> attributes)
-
AbstractBoottimeAddStepHandler
@Deprecated protected AbstractBoottimeAddStepHandler(RuntimeCapability capability, Collection<? extends AttributeDefinition> attributes)
Deprecated.
-
AbstractBoottimeAddStepHandler
@Deprecated protected AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities, Collection<? extends AttributeDefinition> attributes)
Deprecated.
-
AbstractBoottimeAddStepHandler
@Deprecated protected AbstractBoottimeAddStepHandler(RuntimeCapability capability, AttributeDefinition... attributes)
Deprecated.
-
AbstractBoottimeAddStepHandler
protected AbstractBoottimeAddStepHandler(AttributeDefinition... attributes)
-
AbstractBoottimeAddStepHandler
@Deprecated protected AbstractBoottimeAddStepHandler(Set<RuntimeCapability> capabilities, AttributeDefinition... attributes)
Deprecated.
-
AbstractBoottimeAddStepHandler
public AbstractBoottimeAddStepHandler(AbstractAddStepHandler.Parameters parameters)
-
-
Method Detail
-
performRuntime
protected final void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
IfOperationContext.isBooting()
returnstrue
, invokesperformBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
, else invokesOperationContext.reloadRequired()
. Make any runtime changes necessary to effect the changes indicated by the givenoperation
. Executes afterAbstractAddStepHandler.populateModel(org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
, so the givenresource
parameter will reflect any changes made in that method. This method is invoked duringOperationContext.Stage.RUNTIME
. Subclasses that wish to make changes to runtime services should override either this method or theAbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
variant. Override this one if you wish to make use of theresource
parameter beyond simplyaccessing 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 callsuper.performRuntime(...)
.- Overrides:
performRuntime
in classAbstractAddStepHandler
- Parameters:
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration resource that corresponds to the address ofoperation
- Throws:
OperationFailedException
- ifoperation
is invalid or updating the runtime otherwise fails
-
performBoottime
protected void performBoottime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
Make any runtime changes necessary to effect the changes indicated by the givenoperation
. Will only be invoked ifOperationContext.isBooting()
returnstrue
. Executes afterAbstractAddStepHandler.populateModel(org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
, so the givenresource
parameter will reflect any changes made in that method. This method is invoked duringOperationContext.Stage.RUNTIME
. Subclasses that wish to make changes to runtime services should override this method or theperformBoottime(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(...)
.- Parameters:
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration resource that corresponds to the address ofoperation
- Throws:
OperationFailedException
- ifoperation
is invalid or updating the runtime otherwise fails
-
performBoottime
protected void performBoottime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model) throws OperationFailedException
Make any runtime changes necessary to effect the changes indicated by the givenoperation
. Will only be invoked ifOperationContext.isBooting()
returnstrue
. Executes afterAbstractAddStepHandler.populateModel(org.jboss.dmr.ModelNode, org.jboss.dmr.ModelNode)
, so the givenresource
parameter will reflect any changes made in that method. This method is invoked duringOperationContext.Stage.RUNTIME
. Subclasses that wish to make changes to runtime services should override this method or theperformBoottime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
variant.- Parameters:
context
- the operation contextoperation
- the operation being executedmodel
- persistent configuration model from the resource that corresponds to the address ofoperation
- Throws:
OperationFailedException
- ifoperation
is invalid or updating the runtime otherwise fails
-
rollbackRuntime
protected void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Overrides the superclass to callOperationContext.revertReloadRequired()
ifOperationContext.isBooting()
returnsfalse
. Rollback runtime changes made inAbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
. Any services that were added inOperationContext.Stage.RUNTIME
will be automatically removed after this method executes. Called from theOperationContext.ResultHandler
orOperationContext.RollbackHandler
passed toOperationContext.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 thecontrollers
parameter. Subclasses that overrode that method are encouraged to instead override this one. Subclasses that override this method should not callsuper.rollbackRuntime(...).
- Overrides:
rollbackRuntime
in classAbstractAddStepHandler
- Parameters:
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration model node that corresponds to the address ofoperation
-
rollbackRuntime
@Deprecated protected void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, org.jboss.dmr.ModelNode model, List<org.jboss.msc.service.ServiceController<?>> controllers)
Deprecated.Deprecated. Overrides the superclass to callOperationContext.revertReloadRequired()
ifOperationContext.isBooting()
returnsfalse
. Deprecated. Subclasses wishing for custom rollback behavior should instead overrideAbstractAddStepHandler.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(...)
.- Overrides:
rollbackRuntime
in classAbstractAddStepHandler
- Parameters:
context
- the operation contextoperation
- the operation being executedmodel
- persistent configuration model node that corresponds to the address ofoperation
controllers
- will always be an empty list
-
-