Class GenericSubsystemDescribeHandler
- java.lang.Object
-
- org.jboss.as.controller.operations.common.GenericSubsystemDescribeHandler
-
- All Implemented Interfaces:
DescriptionProvider
,OperationStepHandler
- Direct Known Subclasses:
UnsupportedSubsystemDescribeHandler
public class GenericSubsystemDescribeHandler extends Object implements OperationStepHandler, DescriptionProvider
A generic handler recursively creating add operations for a managed resource using it's attributes as the request-parameters.- Author:
- Emanuel Muckenhuber
-
-
Field Summary
Fields Modifier and Type Field Description static SimpleOperationDefinition
DEFINITION
static Set<Action.ActionEffect>
DESCRIBE_EFFECTS
static GenericSubsystemDescribeHandler
INSTANCE
static OperationContext.AttachmentKey<Boolean>
SERVER_LAUNCH_KEY
Operation attachment key used when the describe operation is being invoked in order to create the operations to launch a server
-
Constructor Summary
Constructors Modifier Constructor Description protected
GenericSubsystemDescribeHandler()
protected
GenericSubsystemDescribeHandler(Comparator<PathElement> comparator)
Creates a new describe handler.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static GenericSubsystemDescribeHandler
create(Comparator<PathElement> comparator)
Creates a new describe handler.protected org.jboss.dmr.ModelNode
createAddOperation(OrderedChildTypesAttachment orderedChildTypesAttachment, org.jboss.dmr.ModelNode address, Resource resource, Set<PathElement> children)
protected org.jboss.dmr.ModelNode
createAddOperation(org.jboss.dmr.ModelNode address, org.jboss.dmr.ModelNode subModel, Set<PathElement> children)
protected void
describe(OrderedChildTypesAttachment orderedChildTypesAttachment, Resource resource, org.jboss.dmr.ModelNode address, org.jboss.dmr.ModelNode result, ImmutableManagementResourceRegistration registration)
void
execute(OperationContext context, org.jboss.dmr.ModelNode operation)
Execute this step.org.jboss.dmr.ModelNode
getModelDescription(Locale locale)
Deprecated.useDEFINITION
for registration of operation
-
-
-
Field Detail
-
INSTANCE
public static final GenericSubsystemDescribeHandler INSTANCE
-
DEFINITION
public static final SimpleOperationDefinition DEFINITION
-
DESCRIBE_EFFECTS
public static final Set<Action.ActionEffect> DESCRIBE_EFFECTS
-
SERVER_LAUNCH_KEY
public static final OperationContext.AttachmentKey<Boolean> SERVER_LAUNCH_KEY
Operation attachment key used when the describe operation is being invoked in order to create the operations to launch a server
-
-
Constructor Detail
-
GenericSubsystemDescribeHandler
protected GenericSubsystemDescribeHandler()
-
GenericSubsystemDescribeHandler
protected GenericSubsystemDescribeHandler(Comparator<PathElement> comparator)
Creates a new describe handler. If the comparator is notnull
as the handler describes children of a resource the order in which those children are described is determined using the comparator. This allows the result to order the add operations for the child resources. If the comparator isnull
the order for the child resources is not guaranteed, other than that all children of a given type will be processed in the order of child names returned byResource.getChildren(String)
invoked on the parent.- Parameters:
comparator
- the comparator used to sort the child addresses
-
-
Method Detail
-
create
public static GenericSubsystemDescribeHandler create(Comparator<PathElement> comparator)
Creates a new describe handler. If the comparator is notnull
as the handler describes children of a resource the order in which those children are described is determined using the comparator. This allows the result to order the add operations for the child resources. If the comparator isnull
the order for the child resources is not guaranteed, other than that all children of a given type will be processed in the order of child names returned byResource.getChildren(String)
invoked on the parent.- Parameters:
comparator
- the comparator used to sort the child addresses
-
execute
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
Description copied from interface:OperationStepHandler
Execute this step. If the operation fails,context.getFailureDescription()
must be called, or anOperationFailedException
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 thecontext.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.- Specified by:
execute
in interfaceOperationStepHandler
- Parameters:
context
- the operation contextoperation
- the operation being executed- Throws:
OperationFailedException
- if the operation failed before callingcontext.completeStep()
-
describe
protected void describe(OrderedChildTypesAttachment orderedChildTypesAttachment, Resource resource, org.jboss.dmr.ModelNode address, org.jboss.dmr.ModelNode result, ImmutableManagementResourceRegistration registration)
-
createAddOperation
protected org.jboss.dmr.ModelNode createAddOperation(OrderedChildTypesAttachment orderedChildTypesAttachment, org.jboss.dmr.ModelNode address, Resource resource, Set<PathElement> children)
-
createAddOperation
protected org.jboss.dmr.ModelNode createAddOperation(org.jboss.dmr.ModelNode address, org.jboss.dmr.ModelNode subModel, Set<PathElement> children)
-
getModelDescription
public org.jboss.dmr.ModelNode getModelDescription(Locale locale)
Deprecated.useDEFINITION
for registration of operationDescription copied from interface:DescriptionProvider
Gets the descriptive information (human-friendly description, list of attributes, list of children) describing a single model node or operation.The implementation must assume that the caller intends to modify the returned
ModelNode
so it should not hand out a reference to any internal data structures.- Specified by:
getModelDescription
in interfaceDescriptionProvider
- Parameters:
locale
- the locale to use to generate any localized text used in the description. May benull
, in which caseLocale.getDefault()
should be used- Returns:
- definition of operation
-
-