T
- the type of the runtime API object exposed by the capabilitypublic class RuntimeCapability<T> extends AbstractCapability
Modifier and Type | Class and Description |
---|---|
static class |
RuntimeCapability.Builder<T>
Builder for a
RuntimeCapability . |
Constructor and Description |
---|
RuntimeCapability(String name,
T runtimeAPI,
Set<String> requirements)
Deprecated.
|
RuntimeCapability(String name,
T runtimeAPI,
Set<String> requirements,
Set<String> optionalRequirements)
Deprecated.
|
RuntimeCapability(String name,
T runtimeAPI,
String... requirements)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static String |
buildDynamicCapabilityName(String baseName,
String dynamicNameElement)
Constructs a full capability name from a static base name and a dynamic element.
|
static <T> RuntimeCapability<T> |
fromBaseCapability(RuntimeCapability<T> base,
String dynamicElement)
Deprecated.
use
fromBaseCapability(String) on base |
RuntimeCapability<T> |
fromBaseCapability(String dynamicElement)
Creates a fully named capability from a
dynamically named base
capability. |
org.jboss.msc.service.ServiceName |
getCapabilityServiceName()
Gets the name of the service provided by this capability, if there is one.
|
org.jboss.msc.service.ServiceName |
getCapabilityServiceName(Class<?> serviceValueType)
Gets the name of service provided by this capability.
|
org.jboss.msc.service.ServiceName |
getCapabilityServiceName(String dynamicNameElement)
Gets the name of the service provided by this capability, if there is one.
|
org.jboss.msc.service.ServiceName |
getCapabilityServiceName(String dynamicNameElement,
Class<?> serviceValueType)
Gets the name of service provided by this capability.
|
Class<?> |
getCapabilityServiceValueType()
Gets the valid type to pass to
getCapabilityServiceName(Class) . |
T |
getRuntimeAPI()
Object encapsulating the API exposed by this capability to other capabilities that require it, if it does
expose such an API.
|
equals, getDynamicName, getDynamicOptionalRequirements, getDynamicRequirements, getName, getOptionalRequirements, getRequirements, getRuntimeOnlyRequirements, hashCode, isDynamicallyNamed, toString
@Deprecated public RuntimeCapability(String name, T runtimeAPI, Set<String> requirements, Set<String> optionalRequirements)
RuntimeCapability.Builder
name
- the name of the capability. Cannot be null
runtimeAPI
- implementation of the API exposed by this capability to other capabilities. May be null
requirements
- names of other capabilities upon which this capability has a hard requirement. May be null
optionalRequirements
- names of other capabilities upon which this capability has an optional requirement. May be null
@Deprecated public RuntimeCapability(String name, T runtimeAPI, Set<String> requirements)
RuntimeCapability.Builder
name
- the name of the capability. Cannot be null
runtimeAPI
- implementation of the API exposed by this capability to other capabilities. May be null
requirements
- names of other capabilities upon which this capability has a hard requirement. May be null
@Deprecated public RuntimeCapability(String name, T runtimeAPI, String... requirements)
RuntimeCapability.Builder
name
- the name of the capability. Cannot be null
runtimeAPI
- implementation of the API exposed by this capability to other capabilities. May be null
requirements
- names of other capabilities upon which this capability has a hard requirement. May be null
public static String buildDynamicCapabilityName(String baseName, String dynamicNameElement)
baseName
- the base name. Cannot be null
dynamicNameElement
- the dynamic portion of the name. Cannot be null
null
@Deprecated public static <T> RuntimeCapability<T> fromBaseCapability(RuntimeCapability<T> base, String dynamicElement)
fromBaseCapability(String)
on base
dynamically named
base
capability. Capability providers should use this method to generate fully named capabilities in logic
that handles dynamically named resources.T
- the type of the runtime API object exposed by the capabilitybase
- the base capability. Cannot be null
, and AbstractCapability.isDynamicallyNamed()
must return true
dynamicElement
- the dynamic portion of the full capability name. Cannot be null
or emptypublic org.jboss.msc.service.ServiceName getCapabilityServiceName()
null
IllegalArgumentException
- if the capability does not provide a servicepublic org.jboss.msc.service.ServiceName getCapabilityServiceName(Class<?> serviceValueType)
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 be null
in which case no validation is performednull
IllegalArgumentException
- if the capability does not provide a service or if its value type
is not assignable to serviceValueType
public org.jboss.msc.service.ServiceName getCapabilityServiceName(String dynamicNameElement)
dynamically named
capabilities.dynamicNameElement
- the dynamic portion of the capability name. Cannot be null
null
IllegalArgumentException
- if the capability does not provide a serviceAssertionError
- if AbstractCapability.isDynamicallyNamed()
does not return true
public org.jboss.msc.service.ServiceName getCapabilityServiceName(String dynamicNameElement, Class<?> serviceValueType)
dynamicNameElement
- the dynamic portion of the capability name. Cannot be null
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 be null
in which case no validation is performednull
IllegalArgumentException
- if the capability does not provide a service or if its value type
is not assignable to serviceValueType
IllegalStateException
- if AbstractCapability.isDynamicallyNamed()
does not return true
public Class<?> getCapabilityServiceValueType()
getCapabilityServiceName(Class)
.null
if this capability does not provide a
servicepublic T getRuntimeAPI()
null
if the capability exposes no API to other capabilitiespublic RuntimeCapability<T> fromBaseCapability(String dynamicElement)
dynamically named
base
capability. Capability providers should use this method to generate fully named capabilities in logic
that handles dynamically named resources.dynamicElement
- the dynamic portion of the full capability name. Cannot be null
or emptyAssertionError
- if AbstractCapability.isDynamicallyNamed()
returns false
Copyright © 2023 JBoss by Red Hat. All rights reserved.