Interface CapabilityServiceSupport
-
- All Superinterfaces:
CapabilityServiceDescriptorResolver
public interface CapabilityServiceSupport extends CapabilityServiceDescriptorResolver
Provides support for capability integration outside the management layer, in service implementations.Note that use of this interface in no way creates a requirement on the referenced capability by the caller.
- Author:
- Brian Stansberry
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classCapabilityServiceSupport.NoSuchCapabilityExceptionException thrown when support for an unregistered capability is requested.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> TgetCapabilityRuntimeAPI(String capabilityName, Class<T> apiType)Gets the runtime API associated with a given capability, if there is one.<T> TgetCapabilityRuntimeAPI(String capabilityBaseName, String dynamicPart, Class<T> apiType)Gets the runtime API associated with a givendynamically namedcapability, if there is one.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(String capabilityName)Gets the name of a service associated with a given capability.org.jboss.msc.service.ServiceNamegetCapabilityServiceName(String capabilityBaseName, String... dynamicParts)Gets the name of a service associated with a givendynamically namedcapability.default <T> org.jboss.msc.service.ServiceNamegetCapabilityServiceName(BinaryServiceDescriptor<T> descriptor, String parent, String child)Resolves theServiceNameof the capability described by the specified descriptor using the specified reference names.default <T> org.jboss.msc.service.ServiceNamegetCapabilityServiceName(NullaryServiceDescriptor<T> descriptor)Resolves theServiceNameof the capability described by the specified descriptor.default <T> org.jboss.msc.service.ServiceNamegetCapabilityServiceName(QuaternaryServiceDescriptor<T> descriptor, String greatGrandparent, String grandparent, String parent, String child)Resolves theServiceNameof the capability described by the specified descriptor using the specified reference names.default <T> org.jboss.msc.service.ServiceNamegetCapabilityServiceName(TernaryServiceDescriptor<T> descriptor, String grandparent, String parent, String child)Resolves theServiceNameof the capability described by the specified descriptor using the specified reference names.default <T> org.jboss.msc.service.ServiceNamegetCapabilityServiceName(UnaryServiceDescriptor<T> descriptor, String name)Resolves theServiceNameof the capability described by the specified descriptor using the specified reference name.<T> Optional<T>getOptionalCapabilityRuntimeAPI(String capabilityName, Class<T> apiType)Gets the runtime API associated with a given capability, if there is one.<T> Optional<T>getOptionalCapabilityRuntimeAPI(String capabilityBaseName, String dynamicPart, Class<T> apiType)Gets the runtime API associated with a givendynamically namedcapability, if there is one.booleanhasCapability(String capabilityName)Gets whether a runtime capability with the given name is registered.
-
-
-
Method Detail
-
hasCapability
boolean hasCapability(String capabilityName)
Gets whether a runtime capability with the given name is registered.- Parameters:
capabilityName- the name of the capability. Cannot benull- Returns:
trueif there is a capability with the given name registered
-
getCapabilityRuntimeAPI
<T> T getCapabilityRuntimeAPI(String capabilityName, Class<T> apiType) throws CapabilityServiceSupport.NoSuchCapabilityException
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 benullapiType- class of the java type that exposes the API. Cannot benull- Returns:
- the runtime API. Will not return
null - Throws:
CapabilityServiceSupport.NoSuchCapabilityException- if no matching capability is registeredIllegalArgumentException- if the capability does not provide a runtime APIClassCastException- if the runtime API exposed by the capability cannot be cast to type {code T}
-
getCapabilityRuntimeAPI
<T> T getCapabilityRuntimeAPI(String capabilityBaseName, String dynamicPart, Class<T> apiType) throws CapabilityServiceSupport.NoSuchCapabilityException
Gets the runtime API associated with a givendynamically namedcapability, if there is one.- Type Parameters:
T- the java type that exposes the API- Parameters:
capabilityBaseName- the base name of the capability. Cannot benulldynamicPart- the dynamic part of the capability name. Cannot benullapiType- class of the java type that exposes the API. Cannot benull- Returns:
- the runtime API. Will not return
null - Throws:
CapabilityServiceSupport.NoSuchCapabilityException- if no matching capability is registeredIllegalArgumentException- if the capability does not provide a runtime APIClassCastException- if the runtime API exposed by the capability cannot be cast to type {code T}
-
getOptionalCapabilityRuntimeAPI
<T> Optional<T> getOptionalCapabilityRuntimeAPI(String capabilityName, 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 benullapiType- class of the java type that exposes the API. Cannot benull- Returns:
- an Optional describing the value of the runtime API. If no matching capability is registered, the optional will be empty.
- 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}
-
getOptionalCapabilityRuntimeAPI
<T> Optional<T> getOptionalCapabilityRuntimeAPI(String capabilityBaseName, String dynamicPart, Class<T> apiType)
Gets the runtime API associated with a givendynamically namedcapability, if there is one.- Type Parameters:
T- the java type that exposes the API- Parameters:
capabilityBaseName- the base name of the capability. Cannot benulldynamicPart- the dynamic part of the capability name. Cannot benullapiType- class of the java type that exposes the API. Cannot benull- Returns:
- an Optional describing the value of the runtime API. If no matching capability is registered, the optional will be empty.
- 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}
-
getCapabilityServiceName
org.jboss.msc.service.ServiceName getCapabilityServiceName(String capabilityName)
Gets the name of a service associated with a given capability. This method does not confirm that the capability is currently registered.- Parameters:
capabilityName- the name of the capability. Cannot benull- Returns:
- the name of the service. Will not return
null
-
getCapabilityServiceName
org.jboss.msc.service.ServiceName getCapabilityServiceName(String capabilityBaseName, String... dynamicParts)
Gets the name of a service associated with a givendynamically namedcapability. This method does not confirm that the capability is currently registered.- Parameters:
capabilityBaseName- the base name of the capability. Cannot benulldynamicParts- the dynamic parts of the capability name. Cannot benullCan be multiple if capability supports that- Returns:
- the name of the service. Will not return
null
-
getCapabilityServiceName
default <T> org.jboss.msc.service.ServiceName getCapabilityServiceName(NullaryServiceDescriptor<T> descriptor)
Description copied from interface:CapabilityServiceDescriptorResolverResolves theServiceNameof the capability described by the specified descriptor.- Specified by:
getCapabilityServiceNamein interfaceCapabilityServiceDescriptorResolver- Type Parameters:
T- the service value type- Parameters:
descriptor- the capability service descriptor- Returns:
- the service name
-
getCapabilityServiceName
default <T> org.jboss.msc.service.ServiceName getCapabilityServiceName(UnaryServiceDescriptor<T> descriptor, String name)
Description copied from interface:CapabilityServiceDescriptorResolverResolves theServiceNameof the capability described by the specified descriptor using the specified reference name.- Specified by:
getCapabilityServiceNamein interfaceCapabilityServiceDescriptorResolver- Type Parameters:
T- the service value type- Parameters:
descriptor- the capability service descriptorname- the dynamic name component- Returns:
- the service name
-
getCapabilityServiceName
default <T> org.jboss.msc.service.ServiceName getCapabilityServiceName(BinaryServiceDescriptor<T> descriptor, String parent, String child)
Description copied from interface:CapabilityServiceDescriptorResolverResolves theServiceNameof the capability described by the specified descriptor using the specified reference names.- Specified by:
getCapabilityServiceNamein interfaceCapabilityServiceDescriptorResolver- Type Parameters:
T- the service value type- Parameters:
descriptor- the capability service descriptorparent- the first dynamic name componentchild- the second dynamic name component- Returns:
- the service name
-
getCapabilityServiceName
default <T> org.jboss.msc.service.ServiceName getCapabilityServiceName(TernaryServiceDescriptor<T> descriptor, String grandparent, String parent, String child)
Description copied from interface:CapabilityServiceDescriptorResolverResolves theServiceNameof the capability described by the specified descriptor using the specified reference names.- Specified by:
getCapabilityServiceNamein interfaceCapabilityServiceDescriptorResolver- Type Parameters:
T- the service value type- Parameters:
descriptor- the capability service descriptorgrandparent- the first dynamic name componentparent- the second dynamic name componentchild- the third dynamic name component- Returns:
- the service name
-
getCapabilityServiceName
default <T> org.jboss.msc.service.ServiceName getCapabilityServiceName(QuaternaryServiceDescriptor<T> descriptor, String greatGrandparent, String grandparent, String parent, String child)
Description copied from interface:CapabilityServiceDescriptorResolverResolves theServiceNameof the capability described by the specified descriptor using the specified reference names.- Specified by:
getCapabilityServiceNamein interfaceCapabilityServiceDescriptorResolver- Type Parameters:
T- the service value type- Parameters:
descriptor- the capability service descriptorgreatGrandparent- the first dynamic name componentgrandparent- the second dynamic name componentparent- the third dynamic name componentchild- the fourth dynamic name component- Returns:
- the service name
-
-