public abstract class AbstractRuntimeOnlyHandler extends Object implements OperationStepHandler
OperationContext.Stage.MODEL
except
register a OperationContext.Stage.RUNTIME
step.Constructor and Description |
---|
AbstractRuntimeOnlyHandler() |
Modifier and Type | Method and Description |
---|---|
void |
execute(OperationContext context,
org.jboss.dmr.ModelNode operation)
Simply adds a
OperationContext.Stage.RUNTIME step that calls
executeRuntimeStep(OperationContext, ModelNode) . |
protected abstract void |
executeRuntimeStep(OperationContext context,
org.jboss.dmr.ModelNode operation)
Execute this step in
OperationContext.Stage.RUNTIME . |
protected boolean |
resourceMustExist(OperationContext context,
org.jboss.dmr.ModelNode operation)
By default the handler will check whether the resource exist before calling @{link #executeRuntimeStep(OperationContext, ModelNode)}.
|
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
OperationContext.Stage.RUNTIME
step that calls
executeRuntimeStep(OperationContext, ModelNode)
.
Execute this step. If the operation fails, context.getFailureDescription()
must be called, or an OperationFailedException
must be thrown.
If the operation succeeded and the operation provides a return value, context.getResult()
should
be called and the result populated with the outcome. If the handler wishes to take further action once the result
of the overall operation execution is known, one of the
context.completeStep variants
should be called to register a callback. The callback will not be invoked if this method throws an exception.
When this method is invoked the thread context classloader
will
be set to be the defining class loader of the class that implements this interface.
execute
in interface OperationStepHandler
context
- the operation contextoperation
- the operation being executedOperationFailedException
- if the operation failed before calling context.completeStep()
protected boolean resourceMustExist(OperationContext context, org.jboss.dmr.ModelNode operation)
context
- the operation contextoperation
- the operation being executedprotected abstract void executeRuntimeStep(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
OperationContext.Stage.RUNTIME
.
If the operation fails, context.getFailureDescroption()
must be called, or OperationFailedException
must be thrown, before calling one of the
context.completeStep variants
.
If the operation succeeded, context.getResult()
should
be called and the result populated with the outcome, after which one of the
context.completeStep variants
must be called.context
- the operation contextoperation
- the operation being executedOperationFailedException
- if the operation failed before calling context.completeStep()
Copyright © 2023 JBoss by Red Hat. All rights reserved.