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
    • 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 be null
        Returns:
        true if there is a capability with the given name registered
      • hasCapability

        default boolean hasCapability​(String capabilityName,
                                      String... segments)
        Indicates whether a runtime capability with the given name and segments is registered.
        Parameters:
        capabilityName - the name of the capability. Cannot be null
        Returns:
        true if there is a capability with the given name registered
      • hasCapability

        default boolean hasCapability​(NullaryServiceDescriptor<?> descriptor)
        Indicates whether or not a runtime capability with the given descriptor is registered.
        Parameters:
        descriptor - the service descriptor of the requested capability
        Returns:
        true if there is a capability with the resolved name registered
      • hasCapability

        default boolean hasCapability​(UnaryServiceDescriptor<?> descriptor,
                                      String name)
        Indicates whether or not a runtime capability with the given descriptor and segment is registered.
        Parameters:
        descriptor - the service descriptor of the requested capability
        name - the dynamic name segment of the requested capability.
        Returns:
        true if there is a capability with the resolved name registered
      • hasCapability

        default boolean hasCapability​(BinaryServiceDescriptor<?> descriptor,
                                      String parent,
                                      String child)
        Indicates whether or not a runtime capability with the given descriptor and segments is registered.
        Parameters:
        descriptor - the service descriptor of the requested capability
        parent - the first dynamic name segment of the requested capability.
        child - the second dynamic name segment of the requested capability.
        Returns:
        true if there is a capability with the resolved name registered
      • hasCapability

        default boolean hasCapability​(TernaryServiceDescriptor<?> descriptor,
                                      String grandparent,
                                      String parent,
                                      String child)
        Indicates whether or not a runtime capability with the given descriptor and segments is registered.
        Parameters:
        descriptor - the service descriptor of the requested capability
        grandparent - the first dynamic name segment of the requested capability.
        parent - the second dynamic name segment of the requested capability.
        child - the third dynamic name segment of the requested capability.
        Returns:
        true if there is a capability with the resolved name registered
      • hasCapability

        default boolean hasCapability​(QuaternaryServiceDescriptor<?> descriptor,
                                      String greatGrandparent,
                                      String grandparent,
                                      String parent,
                                      String child)
        Indicates whether or not a runtime capability with the given descriptor and segments is registered.
        Parameters:
        descriptor - the service descriptor of the requested capability
        greatGrandparent - the first dynamic name segment of the requested capability.
        grandparent - the second dynamic name segment of the requested capability.
        parent - the third dynamic name segment of the requested capability.
        child - the fourth dynamic name segment of the requested capability.
        Returns:
        true if there is a capability with the resolved name registered
      • 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 be null
        apiType - class of the java type that exposes the API. Cannot be null
        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 API
        ClassCastException - 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 given dynamically named capability, if there is one.
        Type Parameters:
        T - the java type that exposes the API
        Parameters:
        capabilityBaseName - the base name of the capability. Cannot be null
        dynamicPart - the dynamic part of the capability name. Cannot be null
        apiType - class of the java type that exposes the API. Cannot be null
        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 API
        ClassCastException - 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 be null
        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 given dynamically named capability. This method does not confirm that the capability is currently registered.
        Parameters:
        capabilityBaseName - the base name of the capability. Cannot be null
        dynamicParts - the dynamic parts of the capability name. Cannot be null Can 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​(BinaryServiceDescriptor<T> descriptor,
                                                                               String parent,
                                                                               String child)
        Description copied from interface: CapabilityServiceDescriptorResolver
        Resolves the ServiceName of the capability described by the specified descriptor using the specified reference names.
        Specified by:
        getCapabilityServiceName in interface CapabilityServiceDescriptorResolver
        Type Parameters:
        T - the service value type
        Parameters:
        descriptor - the capability service descriptor
        parent - the first dynamic name component
        child - 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: CapabilityServiceDescriptorResolver
        Resolves the ServiceName of the capability described by the specified descriptor using the specified reference names.
        Specified by:
        getCapabilityServiceName in interface CapabilityServiceDescriptorResolver
        Type Parameters:
        T - the service value type
        Parameters:
        descriptor - the capability service descriptor
        grandparent - the first dynamic name component
        parent - the second dynamic name component
        child - 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: CapabilityServiceDescriptorResolver
        Resolves the ServiceName of the capability described by the specified descriptor using the specified reference names.
        Specified by:
        getCapabilityServiceName in interface CapabilityServiceDescriptorResolver
        Type Parameters:
        T - the service value type
        Parameters:
        descriptor - the capability service descriptor
        greatGrandparent - the first dynamic name component
        grandparent - the second dynamic name component
        parent - the third dynamic name component
        child - the fourth dynamic name component
        Returns:
        the service name