Package org.jboss.as.controller
Class ModelOnlyAddStepHandler
- java.lang.Object
-
- org.jboss.as.controller.AbstractAddStepHandler
-
- org.jboss.as.controller.ModelOnlyAddStepHandler
-
- All Implemented Interfaces:
OperationDescriptor
,OperationStepHandler
public class ModelOnlyAddStepHandler extends AbstractAddStepHandler
A handler for theadd
operation that only manipulates the model. The original expected use is for resources that have been dropped from recent versions, but for which configuration manageablity is retained in order to allow use on legacy hosts in a managed domain. This handler would be used on the host controllers for the newer version nodes (particularly the master host controller.)- Author:
- Brian Stansberry (c) 2012 Red Hat Inc.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.jboss.as.controller.AbstractAddStepHandler
AbstractAddStepHandler.Parameters
-
-
Field Summary
Fields Modifier and Type Field Description static OperationStepHandler
INSTANCE
-
Fields inherited from class org.jboss.as.controller.AbstractAddStepHandler
attributes
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ModelOnlyAddStepHandler()
ModelOnlyAddStepHandler(AbstractAddStepHandler.Parameters parameters)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.ModelOnlyAddStepHandler(AttributeDefinition... attributes)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 givenoperation
.protected boolean
requiresRuntime(OperationContext context)
Returnsfalse
.protected void
rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Rollback runtime changes made inAbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
.-
Methods inherited from class org.jboss.as.controller.AbstractAddStepHandler
createResource, createResource, execute, getAttributes, performRuntime, populateModel, populateModel, populateModel, recordCapabilitiesAndRequirements
-
-
-
-
Field Detail
-
INSTANCE
public static final OperationStepHandler INSTANCE
-
-
Constructor Detail
-
ModelOnlyAddStepHandler
protected ModelOnlyAddStepHandler()
-
ModelOnlyAddStepHandler
@Deprecated(forRemoval=true) public ModelOnlyAddStepHandler(AttributeDefinition... attributes)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.
-
ModelOnlyAddStepHandler
@Deprecated(forRemoval=true) public ModelOnlyAddStepHandler(AbstractAddStepHandler.Parameters parameters)
Deprecated, for removal: This API element is subject to removal in a future version.UseINSTANCE
instead.
-
-
Method Detail
-
requiresRuntime
protected final boolean requiresRuntime(OperationContext context)
Returnsfalse
. Gets whether aOperationContext.Stage.RUNTIME
step should be added to callAbstractAddStepHandler.performRuntime(OperationContext, org.jboss.dmr.ModelNode, org.jboss.as.controller.registry.Resource)
}. This default implementation will returntrue
for a normal server running in normal (non admin-only) mode. If running on a host controller, it will returntrue
if it is the active copy of the host controller subsystem. Subclasses that perform no runtime update could override and returnfalse
. This method is invoked duringOperationContext.Stage.MODEL
.- Overrides:
requiresRuntime
in classAbstractAddStepHandler
- Parameters:
context
- operation context- Returns:
true
ifperformRuntime
should be invoked;false
otherwise.
-
performRuntime
protected final void performRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource) throws OperationFailedException
Description copied from class:AbstractAddStepHandler
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
-
rollbackRuntime
protected final void rollbackRuntime(OperationContext context, org.jboss.dmr.ModelNode operation, Resource resource)
Description copied from class:AbstractAddStepHandler
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(...)
.- Overrides:
rollbackRuntime
in classAbstractAddStepHandler
- Parameters:
context
- the operation contextoperation
- the operation being executedresource
- persistent configuration model node that corresponds to the address ofoperation
-
-