Package org.jboss.as.controller
Class SimpleResourceDefinition
java.lang.Object
org.jboss.as.controller.ResourceDefinition.MinimalResourceDefinition
org.jboss.as.controller.SimpleResourceDefinition
- All Implemented Interfaces:
Feature,ResourceDefinition,ResourceRegistration
- Direct Known Subclasses:
AbstractSocketBindingGroupResourceDefinition,AbstractSocketBindingResourceDefinition,BaseHttpInterfaceResourceDefinition,BaseNativeInterfaceResourceDefinition,ExtensionResourceDefinition,ExtensionSubsystemResourceDefinition,InterfaceDefinition,ModelOnlyResourceDefinition,PathResourceDefinition,PersistentResourceDefinition
Basic implementation of
ResourceDefinition.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classParameters object for the SimpleResourceDefinition constructorNested classes/interfaces inherited from interface org.jboss.as.controller.ResourceDefinition
ResourceDefinition.AbstractConfigurator<C extends ResourceDefinition.Configurator<C>>, ResourceDefinition.Builder, ResourceDefinition.Configurator<C extends ResourceDefinition.Configurator<C>>, ResourceDefinition.MinimalBuilder, ResourceDefinition.MinimalResourceDefinitionNested classes/interfaces inherited from interface org.jboss.as.controller.ResourceRegistration
ResourceRegistration.DefaultResourceRegistration -
Constructor Summary
ConstructorsConstructorDescriptionSimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver) ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler) ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.Constructs aResourceDefinitionusing the passed in parameters object. -
Method Summary
Modifier and TypeMethodDescriptionprotected AttributeDefinition[]getAddOperationParameters(ManagementResourceRegistration registration) Returns the parameters of the "add" resource operation.protected DeprecationDataprotected static EnumSet<OperationEntry.Flag>getFlagsSet(OperationEntry.Flag... vararg) Gets theResourceDescriptionResolverused by this resource definition, ornullif aResourceDescriptionResolveris not used.voidregisterAdditionalRuntimePackages(ManagementResourceRegistration resourceRegistration) Register "additional" Galleon packages that must be installed in order for this Resource to function.protected voidregisterAddOperation(ManagementResourceRegistration registration, AbstractAddStepHandler handler, OperationEntry.Flag... flags) Deprecated, for removal: This API element is subject to removal in a future version.protected voidregisterAddOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags) Registers the "add" resource operation.voidregisterAttributes(ManagementResourceRegistration resourceRegistration) Register operations associated with this resource.voidregisterCapabilities(ManagementResourceRegistration resourceRegistration) Register capabilities associated with this resource.voidregisterChildren(ManagementResourceRegistration resourceRegistration) Register child resources associated with this resource.voidregisterNotifications(ManagementResourceRegistration resourceRegistration) Register notifications associated with this resource.voidregisterOperations(ManagementResourceRegistration resourceRegistration) Register operations associated with this resource.protected voidregisterRemoveOperation(ManagementResourceRegistration registration, AbstractRemoveStepHandler handler, OperationEntry.Flag... flags) Deprecated, for removal: This API element is subject to removal in a future version.protected voidregisterRemoveOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags) Registers the "remove" resource operation.protected voidsetDeprecated(ModelVersion since) Methods inherited from class org.jboss.as.controller.ResourceDefinition.MinimalResourceDefinition
getAccessConstraints, getDescriptionProvider, getMaxOccurs, getMinOccurs, getPathElement, getStability, isFeature, isOrderedChild, isRuntime
-
Constructor Details
-
SimpleResourceDefinition
public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver) ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.- Parameters:
pathElement- the path. Cannot benull.descriptionResolver- the description resolver to use in the description provider. Cannot benull- Throws:
IllegalArgumentException- if any parameter isnull.
-
SimpleResourceDefinition
public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler) ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.- Parameters:
pathElement- the path. Cannot benull.descriptionResolver- the description resolver to use in the description provider. Cannot benull*addHandler- a handler toregisterfor the resource "add" operation. Can be {null}removeHandler- a handler toregisterfor the resource "remove" operation. Can be {null}- Throws:
IllegalArgumentException- if any parameter isnull
-
SimpleResourceDefinition
Constructs aResourceDefinitionusing the passed in parameters object.- Parameters:
parameters-SimpleResourceDefinition.Parametersto configure this ResourceDefinition- Throws:
IllegalStateException- if the parameters object is not valid.
-
-
Method Details
-
registerOperations
Register operations associated with this resource. Registers an add operation handler or a remove operation handler if one was provided to the constructor.- Specified by:
registerOperationsin interfaceResourceDefinition- Overrides:
registerOperationsin classResourceDefinition.MinimalResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerAttributes
Description copied from interface:ResourceDefinitionRegister operations associated with this resource.- Specified by:
registerAttributesin interfaceResourceDefinition- Overrides:
registerAttributesin classResourceDefinition.MinimalResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerNotifications
Description copied from interface:ResourceDefinitionRegister notifications associated with this resource.- Specified by:
registerNotificationsin interfaceResourceDefinition- Overrides:
registerNotificationsin classResourceDefinition.MinimalResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerChildren
Description copied from interface:ResourceDefinitionRegister child resources associated with this resource.- Specified by:
registerChildrenin interfaceResourceDefinition- Overrides:
registerChildrenin classResourceDefinition.MinimalResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerCapabilities
Register capabilities associated with this resource.Classes that overrides this method MUST call
super.registerCapabilities(resourceRegistration).- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerAdditionalRuntimePackages
Description copied from interface:ResourceDefinitionRegister "additional" Galleon packages that must be installed in order for this Resource to function. NB: the packages need to be visible from the feature pack that contains the ResourceDefinition. It can't be any package from any feature pack. The purpose of providing this information is to make it available to the Galleon tooling that produces Galleon feature-specs, in order to allow the tooling to include the package information in the relevant spec.A package is "additional" if it is not one of the "standard" packages that must be installed. The names of "standard" packages should not be registered. The "standard" packages are:
- The root package for the process type; i.e. the package that provides the main module whose name is passed to JBoss Modules when the process is launched.
- The package that installs the module that provides the extension in which the resource is defined.
- Any package that is non-optionally directly or transitively required by one of the other types of standard packages.
-
Packages that install required modules injected into Deployment Unit can be registered as
required
RuntimePackageDependency. -
Packages that install optional modules injected into Deployment Unit can be registered as
optional
RuntimePackageDependency. -
Packages that install modules that are only required if the resource associated to this
definition is instantiated are to be registered as required
RuntimePackageDependency. -
Packages that install modules that are only required by this feature in order to interact with other features
are to be registered as passive
RuntimePackageDependency. A passive dependency is provisioned only if its own required dependencies are present.
- Specified by:
registerAdditionalRuntimePackagesin interfaceResourceDefinition- Overrides:
registerAdditionalRuntimePackagesin classResourceDefinition.MinimalResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
getResourceDescriptionResolver
Gets theResourceDescriptionResolverused by this resource definition, ornullif aResourceDescriptionResolveris not used.- Returns:
- the resource description resolver, or
null
-
getAddOperationParameters
protected AttributeDefinition[] getAddOperationParameters(ManagementResourceRegistration registration) Returns the parameters of the "add" resource operation. The default implementation returns all registered attributes, excluding runtime-only and resource-only.- Parameters:
registration- the registration of this resource definition- Returns:
- an array of attribute definitions
-
registerAddOperation
protected void registerAddOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags) Registers the "add" resource operation.- Parameters:
registration- resource on which to registerhandler- operation handler to registerflags- with flags
-
registerRemoveOperation
protected void registerRemoveOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags) Registers the "remove" resource operation.- Parameters:
registration- resource on which to registerhandler- operation handler to registerflags- with flags
-
registerAddOperation
@Deprecated(forRemoval=true) protected void registerAddOperation(ManagementResourceRegistration registration, AbstractAddStepHandler handler, OperationEntry.Flag... flags) Deprecated, for removal: This API element is subject to removal in a future version.Registers add operation- Parameters:
registration- resource on which to registerhandler- operation handler to registerflags- with flags
-
registerRemoveOperation
@Deprecated(forRemoval=true) protected void registerRemoveOperation(ManagementResourceRegistration registration, AbstractRemoveStepHandler handler, OperationEntry.Flag... flags) Deprecated, for removal: This API element is subject to removal in a future version.Registers remove operation- Parameters:
registration- resource on which to registerhandler- operation handler to registerflags- with flags
-
getFlagsSet
-
setDeprecated
-
getDeprecationData
-
registerAddOperation(ManagementResourceRegistration, OperationStepHandler, org.jboss.as.controller.registry.OperationEntry.Flag...)