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 Details

  • Constructor Details

    • GenericSubsystemDescribeHandler

      protected GenericSubsystemDescribeHandler()
    • GenericSubsystemDescribeHandler

      protected GenericSubsystemDescribeHandler(Comparator<PathElement> comparator)
      Creates a new describe handler.

      If the comparator is not null 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 is null 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 by Resource.getChildren(String) invoked on the parent.

      Parameters:
      comparator - the comparator used to sort the child addresses
  • Method Details

    • create

      public static GenericSubsystemDescribeHandler create(Comparator<PathElement> comparator)
      Creates a new describe handler.

      If the comparator is not null 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 is null 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 by Resource.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 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.

      Specified by:
      execute in interface OperationStepHandler
      Parameters:
      context - the operation context
      operation - the operation being executed
      Throws:
      OperationFailedException - if the operation failed before calling context.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.
      use DEFINITION for registration of operation
      Description 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 interface DescriptionProvider
      Parameters:
      locale - the locale to use to generate any localized text used in the description. May be null, in which case Locale.getDefault() should be used
      Returns:
      definition of operation