Interface ManagementResourceRegistration
-
- All Superinterfaces:
ImmutableManagementResourceRegistration
- All Known Implementing Classes:
DelegatingManagementResourceRegistration
public interface ManagementResourceRegistration extends ImmutableManagementResourceRegistration
A registration for a management resource which consists of a resource description plus registered operation handlers.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classManagementResourceRegistration.FactoryA factory for creating a new, root model node registration.
-
Field Summary
-
Fields inherited from interface org.jboss.as.controller.registry.ImmutableManagementResourceRegistration
ACCESS_PERMISSION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ManagementResourceRegistrationgetOverrideModel(String name)Get a specifically named resource that overrides thiswildcard registrationby adding additional attributes, operations or child types.ManagementResourceRegistrationgetSubModel(PathAddress address)Get a sub model registration.booleanisAllowsOverride()Gets whether this registration will always throw an exception ifregisterOverrideModel(String, OverrideDescriptionProvider)is invoked.voidregisterAdditionalRuntimePackages(RuntimePackageDependency... pkgs)RegisterRuntimePackageDependencyadditional packages.voidregisterAlias(PathElement address, AliasEntry aliasEntry)Register an alias registration to another part of the modelvoidregisterCapability(RuntimeCapability capability)Registers passed capability on resourcevoidregisterIncorporatingCapabilities(Set<RuntimeCapability> capabilities)Registers a set of capabilities that this resource does not directly provide but to which it contributes.voidregisterMetric(AttributeDefinition definition, OperationStepHandler metricHandler)Records that the given attribute is a metric.voidregisterNotification(NotificationDefinition notification)Record that the given notification can be emitted by this resource.voidregisterNotification(NotificationDefinition notification, boolean inherited)Record that the given notification can be emitted by this resource.voidregisterOperationHandler(OperationDefinition definition, OperationStepHandler handler)Register an operation handler for this resource.voidregisterOperationHandler(OperationDefinition definition, OperationStepHandler handler, boolean inherited)Register an operation handler for this resource.ManagementResourceRegistrationregisterOverrideModel(String name, OverrideDescriptionProvider descriptionProvider)Register a specifically named resource that overrides thiswildcard registrationby adding additional attributes, operations or child types.voidregisterProxyController(PathElement address, ProxyController proxyController)Register a proxy controller.voidregisterReadOnlyAttribute(AttributeDefinition definition, OperationStepHandler readHandler)Records that the given attribute can be read from but not written to, and optionally provides an operation handler for the read.voidregisterReadWriteAttribute(AttributeDefinition definition, OperationStepHandler readHandler, OperationStepHandler writeHandler)Records that the given attribute can be both read from and written to, and provides operation handlers for the read and the write.voidregisterRequirements(Set<CapabilityReferenceRecorder> requirements)Registers a set of CapabilityReferenceRecorder.ManagementResourceRegistrationregisterSubModel(ResourceDefinition resourceDefinition)Register the existence of an addressable sub-resource of this resource.voidunregisterAlias(PathElement address)Unregister an aliasvoidunregisterAttribute(String attributeName)Remove that the given attribute if present.voidunregisterNotification(String notificationType)Remove that the given notification can be emitted by this resource.voidunregisterOperationHandler(String operationName)Unregister an operation handler for this resource.voidunregisterOverrideModel(String name)Unregister a specifically named resource that overrides awildcard registrationby adding additional attributes, operations or child types.voidunregisterProxyController(PathElement address)Unregister a proxy controllervoidunregisterSubModel(PathElement address)Unregister the existence of an addressable sub-resource of this resource.-
Methods inherited from interface org.jboss.as.controller.registry.ImmutableManagementResourceRegistration
getAccessConstraints, getAdditionalRuntimePackages, getAliasEntry, getAttributeAccess, getAttributeNames, getAttributes, getCapabilities, getChildAddresses, getChildNames, getFeature, getIncorporatingCapabilities, getMaxOccurs, getMinOccurs, getModelDescription, getNotificationDescriptions, getOperationDescription, getOperationDescriptions, getOperationEntry, getOperationFlags, getOperationHandler, getOrderedChildTypes, getParent, getPathAddress, getProcessType, getProxyController, getProxyControllers, getRequirements, isAlias, isFeature, isOrderedChildResource, isRemote, isRuntimeOnly
-
-
-
-
Method Detail
-
getOverrideModel
ManagementResourceRegistration getOverrideModel(String name)
Get a specifically named resource that overrides thiswildcard registrationby adding additional attributes, operations or child types.- Parameters:
name- the specific name of the resource. Cannot benullorPathElement.WILDCARD_VALUE- Returns:
- the resource registration,
nullif there is none - Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
getSubModel
ManagementResourceRegistration getSubModel(PathAddress address)
Get a sub model registration.This method overrides the superinterface method of the same name in order to require that the returned registration be mutable.
- Specified by:
getSubModelin interfaceImmutableManagementResourceRegistration- Parameters:
address- the address, relative to this node- Returns:
- the resource registration,
nullif there is none - Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerSubModel
ManagementResourceRegistration registerSubModel(ResourceDefinition resourceDefinition)
Register the existence of an addressable sub-resource of this resource. Before this method returns the providedresourceDefinitionwill be given the opportunity toregister attributes,register operations, andregister notifications- Parameters:
resourceDefinition- source for descriptive information describing this portion of the model (must not benull)- Returns:
- a resource registration which may be used to add attributes, operations, notifications and sub-models
- Throws:
IllegalArgumentException- if a submodel is already registered ataddressIllegalStateException- ifImmutableManagementResourceRegistration.isRuntimeOnly()returnstrueSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterSubModel
void unregisterSubModel(PathElement address)
Unregister the existence of an addressable sub-resource of this resource.- Parameters:
address- the child of this registry that should no longer be available- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
isAllowsOverride
boolean isAllowsOverride()
Gets whether this registration will always throw an exception ifregisterOverrideModel(String, OverrideDescriptionProvider)is invoked. An exception will always be thrown for root resource registrations,non-wildcard registrations, orremote registrations.- Returns:
trueif an exception will not always be thrown;falseif it will- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerOverrideModel
ManagementResourceRegistration registerOverrideModel(String name, OverrideDescriptionProvider descriptionProvider)
Register a specifically named resource that overrides thiswildcard registrationby adding additional attributes, operations or child types.- Parameters:
name- the specific name of the resource. Cannot benullorPathElement.WILDCARD_VALUEdescriptionProvider- provider for descriptions of the additional attributes or child types- Returns:
- a resource registration which may be used to add attributes, operations and sub-models
- Throws:
IllegalArgumentException- if either parameter is null or if there is already a registration undernameIllegalStateException- ifImmutableManagementResourceRegistration.isRuntimeOnly()returnstrueor ifisAllowsOverride()returns falseSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterOverrideModel
void unregisterOverrideModel(String name)
Unregister a specifically named resource that overrides awildcard registrationby adding additional attributes, operations or child types.- Parameters:
name- the specific name of the resource. Cannot benullorPathElement.WILDCARD_VALUE- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerOperationHandler
void registerOperationHandler(OperationDefinition definition, OperationStepHandler handler)
Register an operation handler for this resource.- Parameters:
definition- the definition of operationhandler- the operation handler- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerOperationHandler
void registerOperationHandler(OperationDefinition definition, OperationStepHandler handler, boolean inherited)
Register an operation handler for this resource.- Parameters:
definition- the definition of operationhandler- the operation handlerinherited-trueif the operation is inherited to child nodes,falseotherwise- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterOperationHandler
void unregisterOperationHandler(String operationName)
Unregister an operation handler for this resource.- Parameters:
operationName- the operation name- Throws:
IllegalArgumentException- if operationName is not registeredSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerReadWriteAttribute
void registerReadWriteAttribute(AttributeDefinition definition, OperationStepHandler readHandler, OperationStepHandler writeHandler)
Records that the given attribute can be both read from and written to, and provides operation handlers for the read and the write. The attribute is assumed to beAttributeAccess.Storage.CONFIGURATIONunless parameterflagsincludesAttributeAccess.Flag.STORAGE_RUNTIME.- Parameters:
definition- the attribute definition. Cannot benullreadHandler- the handler for attribute reads. May benullin which case the default handling is usedwriteHandler- the handler for attribute writes. Cannot benull- Throws:
IllegalArgumentException- ifdefinitionorwriteHandlerarenullSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerReadOnlyAttribute
void registerReadOnlyAttribute(AttributeDefinition definition, OperationStepHandler readHandler)
Records that the given attribute can be read from but not written to, and optionally provides an operation handler for the read. The attribute is assumed to beAttributeAccess.Storage.CONFIGURATIONunless parameterflagsincludesAttributeAccess.Flag.STORAGE_RUNTIME.- Parameters:
definition- the attribute definition. Cannot benullreadHandler- the handler for attribute reads. May benullin which case the default handling is used- Throws:
IllegalArgumentException- ifdefinitionisnullSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerMetric
void registerMetric(AttributeDefinition definition, OperationStepHandler metricHandler)
Records that the given attribute is a metric.- Parameters:
definition- the attribute definition. Cannot benullmetricHandler- the handler for attribute reads. Cannot benull- Throws:
IllegalArgumentException- ifdefinitionormetricHandlerarenullSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterAttribute
void unregisterAttribute(String attributeName)
Remove that the given attribute if present.- Parameters:
attributeName- the name of the attribute. Cannot benull- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerProxyController
void registerProxyController(PathElement address, ProxyController proxyController)
Register a proxy controller.- Parameters:
address- the child of this registry that should be proxiedproxyController- the proxy controller- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterProxyController
void unregisterProxyController(PathElement address)
Unregister a proxy controller- Parameters:
address- the child of this registry that should no longer be proxied- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerAlias
void registerAlias(PathElement address, AliasEntry aliasEntry)
Register an alias registration to another part of the model- Parameters:
address- the child of this registry that is an aliasaliasEntry- the target model- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterAlias
void unregisterAlias(PathElement address)
Unregister an alias- Parameters:
address- the child of this registry that is an alias- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerNotification
void registerNotification(NotificationDefinition notification, boolean inherited)
Record that the given notification can be emitted by this resource.- Parameters:
notification- the definition of the notification. Cannot benullinherited-trueif the notification is inherited to child nodes,falseotherwise- Throws:
IllegalArgumentException- ifnotificationisnullSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerNotification
void registerNotification(NotificationDefinition notification)
Record that the given notification can be emitted by this resource. The notification is not inherited by child nodes.- Parameters:
notification- the definition of the notification. Cannot benull- Throws:
IllegalArgumentException- ifnotificationTypeornotificationEntryisnullSecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterNotification
void unregisterNotification(String notificationType)
Remove that the given notification can be emitted by this resource.- Parameters:
notificationType- the type of the notification. Cannot benull- Throws:
SecurityException- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerCapability
void registerCapability(RuntimeCapability capability)
Registers passed capability on resource- Parameters:
capability- a capability to register
-
registerIncorporatingCapabilities
void registerIncorporatingCapabilities(Set<RuntimeCapability> capabilities)
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 will instead be included in the return value forImmutableManagementResourceRegistration.getCapabilities().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:
capabilities- 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
-
registerRequirements
void registerRequirements(Set<CapabilityReferenceRecorder> requirements)
Registers a set of CapabilityReferenceRecorder. Each recorder is a link between acapability requirement and the resource capability requiring it.- Parameters:
requirements- a set of CapabilityReferenceRecorder.
-
registerAdditionalRuntimePackages
void registerAdditionalRuntimePackages(RuntimePackageDependency... pkgs)
RegisterRuntimePackageDependencyadditional packages.- Parameters:
pkgs- The packages.
-
-