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
FieldsModifier and TypeFieldDescriptionstatic final SimpleOperationDefinitionstatic final Set<Action.ActionEffect>static final GenericSubsystemDescribeHandlerstatic final OperationContext.AttachmentKey<Boolean>Operation attachment key used when the describe operation is being invoked in order to create the operations to launch a server -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedGenericSubsystemDescribeHandler(Comparator<PathElement> comparator) Creates a new describe handler. -
Method Summary
Modifier and TypeMethodDescriptioncreate(Comparator<PathElement> comparator) Creates a new describe handler.protected org.jboss.dmr.ModelNodecreateAddOperation(OrderedChildTypesAttachment orderedChildTypesAttachment, org.jboss.dmr.ModelNode address, Resource resource, Set<PathElement> children) protected org.jboss.dmr.ModelNodecreateAddOperation(org.jboss.dmr.ModelNode address, org.jboss.dmr.ModelNode subModel, Set<PathElement> children) protected voiddescribe(OrderedChildTypesAttachment orderedChildTypesAttachment, Resource resource, org.jboss.dmr.ModelNode address, org.jboss.dmr.ModelNode result, ImmutableManagementResourceRegistration registration) voidexecute(OperationContext context, org.jboss.dmr.ModelNode operation) Execute this step.org.jboss.dmr.ModelNodegetModelDescription(Locale locale) Deprecated.
-
Field Details
-
INSTANCE
-
DEFINITION
-
DESCRIBE_EFFECTS
-
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 Details
-
GenericSubsystemDescribeHandler
protected GenericSubsystemDescribeHandler() -
GenericSubsystemDescribeHandler
Creates a new describe handler. If the comparator is notnullas 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 isnullthe 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 Details
-
create
Creates a new describe handler. If the comparator is notnullas 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 isnullthe 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:OperationStepHandlerExecute this step. If the operation fails,context.getFailureDescription()must be called, or anOperationFailedExceptionmust 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 variantsshould 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 classloaderwill be set to be the defining class loader of the class that implements this interface.- Specified by:
executein 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
Deprecated.useDEFINITIONfor registration of operationDescription copied from interface:DescriptionProviderGets 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
ModelNodeso it should not hand out a reference to any internal data structures.- Specified by:
getModelDescriptionin 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
-
DEFINITIONfor registration of operation