Class RuntimeCapability<T>
java.lang.Object
org.jboss.as.controller.capability.RuntimeCapability<T>
- Type Parameters:
T- the type of the runtime API object exposed by the capability
- All Implemented Interfaces:
Capability,Feature
A capability exposed in a running WildFly process.
- Author:
- Brian Stansberry (c) 2014 Red Hat Inc.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildDynamicCapabilityName(String baseName, String dynamicNameElement) static StringbuildDynamicCapabilityName(String baseName, String... dynamicNameElement) Constructs a full capability name from a static base name and a dynamic element.booleanfromBaseCapability(String dynamicElement) fromBaseCapability(String... dynamicElement) Creates a fully named capability from adynamically namedbase capability.Creates a fully named capability from adynamically namedbase capability.org.jboss.msc.service.ServiceNameGets the name of the service provided by this capability, if there is one.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(Class<?> serviceValueType) Gets the name of service provided by this capability.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(Class<?> serviceValueType, String... dynamicNameElements) org.jboss.msc.service.ServiceNamegetCapabilityServiceName(String... dynamicNameElements) Gets the name of the service provided by this capability, if there is one.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(String dynamicNameElement, Class<?> serviceValueType) Gets the name of service provided by this capability.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(PathAddress address) Gets the name of the service provided by this capability, if there is one.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(PathAddress address, Class<?> serviceValueType) Gets the name of service provided by this capability.Class<?>Gets the valid type to pass togetCapabilityServiceName(Class).getDynamicName(String dynamicNameElement) Gets the full name of a capability, including a dynamic elementgetDynamicName(PathAddress address) getName()Gets the basic name of the capability.Gets the names of other capabilities required by this capability.Object encapsulating the API exposed by this capability to other capabilities that require it, if it does expose such an API.Returns the stability level of this feature.inthashCode()booleanGets whether this capability can be registered at more than one point within the same overall scope.booleanGets whether this capability is a dynamically named one, whose runtime variants will have a dynamic element added to the base name provided byCapability.getName().static <T> StringresolveCapabilityName(BinaryServiceDescriptor<T> descriptor, String parent, String child) Resolves the full capability name from a binary service descriptor and references.static <T> StringresolveCapabilityName(QuaternaryServiceDescriptor<T> descriptor, String greatGrandparent, String grandparent, String parent, String child) Resolves the full capability name from a ternary service descriptor and references.static <T> StringresolveCapabilityName(TernaryServiceDescriptor<T> descriptor, String grandparent, String parent, String child) Resolves the full capability name from a ternary service descriptor and references.static <T> StringresolveCapabilityName(UnaryServiceDescriptor<T> descriptor, String name) Resolves the full capability name from a unary service descriptor and reference.toString()
-
Method Details
-
buildDynamicCapabilityName
-
fromBaseCapability
-
buildDynamicCapabilityName
Constructs a full capability name from a static base name and a dynamic element.- Parameters:
baseName- the base name. Cannot benulldynamicNameElement- the dynamic portion of the name. Cannot benull- Returns:
- the full capability name. Will not return
null
-
resolveCapabilityName
Resolves the full capability name from a unary service descriptor and reference.- Parameters:
descriptor- a service descriptorname- the dynamic name component- Returns:
- the full capability name.
-
resolveCapabilityName
public static <T> String resolveCapabilityName(BinaryServiceDescriptor<T> descriptor, String parent, String child) Resolves the full capability name from a binary service descriptor and references.- Parameters:
descriptor- a service descriptorparent- the first dynamic name componentchild- the second dynamic name component- Returns:
- the full capability name.
-
resolveCapabilityName
public static <T> String resolveCapabilityName(TernaryServiceDescriptor<T> descriptor, String grandparent, String parent, String child) Resolves the full capability name from a ternary service descriptor and references.- Parameters:
descriptor- a service descriptorgrandparent- the first dynamic name componentparent- the second dynamic name componentchild- the third dynamic name component- Returns:
- the full capability name.
-
resolveCapabilityName
public static <T> String resolveCapabilityName(QuaternaryServiceDescriptor<T> descriptor, String greatGrandparent, String grandparent, String parent, String child) Resolves the full capability name from a ternary service descriptor and references.- Parameters:
descriptor- a service descriptorgreatGrandparent- the first dynamic name componentgrandparent- the second dynamic name componentparent- the third dynamic name componentchild- the fourth dynamic name component- Returns:
- the full capability name.
-
getCapabilityServiceName
public org.jboss.msc.service.ServiceName getCapabilityServiceName()Gets the name of the service provided by this capability, if there is one.- Returns:
- the name of the service. Will not be
null - Throws:
IllegalArgumentException- if the capability does not provide a service
-
getCapabilityServiceName
Gets the name of service provided by this capability.- Parameters:
serviceValueType- the expected type of the service's value. Only used to provide validate that the service value type provided by the capability matches the caller's expectation. May benullin which case no validation is performed- Returns:
- the name of the service. Will not be
null - Throws:
IllegalArgumentException- if the capability does not provide a service or if its value type is not assignable toserviceValueType
-
getCapabilityServiceName
Gets the name of the service provided by this capability, if there is one. Only usable withdynamically namedcapabilities.- Parameters:
dynamicNameElements- the dynamic portion of the capability name. Cannot benull- Returns:
- the name of the service. Will not be
null - Throws:
IllegalArgumentException- if the capability does not provide a serviceAssertionError- ifisDynamicallyNamed()does not returntrue
-
getCapabilityServiceName
Gets the name of the service provided by this capability, if there is one. Only usable withdynamically namedcapabilities.- Parameters:
address- Path address for which service name is calculated from Cannot benull- Returns:
- the name of the service. Will not be
null - Throws:
IllegalArgumentException- if the capability does not provide a serviceAssertionError- ifisDynamicallyNamed()does not returntrue
-
getCapabilityServiceName
public org.jboss.msc.service.ServiceName getCapabilityServiceName(String dynamicNameElement, Class<?> serviceValueType) Gets the name of service provided by this capability.- Parameters:
dynamicNameElement- the dynamic portion of the capability name. Cannot benullserviceValueType- the expected type of the service's value. Only used to provide validate that the service value type provided by the capability matches the caller's expectation. May benullin which case no validation is performed- Returns:
- the name of the service. Will not be
null - Throws:
IllegalArgumentException- if the capability does not provide a service or if its value type is not assignable toserviceValueTypeIllegalStateException- ifisDynamicallyNamed()does not returntrue
-
getCapabilityServiceName
-
getCapabilityServiceName
public org.jboss.msc.service.ServiceName getCapabilityServiceName(PathAddress address, Class<?> serviceValueType) Gets the name of service provided by this capability.- Parameters:
address- the path from which dynamic portion of the capability name is calculated from. Cannot benullserviceValueType- the expected type of the service's value. Only used to provide validate that the service value type provided by the capability matches the caller's expectation. May benullin which case no validation is performed- Returns:
- the name of the service. Will not be
null - Throws:
IllegalArgumentException- if the capability does not provide a service or if its value type is not assignable toserviceValueTypeIllegalStateException- ifisDynamicallyNamed()does not returntrue
-
getCapabilityServiceValueType
Gets the valid type to pass togetCapabilityServiceName(Class).- Returns:
- the valid type. May be
nullif this capability does not provide a service
-
getRuntimeAPI
Object encapsulating the API exposed by this capability to other capabilities that require it, if it does expose such an API.- Returns:
- the API object, or
nullif the capability exposes no API to other capabilities
-
isAllowMultipleRegistrations
public boolean isAllowMultipleRegistrations()Gets whether this capability can be registered at more than one point within the same overall scope.- Returns:
trueif the capability can legally be registered in more than one location in the same scope;falseif an attempt to do this should result in an exception
-
fromBaseCapability
Creates a fully named capability from adynamically namedbase capability. Capability providers should use this method to generate fully named capabilities in logic that handles dynamically named resources.- Parameters:
dynamicElement- the dynamic portion of the full capability name. Cannot benullor empty- Returns:
- the fully named capability.
- Throws:
AssertionError- ifisDynamicallyNamed()returnsfalse
-
fromBaseCapability
Creates a fully named capability from adynamically namedbase capability. Capability providers should use this method to generate fully named capabilities in logic that handles dynamically named resources.- Parameters:
path- the dynamic portion of the full capability name. Cannot benullor empty- Returns:
- the fully named capability.
- Throws:
AssertionError- ifisDynamicallyNamed()returnsfalse
-
getName
Description copied from interface:CapabilityGets the basic name of the capability. IfCapability.isDynamicallyNamed()returnstruethis will be the basic name of the capability, not including any dynamic portions.- Specified by:
getNamein interfaceCapability- Returns:
- the name. Will not be
null - See Also:
-
getRequirements
Description copied from interface:CapabilityGets the names of other capabilities required by this capability. These are static requirements.- Specified by:
getRequirementsin interfaceCapability- Returns:
- the capability names. Will not be
nullbut may be empty.
-
isDynamicallyNamed
public boolean isDynamicallyNamed()Description copied from interface:CapabilityGets whether this capability is a dynamically named one, whose runtime variants will have a dynamic element added to the base name provided byCapability.getName().- Specified by:
isDynamicallyNamedin interfaceCapability- Returns:
trueif this capability is dynamically named
-
getDynamicName
Description copied from interface:CapabilityGets the full name of a capability, including a dynamic element- Specified by:
getDynamicNamein interfaceCapability- Parameters:
dynamicNameElement- the dynamic portion of the name. Cannot benull- Returns:
- the full capability name
-
getDynamicName
- Specified by:
getDynamicNamein interfaceCapability
-
getStability
Description copied from interface:FeatureReturns the stability level of this feature.- Specified by:
getStabilityin interfaceFeature- Returns:
- a stability level
-
equals
-
hashCode
public int hashCode() -
toString
-