Interface ImmutableCapabilityRegistry
-
- All Known Subinterfaces:
RuntimeCapabilityRegistry
- All Known Implementing Classes:
CapabilityRegistry
public interface ImmutableCapabilityRegistryA read-only view ofCapabilityRegistryCapability registry contains two kinds of capabilities: - possible capabilities which are defined on each resource to provide what said resource and provide at runtime - runtime or actual capabilities which are runtime instances of possible capabilities- Author:
- Tomaz Cerar (c) 2015 Red Hat Inc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Set<CapabilityRegistration<?>>getCapabilities()Returns set of runtime capabilities registered in the registryCapabilityRegistration<?>getCapability(CapabilityId capabilityId)returns capability registration for capability id pass as parameter<T> TgetCapabilityRuntimeAPI(String capabilityName, CapabilityScope scope, Class<T> apiType)Gets the runtime API associated with a given capability, if there is one.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(String capabilityName, CapabilityScope scope, Class<?> serviceType)Gets the name of the service provided by the capability, if there is one.Set<String>getDynamicCapabilityNames(String referencedCapability, CapabilityScope dependentScope)Retrieve all the capability names that the passed scope can accessSet<CapabilityRegistration<?>>getPossibleCapabilities()Returns set of possible capabilities with there registration points registered in the registrySet<PathAddress>getPossibleProviderPoints(CapabilityId capabilityId)Returns possible provider points for passed capabilityIdbooleanhasCapability(String capabilityName, CapabilityScope scope)Gets whether a runtime capability with the given name is registered.
-
-
-
Method Detail
-
hasCapability
boolean hasCapability(String capabilityName, CapabilityScope scope)
Gets whether a runtime capability with the given name is registered.- Parameters:
capabilityName- the name of the capability. Cannot benullscope- the scope in which to check for the capability- Returns:
trueif there is a capability with the given name registered
-
getCapabilityRuntimeAPI
<T> T getCapabilityRuntimeAPI(String capabilityName, CapabilityScope scope, Class<T> apiType)
Gets the runtime API associated with a given capability, if there is one.- Type Parameters:
T- the java type that exposes the API- Parameters:
capabilityName- the name of the capability. Cannot benullscope- the scope in which to resolve the capability. Cannot benullapiType- class of the java type that exposes the API. Cannot benull- Returns:
- the runtime API. Will not return
null - Throws:
IllegalArgumentException- if the capability does not provide a runtime APIClassCastException- if the runtime API exposed by the capability cannot be cast to type {code T}
-
getCapabilities
Set<CapabilityRegistration<?>> getCapabilities()
Returns set of runtime capabilities registered in the registry- Returns:
- read only
Setwith all runtime capabilities and where ware they registered
-
getPossibleCapabilities
Set<CapabilityRegistration<?>> getPossibleCapabilities()
Returns set of possible capabilities with there registration points registered in the registry- Returns:
- read only
Setwith all possible capabilities and where ware they registered
-
getCapabilityServiceName
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.- Parameters:
capabilityName- the name of the capability. Cannot benullscope- the scope in which to resolve the capability. Cannot benullserviceType- the type of the value provided by the service. May benullif the caller is unconcerned about checking that its understanding of the service type provided by the capability is correct- Returns:
- the service name. Will not return
null - Throws:
IllegalStateException- if no capability with the given name is available in the given contextIllegalArgumentException- if the capability does not provide a service, or ifserviceTypeis notnulland the type of the service the capability provides is not assignable from it
-
getPossibleProviderPoints
Set<PathAddress> getPossibleProviderPoints(CapabilityId capabilityId)
Returns possible provider points for passed capabilityId- Parameters:
capabilityId- id of capability- Returns:
- set of PathAddress-es where capability could be registered, will not return
nullbut can be empty
-
getCapability
CapabilityRegistration<?> getCapability(CapabilityId capabilityId)
returns capability registration for capability id pass as parameter- Parameters:
capabilityId- id of capability with its scope.- Returns:
- CapabilityRegistration or null if none is found
-
getDynamicCapabilityNames
Set<String> getDynamicCapabilityNames(String referencedCapability, CapabilityScope dependentScope)
Retrieve all the capability names that the passed scope can access- Parameters:
referencedCapability- The static name of the capabilitydependentScope- The scope from which the capability is referenced- Returns:
- A set of capabilities name. Only the dynamic part of the name is returned
-
-