Interface ResourceOperationRuntimeHandler
- All Known Implementing Classes:
ResourceOperationRuntimeHandler.ResourceServiceConfiguratorRuntimeHandler,ResourceOperationRuntimeHandler.RestartAncestorResourceServiceConfiguratorRuntimeHandler
public interface ResourceOperationRuntimeHandler
Handles runtime/rollback behavior for "add"/"remove"
resource and "write-attribute" operations.
- Author:
- Paul Ferraro
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classPerforms installation of a single service, configured via aResourceServiceConfigurator.static classRuntime handler that restarts the runtime handler of an ancestor resource. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddRuntime(org.jboss.as.controller.OperationContext context, org.jboss.as.controller.registry.Resource resource) Adds runtime behavior for the specified resource.voidaddRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode model) Adds runtime behavior for a resource with the specified model.combine(Iterable<? extends ResourceOperationRuntimeHandler> handlers) Composes aResourceOperationRuntimeHandlerfrom multiple runtime handlers.combine(ResourceOperationRuntimeHandler... handlers) Composes aResourceOperationRuntimeHandlerfrom multiple runtime handlers.configureParentService(ResourceServiceConfigurator configurator) Returns aResourceOperationRuntimeHandlerfor resource with children that configures and installs a single service from the specified factory, using a recursively read model.configureService(ResourceServiceConfigurator configurator) Returns aResourceOperationRuntimeHandlerthat configures and installs a single service from the specified factory.default org.jboss.dmr.ModelNodereadModel(org.jboss.as.controller.registry.Resource resource) Returns the model of the specified resource.default voidremoveRuntime(org.jboss.as.controller.OperationContext context, org.jboss.as.controller.registry.Resource resource) Removes runtime behavior for the specified resource.voidremoveRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode model) Removes runtime behavior for a resource with the specified model.restartAncestor(ResourceOperationRuntimeHandler ancestorRuntimeHandler, UnaryOperator<org.jboss.as.controller.PathAddress> ancestorAddressResolver) Returns aResourceOperationRuntimeHandlerthat restarts the runtime behavior of an ancestor resource.restartParent(ResourceOperationRuntimeHandler parentRuntimeHandler) Returns aResourceOperationRuntimeHandlerthat restarts the runtime behavior of its parent resource.
-
Method Details
-
configureService
Returns aResourceOperationRuntimeHandlerthat configures and installs a single service from the specified factory.- Parameters:
configurator- a service configurator- Returns:
- an operation runtime handler
-
configureParentService
static ResourceOperationRuntimeHandler configureParentService(ResourceServiceConfigurator configurator) Returns aResourceOperationRuntimeHandlerfor resource with children that configures and installs a single service from the specified factory, using a recursively read model.- Parameters:
configurator- a service configurator- Returns:
- an operation runtime handler
-
restartParent
static ResourceOperationRuntimeHandler restartParent(ResourceOperationRuntimeHandler parentRuntimeHandler) Returns aResourceOperationRuntimeHandlerthat restarts the runtime behavior of its parent resource.- Parameters:
parentRuntimeHandler- the runtime handler of the parent resource- Returns:
- an operation runtime handler
-
restartAncestor
static ResourceOperationRuntimeHandler restartAncestor(ResourceOperationRuntimeHandler ancestorRuntimeHandler, UnaryOperator<org.jboss.as.controller.PathAddress> ancestorAddressResolver) Returns aResourceOperationRuntimeHandlerthat restarts the runtime behavior of an ancestor resource.- Parameters:
ancestorRuntimeHandler- the runtime handler of an ancestor resourceancestorAddressResolver- the resolver of the ancestor path address- Returns:
- an operation runtime handler
-
combine
Composes aResourceOperationRuntimeHandlerfrom multiple runtime handlers.- Parameters:
handlers- a number of runtime handlers- Returns:
- a composite runtime handler
-
combine
static ResourceOperationRuntimeHandler combine(Iterable<? extends ResourceOperationRuntimeHandler> handlers) Composes aResourceOperationRuntimeHandlerfrom multiple runtime handlers.- Parameters:
handlers- a number of runtime handlers- Returns:
- a composite runtime handler
-
addRuntime
default void addRuntime(org.jboss.as.controller.OperationContext context, org.jboss.as.controller.registry.Resource resource) throws org.jboss.as.controller.OperationFailedException Adds runtime behavior for the specified resource.- Parameters:
context- the context of the operationresource- the target resource- Throws:
org.jboss.as.controller.OperationFailedException- if the operation should fail
-
addRuntime
void addRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode model) throws org.jboss.as.controller.OperationFailedException Adds runtime behavior for a resource with the specified model.- Parameters:
context- the context of the operationmodel- the resource model- Throws:
org.jboss.as.controller.OperationFailedException- if the operation should fail
-
removeRuntime
default void removeRuntime(org.jboss.as.controller.OperationContext context, org.jboss.as.controller.registry.Resource resource) throws org.jboss.as.controller.OperationFailedException Removes runtime behavior for the specified resource.- Parameters:
context- the context of the operationresource- the target resource- Throws:
org.jboss.as.controller.OperationFailedException- if the operation should fail
-
removeRuntime
void removeRuntime(org.jboss.as.controller.OperationContext context, org.jboss.dmr.ModelNode model) throws org.jboss.as.controller.OperationFailedException Removes runtime behavior for a resource with the specified model.- Parameters:
context- the context of the operationmodel- the resource model- Throws:
org.jboss.as.controller.OperationFailedException- if the operation should fail
-
readModel
default org.jboss.dmr.ModelNode readModel(org.jboss.as.controller.registry.Resource resource) Returns the model of the specified resource. This can be overridden to provide a recursively read model.- Parameters:
resource- the resource associated with the current operation- Returns:
- the resource model
-