Package org.jboss.as.controller
Class SimpleResourceDefinition.Parameters
java.lang.Object
org.jboss.as.controller.ResourceDefinition.AbstractConfigurator<SimpleResourceDefinition.Parameters>
org.jboss.as.controller.SimpleResourceDefinition.Parameters
- All Implemented Interfaces:
ResourceDefinition.Configurator<SimpleResourceDefinition.Parameters>
- Enclosing class:
- SimpleResourceDefinition
public static class SimpleResourceDefinition.Parameters
extends ResourceDefinition.AbstractConfigurator<SimpleResourceDefinition.Parameters>
Parameters object for the SimpleResourceDefinition constructor
-
Constructor Summary
ConstructorsConstructorDescriptionParameters(PathElement pathElement, DescriptionProvider descriptionProvider) Creates a Parameters objectParameters(PathElement pathElement, ResourceDescriptionResolver descriptionResolver) Creates a Parameters objectParameters(ResourceRegistration registration, DescriptionProvider descriptionProvider) Creates a Parameters objectParameters(ResourceRegistration registration, ResourceDescriptionResolver descriptionResolver) Creates a Parameters object -
Method Summary
Modifier and TypeMethodDescriptionaddCapabilities(RuntimeCapability... capabilities) Add possible capabilities for this resource to any that are already set.addIncorporatingCapabilities(Set<RuntimeCapability> incorporatingCapabilities) Adds incorporating capabilities to any that have already been set.addRequirement(String baseDependentName, Function<PathAddress, String[]> dependentDynamicNameMapper, String baseRequirementName, Function<PathAddress, String[]> requirementDynamicNameMapper) Add a required capability at the resource level, using the resource registration address and the nameMappers to resolve the required and dependant capabilities.protected SimpleResourceDefinition.Parametersself()setAccessConstraints(AccessConstraintDefinition... accessConstraints) Set access constraint definitions for this resourcesetAddHandler(OperationStepHandler addHandler) Sets the add handler.setAdditionalPackages(RuntimePackageDependency... additionalPackages) Set the additional packages that this resource exposessetAddRestartLevel(OperationEntry.Flag addRestartLevel) Sets the add restart level.setCapabilities(RuntimeCapability... capabilities) set possible capabilities that this resource exposessetDeprecatedSince(ModelVersion deprecatedSince) Call to deprecate the resourcesetDeprecationData(DeprecationData deprecationData) Call to deprecate the resourcesetDescriptionResolver(ResourceDescriptionResolver descriptionResolver) Sets the description resolver to usesetFeature(boolean feature) set the feature nature of this resourcesetIncorporatingCapabilities(Set<RuntimeCapability> incorporatingCapabilities) Registers a set of capabilities that this resource does not directly provide but to which it contributes.setMaxOccurs(int maxOccurs) set the maximum number of occurrences for this resourcesetMinOccurs(int minOccurs) set the minimum number of occurrences for this resourceCall to indicate that a resource is of a type where ordering matters amongst the siblings of the same type.setRemoveHandler(OperationStepHandler removeHandler) Sets the remove handler.setRemoveRestartLevel(OperationEntry.Flag removeRestartLevel) Sets the remove restart level.Call to indicate that a resource is runtime-only.setRuntime(boolean isRuntime) Call to indicate that a resource is runtime-only.Methods inherited from class org.jboss.as.controller.ResourceDefinition.AbstractConfigurator
addAccessConstraints, asNonFeature, asOrderedChild, asRuntime, withAccessConstraints, withMaxOccurance, withMinOccuranceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.as.controller.ResourceDefinition.Configurator
addAccessConstraint, addAccessConstraints, withAccessConstraint, withAccessConstraints
-
Constructor Details
-
Parameters
Creates a Parameters object- Parameters:
pathElement- the path element of the created ResourceDefinition. Cannot benulldescriptionResolver- the description resolver. Cannot benull
-
Parameters
public Parameters(ResourceRegistration registration, ResourceDescriptionResolver descriptionResolver) Creates a Parameters object- Parameters:
pathElement- the path element of the created ResourceDefinition. Cannot benulldescriptionResolver- the description resolver. Cannot benull
-
Parameters
Creates a Parameters object- Parameters:
pathElement- the path element of the created ResourceDefinition. Cannot benulldescriptionProvider- the description provider. Cannot benull
-
Parameters
Creates a Parameters object- Parameters:
pathElement- the path element of the created ResourceDefinition. Cannot benulldescriptionProvider- the description provider. Cannot benull
-
-
Method Details
-
self
- Specified by:
selfin classResourceDefinition.AbstractConfigurator<SimpleResourceDefinition.Parameters>
-
setDescriptionResolver
public SimpleResourceDefinition.Parameters setDescriptionResolver(ResourceDescriptionResolver descriptionResolver) Sets the description resolver to use- Parameters:
descriptionResolver- the description resolver. Cannot benull- Returns:
- this Parameters object
-
setAddHandler
Sets the add handler. This can also be added by overridingSimpleResourceDefinition.registerOperations(ManagementResourceRegistration)- Parameters:
addHandler- the add handler to use.- Returns:
- this Parameters object
-
setRemoveHandler
Sets the remove handler. This can also be added by overridingSimpleResourceDefinition.registerOperations(ManagementResourceRegistration)- Parameters:
removeHandler- the add handler to use.- Returns:
- this Parameters object
-
setAddRestartLevel
Sets the add restart level. The default isOperationEntry.Flag.RESTART_NONE- Parameters:
addRestartLevel- the restart level- Returns:
- this Parameters object
- Throws:
IllegalArgumentException- ifaddRestartLevelisnullor a flag that does not pertain to restarts
-
setRemoveRestartLevel
public SimpleResourceDefinition.Parameters setRemoveRestartLevel(OperationEntry.Flag removeRestartLevel) Sets the remove restart level. The default isOperationEntry.Flag.RESTART_ALL_SERVICES- Parameters:
removeRestartLevel- the restart level- Returns:
- this Parameters object
- Throws:
IllegalArgumentException- ifaddRestartLevelisnullor a flag that does not pertain to restarts
-
setRuntime
Call to indicate that a resource is runtime-only. If not called, the default isfalse- Returns:
- this Parameters object
-
setRuntime
Call to indicate that a resource is runtime-only. If not called, the default isfalse- Returns:
- this Parameters object
-
setDeprecationData
Call to deprecate the resource- Parameters:
deprecationData- Information describing deprecation of this resource.- Returns:
- this Parameters object
- Throws:
IllegalStateException- if thedeprecationDatais null
-
setDeprecatedSince
Call to deprecate the resource- Parameters:
deprecatedSince- version in which model was deprecated- Returns:
- this Parameters object
- Throws:
IllegalStateException- if thedeprecationDatais null
-
setOrderedChild
Call to indicate that a resource is of a type where ordering matters amongst the siblings of the same type. If not called, the default isfalse.- Returns:
- this Parameters object
-
setCapabilities
set possible capabilities that this resource exposes- Parameters:
capabilities- capabilities to register- Returns:
- Parameters object
-
setAdditionalPackages
public SimpleResourceDefinition.Parameters setAdditionalPackages(RuntimePackageDependency... additionalPackages) Set the additional packages that this resource exposes- Parameters:
additionalPackages- runtime packages to register- Returns:
- Parameters object
-
addCapabilities
Add possible capabilities for this resource to any that are already set.- Parameters:
capabilities- capabilities to register- Returns:
- Parameters object
-
setAccessConstraints
public SimpleResourceDefinition.Parameters setAccessConstraints(AccessConstraintDefinition... accessConstraints) Set access constraint definitions for this resource- Parameters:
accessConstraints- access constraint definitions for this resource- Returns:
- Parameters object
-
setMaxOccurs
set the maximum number of occurrences for this resource- Parameters:
maxOccurs- the maximum number of times this resource can occur- Returns:
- Parameters object
-
setMinOccurs
set the minimum number of occurrences for this resource- Parameters:
minOccurs- the minimum number of times this resource must occur- Returns:
- Parameters object
-
setFeature
set the feature nature of this resource- Parameters:
feature- true if this resource is a feature- Returns:
- Parameters object
-
setIncorporatingCapabilities
public SimpleResourceDefinition.Parameters setIncorporatingCapabilities(Set<RuntimeCapability> incorporatingCapabilities) Registers a set of capabilities that this resource does not directly provide but to which it contributes. This will only include capabilities for which this resource does not control theregistration of the capability. Any capabilities registered by this resource should instead be declared usingsetCapabilities(RuntimeCapability[]).Use of this method is only necessary if the caller wishes to specifically record capability incorporation, instead of relying on the default resolution mechanism detailed in
ImmutableManagementResourceRegistration.getIncorporatingCapabilities(), or if it wishes disable the default resolution mechanism and specifically declare that this resource does not contribute to parent capabilities. It does the latter by passing an empty set as thecapabilitiesparameter. Passing an empty set is not necessary if this resource itself directlyprovides a capability, as it is the contract ofImmutableManagementResourceRegistration.getIncorporatingCapabilities()that in that case it must return an empty set.- Parameters:
incorporatingCapabilities- set of capabilities, ornullif default resolution of capabilities to which this resource contributes should be used; an empty set can be used to indicate this resource does not contribute to capabilities provided by its parent- Returns:
- Parameters object
-
addRequirement
public SimpleResourceDefinition.Parameters addRequirement(String baseDependentName, Function<PathAddress, String[]> dependentDynamicNameMapper, String baseRequirementName, Function<PathAddress, String[]> requirementDynamicNameMapper) Add a required capability at the resource level, using the resource registration address and the nameMappers to resolve the required and dependant capabilities.- Parameters:
baseDependentName- the dependent capability base name.dependentDynamicNameMapper- the dependent capability name mapper.baseRequirementName- the required capability base name.requirementDynamicNameMapper- the required capability name mapper.- Returns:
- Parameters object.
-
addIncorporatingCapabilities
public SimpleResourceDefinition.Parameters addIncorporatingCapabilities(Set<RuntimeCapability> incorporatingCapabilities) Adds incorporating capabilities to any that have already been set.- Parameters:
incorporatingCapabilities- capabilities to add- Returns:
- Parameters object
-