public final class CapabilityRegistry extends Object implements ImmutableCapabilityRegistry, PossibleCapabilityRegistry, RuntimeCapabilityRegistry
capabilities
available in the system.Constructor and Description |
---|
CapabilityRegistry(boolean forServer) |
Modifier and Type | Method and Description |
---|---|
Set<CapabilityRegistration> |
getCapabilities()
Returns set of runtime capabilities registered in the registry
|
<T> T |
getCapabilityRuntimeAPI(String capabilityName,
CapabilityScope scope,
Class<T> apiType)
Gets the runtime API associated with a given capability, if there is one.
|
org.jboss.msc.service.ServiceName |
getCapabilityServiceName(String capabilityName,
CapabilityScope scope,
Class<?> serviceType)
Gets the name of the service provided by the capability, if there is one.
|
Set<CapabilityRegistration> |
getPossibleCapabilities()
Returns set of possible capabilities with there registration points registered in the registry
|
Set<PathAddress> |
getPossibleProviderPoints(CapabilityId capabilityId)
Returns possible provider points for passed capabilityId
|
boolean |
hasCapability(String capabilityName,
CapabilityScope scope)
Gets whether a runtime capability with the given name is registered.
|
void |
registerAdditionalCapabilityRequirement(RuntimeRequirementRegistration requirement)
Registers an additional requirement a capability has beyond what it was aware of when
capability
was passed to registerCapability(RuntimeCapabilityRegistration) . |
void |
registerCapability(RuntimeCapabilityRegistration capabilityRegistration)
Registers a capability with the system.
|
void |
registerPossibleCapability(Capability capability,
PathAddress registrationPoint)
Registers a capability with the system.
|
RuntimeCapabilityRegistration |
removeCapability(String capabilityName,
CapabilityScope scope,
PathAddress registrationPoint)
Remove a previously registered capability if all registration points for it have been removed.
|
void |
removeCapabilityRequirement(RuntimeRequirementRegistration requirementRegistration)
Remove a previously registered requirement for a capability.
|
CapabilityRegistration |
removePossibleCapability(Capability capability,
PathAddress registrationPoint)
Remove a previously registered capability if all registration points for it have been removed.
|
public void registerCapability(RuntimeCapabilityRegistration capabilityRegistration)
requirements
associated with the capability will be recorded as requirements.registerCapability
in interface RuntimeCapabilityRegistry
capabilityRegistration
- the capability. Cannot be null
public void registerAdditionalCapabilityRequirement(RuntimeRequirementRegistration requirement)
capability
was passed to registerCapability(RuntimeCapabilityRegistration)
. Used for cases
where a capability optionally depends on another capability, and whether or not that requirement is needed is
not known when the capability is first registered.registerAdditionalCapabilityRequirement
in interface RuntimeCapabilityRegistry
requirement
- the requirementIllegalArgumentException
- if no matching capability is currently
registered
for either required
or dependent
public void removeCapabilityRequirement(RuntimeRequirementRegistration requirementRegistration)
removeCapabilityRequirement
in interface RuntimeCapabilityRegistry
requirementRegistration
- the requirement. Cannot be null
registerAdditionalCapabilityRequirement(org.jboss.as.controller.capability.registry.RuntimeRequirementRegistration)
public RuntimeCapabilityRegistration removeCapability(String capabilityName, CapabilityScope scope, PathAddress registrationPoint)
removeCapability
in interface RuntimeCapabilityRegistry
capabilityName
- the name of the capability. Cannot be null
scope
- the context in which the capability is registered. Cannot be null
registrationPoint
- the specific registration point that is being removednull
if no matching capability was registered or other
registration points for the capability still existpublic void registerPossibleCapability(Capability capability, PathAddress registrationPoint)
requirements
associated with the capability will be recorded as requirements.registerPossibleCapability
in interface PossibleCapabilityRegistry
capability
- the capability. Cannot be null
public CapabilityRegistration removePossibleCapability(Capability capability, PathAddress registrationPoint)
removePossibleCapability
in interface PossibleCapabilityRegistry
capability
- the capability. Cannot be null
registrationPoint
- the specific registration point that is being removednull
if no matching capability was registered or other
registration points for the capability still existpublic boolean hasCapability(String capabilityName, CapabilityScope scope)
ImmutableCapabilityRegistry
hasCapability
in interface ImmutableCapabilityRegistry
capabilityName
- the name of the capability. Cannot be null
scope
- the scope in which to check for the capabilitytrue
if there is a capability with the given name registeredpublic <T> T getCapabilityRuntimeAPI(String capabilityName, CapabilityScope scope, Class<T> apiType)
ImmutableCapabilityRegistry
getCapabilityRuntimeAPI
in interface ImmutableCapabilityRegistry
T
- the java type that exposes the APIcapabilityName
- the name of the capability. Cannot be null
scope
- the scope in which to resolve the capability. Cannot be null
apiType
- class of the java type that exposes the API. Cannot be null
null
public Set<CapabilityRegistration> getCapabilities()
ImmutableCapabilityRegistry
getCapabilities
in interface ImmutableCapabilityRegistry
Set
with all runtime capabilities and where ware they registeredpublic Set<CapabilityRegistration> getPossibleCapabilities()
ImmutableCapabilityRegistry
getPossibleCapabilities
in interface ImmutableCapabilityRegistry
Set
with all possible capabilities and where ware they registeredpublic org.jboss.msc.service.ServiceName getCapabilityServiceName(String capabilityName, CapabilityScope scope, Class<?> serviceType)
ImmutableCapabilityRegistry
getCapabilityServiceName
in interface ImmutableCapabilityRegistry
capabilityName
- the name of the capability. Cannot be null
scope
- the scope in which to resolve the capability. Cannot be null
serviceType
- the type of the value provided by the service. May be null
if the caller is
unconcerned about checking that its understanding of the service type provided by the
capability is correctnull
public Set<PathAddress> getPossibleProviderPoints(CapabilityId capabilityId)
ImmutableCapabilityRegistry
getPossibleProviderPoints
in interface ImmutableCapabilityRegistry
capabilityId
- id of capabilitynull
but can be emptyCopyright © 2023 JBoss by Red Hat. All rights reserved.