public class ResolvePathHandler extends Object implements OperationStepHandler
public class CustomExtension implements Extension {
...
public void initialize(final ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME,
MANAGEMENT_API_MAJOR_VERSION, MANAGEMENT_API_MINOR_VERSION, MANAGEMENT_API_MICRO_VERSION);
final ManagementResourceRegistration registration = subsystem.registerSubsystemModel(CustomFileResource.INSTANCE);
final ResolvePathHandler resolvePathHandler = ResolvePathHandler.Builder.of(context.getPathManager()).build();
registration.registerOperationHandler(ResolvePathHandler.OPERATION_DEFINITION, resolvePathHandler);
subsystem.registerXMLElementWriter(CustomSubsystemParser.INSTANCE);
}
...
}
Modifier and Type | Class and Description |
---|---|
static class |
ResolvePathHandler.Builder
Build an operation to resolve the
|
Modifier and Type | Field and Description |
---|---|
static SimpleAttributeDefinition |
RELATIVE_TO_ONLY |
Modifier and Type | Method and Description |
---|---|
void |
execute(OperationContext context,
org.jboss.dmr.ModelNode operation)
Execute this step.
|
OperationDefinition |
getOperationDefinition()
Returns the operation definition for the operation.
|
public static final SimpleAttributeDefinition RELATIVE_TO_ONLY
public void execute(OperationContext context, org.jboss.dmr.ModelNode operation) throws OperationFailedException
OperationStepHandler
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()
public OperationDefinition getOperationDefinition()
Copyright © 2023 JBoss by Red Hat. All rights reserved.