Package org.jboss.as.controller
Class SimpleResourceDefinition
- java.lang.Object
-
- org.jboss.as.controller.SimpleResourceDefinition
-
- All Implemented Interfaces:
ResourceDefinition
- Direct Known Subclasses:
AbstractSocketBindingGroupResourceDefinition,AbstractSocketBindingResourceDefinition,BaseHttpInterfaceResourceDefinition,BaseNativeInterfaceResourceDefinition,ExtensionResourceDefinition,ExtensionSubsystemResourceDefinition,InterfaceDefinition,ModelOnlyResourceDefinition,PathResourceDefinition,PersistentResourceDefinition
public class SimpleResourceDefinition extends Object implements ResourceDefinition
Basic implementation ofResourceDefinition.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleResourceDefinition.ParametersParameters object for the SimpleResourceDefinition constructor
-
Constructor Summary
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description List<AccessConstraintDefinition>getAccessConstraints()Get the definition of any access constraints associated with the resource.protected DeprecationDatagetDeprecationData()DescriptionProvidergetDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration)Gets aDescriptionProviderfor the given resource.protected static EnumSet<OperationEntry.Flag>getFlagsSet(OperationEntry.Flag... vararg)intgetMaxOccurs()Gets the maximum number of times a resource of the type described by this definition can occur under its parent resource (or, for a root resource, the minimum number of times it can occur at all.)intgetMinOccurs()Gets the minimum number of times a resource of the type described by this definition can occur under its parent resource (or, for a root resource, the number of times it can occur at all.)PathElementgetPathElement()Gets the path element that describes how to navigate to this resource from its parent resource, ornullif this is a definition of a root resource.ResourceDescriptionResolvergetResourceDescriptionResolver()Gets theResourceDescriptionResolverused by this resource definition, ornullif aResourceDescriptionResolveris not used.booleanisFeature()booleanisOrderedChild()Whether this resource registration is ordered in the parent.booleanisRuntime()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)Registers add operationprotected voidregisterAddOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)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)protected voidregisterRemoveOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)Deprecated.protected voidsetDeprecated(ModelVersion since)
-
-
-
Constructor Detail
-
SimpleResourceDefinition
@Deprecated public SimpleResourceDefinition(PathElement pathElement, DescriptionProvider descriptionProvider)
Deprecated.ResourceDefinitionthat uses the given {code descriptionProvider} to describe the resource.- Parameters:
pathElement- the path. Can benull.descriptionProvider- the description provider. Cannot benull- Throws:
IllegalArgumentException- ifdescriptionProviderisnull.
-
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
@Deprecated public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, boolean isRuntime)
Deprecated.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 benullisRuntime- tells if resource is runtime- 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
@Deprecated public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler, boolean isRuntime)
Deprecated.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}isRuntime- tells is resources is runtime or not- Throws:
IllegalArgumentException- if any parameter isnull
-
SimpleResourceDefinition
@Deprecated public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler, DeprecationData deprecationData)
Deprecated.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}deprecationData- Information describing deprecation of this resource. Can benullif the resource isn't deprecated.- Throws:
IllegalArgumentException- if any parameter isnull
-
SimpleResourceDefinition
@Deprecated public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler, OperationEntry.Flag addRestartLevel, OperationEntry.Flag removeRestartLevel)
Deprecated.ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.- Parameters:
pathElement- the path. Can 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- ifdescriptionResolverisnull.
-
SimpleResourceDefinition
@Deprecated public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler, OperationEntry.Flag addRestartLevel, OperationEntry.Flag removeRestartLevel, DeprecationData deprecationData)
Deprecated.ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.- Parameters:
pathElement- the path. Can 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}deprecationData- Information describing deprecation of this resource. Can benullif the resource isn't deprecated.- Throws:
IllegalArgumentException- ifdescriptionResolverisnull.
-
SimpleResourceDefinition
@Deprecated public SimpleResourceDefinition(PathElement pathElement, ResourceDescriptionResolver descriptionResolver, OperationStepHandler addHandler, OperationStepHandler removeHandler, OperationEntry.Flag addRestartLevel, OperationEntry.Flag removeRestartLevel, DeprecationData deprecationData, boolean runtime)
Deprecated.ResourceDefinitionthat uses the given {code descriptionResolver} to configure aDefaultResourceDescriptionProviderto describe the resource.- Parameters:
pathElement- the path. Can 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}deprecationData- Information describing deprecation of this resource. Can benullif the resource isn't deprecated.runtime- Whether this is a runtime resource- Throws:
IllegalArgumentException- ifdescriptionResolverisnull.
-
SimpleResourceDefinition
public SimpleResourceDefinition(SimpleResourceDefinition.Parameters parameters)
Constructs aResourceDefinitionusing the passed in parameters object.- Parameters:
parameters-SimpleResourceDefinition.Parametersto configure this ResourceDefinition- Throws:
IllegalStateException- if the parameters object is not valid.
-
-
Method Detail
-
getPathElement
public PathElement getPathElement()
Description copied from interface:ResourceDefinitionGets the path element that describes how to navigate to this resource from its parent resource, ornullif this is a definition of a root resource.- Specified by:
getPathElementin interfaceResourceDefinition- Returns:
- the path element, or
nullif this is a definition of a root resource.
-
getDescriptionProvider
public DescriptionProvider getDescriptionProvider(ImmutableManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinitionGets aDescriptionProviderfor the given resource.- Specified by:
getDescriptionProviderin interfaceResourceDefinition- Parameters:
resourceRegistration- the resource. Cannot benull- Returns:
- the description provider. Will not be
null
-
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:
registerOperationsin interfaceResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerAttributes
public void registerAttributes(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinitionRegister operations associated with this resource.- Specified by:
registerAttributesin interfaceResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerNotifications
public void registerNotifications(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinitionRegister notifications associated with this resource.- Specified by:
registerNotificationsin interfaceResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerChildren
public void registerChildren(ManagementResourceRegistration resourceRegistration)
Description copied from interface:ResourceDefinitionRegister child resources associated with this resource.- Specified by:
registerChildrenin interfaceResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated 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).- Specified by:
registerCapabilitiesin interfaceResourceDefinition- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
registerAdditionalRuntimePackages
public void registerAdditionalRuntimePackages(ManagementResourceRegistration resourceRegistration)
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- Parameters:
resourceRegistration- aManagementResourceRegistrationcreated from this definition
-
getResourceDescriptionResolver
public ResourceDescriptionResolver getResourceDescriptionResolver()
Gets theResourceDescriptionResolverused by this resource definition, ornullif aResourceDescriptionResolveris not used.- Returns:
- the resource description resolver, or
null
-
registerAddOperation
@Deprecated protected void registerAddOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)
Registers add operation- Parameters:
registration- resource on which to registerhandler- operation handler to registerflags- with flags
-
registerAddOperation
protected void registerAddOperation(ManagementResourceRegistration registration, AbstractAddStepHandler handler, OperationEntry.Flag... flags)
Registers add operation Registers add operation- Parameters:
registration- resource on which to registerhandler- operation handler to registerflags- with flags
-
registerRemoveOperation
@Deprecated protected void registerRemoveOperation(ManagementResourceRegistration registration, OperationStepHandler handler, OperationEntry.Flag... flags)
Deprecated.
-
registerRemoveOperation
protected void registerRemoveOperation(ManagementResourceRegistration registration, AbstractRemoveStepHandler handler, OperationEntry.Flag... flags)
-
getFlagsSet
protected static EnumSet<OperationEntry.Flag> getFlagsSet(OperationEntry.Flag... vararg)
-
getAccessConstraints
public List<AccessConstraintDefinition> getAccessConstraints()
Get the definition of any access constraints associated with the resource.- Specified by:
getAccessConstraintsin interfaceResourceDefinition- Returns:
- this default implementation simply returns an empty list.
-
setDeprecated
protected void setDeprecated(ModelVersion since)
-
getDeprecationData
protected DeprecationData getDeprecationData()
-
isRuntime
public boolean isRuntime()
- Specified by:
isRuntimein interfaceResourceDefinition- Returns:
- true if resource is runtime
-
getMinOccurs
public int getMinOccurs()
Gets the minimum number of times a resource of the type described by this definition can occur under its parent resource (or, for a root resource, the number of times it can occur at all.)- Specified by:
getMinOccursin interfaceResourceDefinition- Returns:
- the minimum number of occurrences
-
getMaxOccurs
public int getMaxOccurs()
Gets the maximum number of times a resource of the type described by this definition can occur under its parent resource (or, for a root resource, the minimum number of times it can occur at all.)- Specified by:
getMaxOccursin interfaceResourceDefinition- Returns:
- the minimum number of occurrences
-
isOrderedChild
public boolean isOrderedChild()
Whether this resource registration is ordered in the parent. The automatically generated 'add' operation will get theadd-indexparameter added. Also, it will get registered as an ordered child in the parent's management resource registration.- Specified by:
isOrderedChildin interfaceResourceDefinition- Returns:
- whether this is an ordered child resource
-
isFeature
public boolean isFeature()
- Specified by:
isFeaturein interfaceResourceDefinition
-
-