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
public class SimpleResourceDefinition extends ResourceDefinition.MinimalResourceDefinition
Basic implementation ofResourceDefinition
.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SimpleResourceDefinition.Parameters
Parameters object for the SimpleResourceDefinition constructor-
Nested 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.MinimalResourceDefinition
-
-
Constructor Summary
Constructors Constructor Description SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver)
ResourceDefinition
that uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProvider
to describe the resource.SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler)
ResourceDefinition
that uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProvider
to describe the resource.SimpleResourceDefinition(SimpleResourceDefinition.Parameters parameters)
Constructs aResourceDefinition
using the passed in parameters object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected AttributeDefinition[]
getAddOperationParameters(ManagementResourceRegistration registration)
Returns the parameters of the "add" resource operation.protected DeprecationData
getDeprecationData()
protected static EnumSet<OperationEntry.Flag>
getFlagsSet(OperationEntry.Flag... vararg)
ResourceDescriptionResolver
getResourceDescriptionResolver()
Gets theResourceDescriptionResolver
used by this resource definition, ornull
if aResourceDescriptionResolver
is not used.void
registerAdditionalRuntimePackages(ManagementResourceRegistration resourceRegistration)
Register "additional" Galleon packages that must be installed in order for this Resource to function.protected void
registerAddOperation(ManagementResourceRegistration registration, AbstractAddStepHandler handler, OperationEntry.Flag... flags)
protected void
registerAddOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)
Registers the "add" resource operation.void
registerAttributes(ManagementResourceRegistration resourceRegistration)
Register operations associated with this resource.void
registerCapabilities(ManagementResourceRegistration resourceRegistration)
Register capabilities associated with this resource.void
registerChildren(ManagementResourceRegistration resourceRegistration)
Register child resources associated with this resource.void
registerNotifications(ManagementResourceRegistration resourceRegistration)
Register notifications associated with this resource.void
registerOperations(ManagementResourceRegistration resourceRegistration)
Register operations associated with this resource.protected void
registerRemoveOperation(ManagementResourceRegistration registration, AbstractRemoveStepHandler handler, OperationEntry.Flag... flags)
protected void
registerRemoveOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)
Registers the "remove" resource operation.protected void
setDeprecated(ModelVersion since)
-
Methods inherited from class org.jboss.as.controller.ResourceDefinition.MinimalResourceDefinition
getAccessConstraints, getDescriptionProvider, getMaxOccurs, getMinOccurs, getPathElement, getStability, isFeature, isOrderedChild, isRuntime
-
-
-
-
Constructor Detail
-
SimpleResourceDefinition
public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver)
ResourceDefinition
that uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProvider
to 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)
ResourceDefinition
that uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProvider
to describe the resource.- Parameters:
pathElement
- the path. Cannot benull
.descriptionResolver
- the description resolver to use in the description provider. Cannot benull
*addHandler
- a handler toregister
for the resource "add" operation. Can be {null}removeHandler
- a handler toregister
for the resource "remove" operation. Can be {null}- Throws:
IllegalArgumentException
- if any parameter isnull
-
SimpleResourceDefinition
public SimpleResourceDefinition(SimpleResourceDefinition.Parameters parameters)
Constructs aResourceDefinition
using the passed in parameters object.- Parameters:
parameters
-SimpleResourceDefinition.Parameters
to configure this ResourceDefinition- Throws:
IllegalStateException
- if the parameters object is not valid.
-
-
Method Detail
-
registerOperations
public void registerOperations(ManagementResourceRegistration resourceRegistration)
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:
registerOperations
in interfaceResourceDefinition
- Overrides:
registerOperations
in classResourceDefinition.MinimalResourceDefinition
- Parameters:
resourceRegistration
- aManagementResourceRegistration
created from this definition
-
registerAttributes
public void registerAttributes(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinition
Register operations associated with this resource.- Specified by:
registerAttributes
in interfaceResourceDefinition
- Overrides:
registerAttributes
in classResourceDefinition.MinimalResourceDefinition
- Parameters:
resourceRegistration
- aManagementResourceRegistration
created from this definition
-
registerNotifications
public void registerNotifications(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinition
Register notifications associated with this resource.- Specified by:
registerNotifications
in interfaceResourceDefinition
- Overrides:
registerNotifications
in classResourceDefinition.MinimalResourceDefinition
- Parameters:
resourceRegistration
- aManagementResourceRegistration
created from this definition
-
registerChildren
public void registerChildren(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinition
Register child resources associated with this resource.- Specified by:
registerChildren
in interfaceResourceDefinition
- Overrides:
registerChildren
in classResourceDefinition.MinimalResourceDefinition
- Parameters:
resourceRegistration
- aManagementResourceRegistration
created from this definition
-
registerCapabilities
public void registerCapabilities(ManagementResourceRegistration resourceRegistration)
Register capabilities associated with this resource.Classes that overrides this method MUST call
super.registerCapabilities(resourceRegistration)
.- Parameters:
resourceRegistration
- aManagementResourceRegistration
created from this definition
-
registerAdditionalRuntimePackages
public void registerAdditionalRuntimePackages(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinition
Register "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:
registerAdditionalRuntimePackages
in interfaceResourceDefinition
- Overrides:
registerAdditionalRuntimePackages
in classResourceDefinition.MinimalResourceDefinition
- Parameters:
resourceRegistration
- aManagementResourceRegistration
created from this definition
-
getResourceDescriptionResolver
public ResourceDescriptionResolver getResourceDescriptionResolver()
Gets theResourceDescriptionResolver
used by this resource definition, ornull
if aResourceDescriptionResolver
is 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 protected void registerAddOperation(ManagementResourceRegistration registration, AbstractAddStepHandler handler, OperationEntry.Flag... flags)
Deprecated.Registers add operation- Parameters:
registration
- resource on which to registerhandler
- operation handler to registerflags
- with flags
-
registerRemoveOperation
@Deprecated protected void registerRemoveOperation(ManagementResourceRegistration registration, AbstractRemoveStepHandler handler, OperationEntry.Flag... flags)
Deprecated.Registers remove operation- Parameters:
registration
- resource on which to registerhandler
- operation handler to registerflags
- with flags
-
getFlagsSet
protected static EnumSet<OperationEntry.Flag> getFlagsSet(OperationEntry.Flag... vararg)
-
setDeprecated
protected void setDeprecated(ModelVersion since)
-
getDeprecationData
protected DeprecationData getDeprecationData()
-
-