public final class ServiceProviderBuildItem extends MultiBuildItem
providers() for reflection (instantiation only).| Constructor and Description |
|---|
ServiceProviderBuildItem(String serviceInterfaceClassName,
Collection<String> providers)
Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only)
of the specified provider classes.
|
ServiceProviderBuildItem(String serviceInterfaceClassName,
List<String> providers)
Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only)
of the specified provider classes.
|
ServiceProviderBuildItem(String serviceInterfaceClassName,
String... providerClassNames)
Registers the specified service interface descriptor to be embedded and allow reflection (instantiation only)
of the specified provider classes.
|
| Modifier and Type | Method and Description |
|---|---|
static ServiceProviderBuildItem |
allProviders(String serviceInterfaceClassName,
Path serviceInterfaceDescriptorFile)
Creates and returns a
ServiceProviderBuildItem for the serviceInterfaceClassName by including
all the providers that are listed in the service interface descriptor file. |
static ServiceProviderBuildItem |
allProvidersFromClassPath(String serviceInterfaceClassName)
Creates and returns a new
ServiceProviderBuildItem for the given serviceInterfaceClassName by
including all the providers that are listed in service interface descriptor files
"META-INF/services/" + serviceInterfaceClassName findable in the Context Class Loader of the current
thread. |
List<String> |
providers() |
String |
serviceDescriptorFile() |
public static final String SPI_ROOT
public ServiceProviderBuildItem(String serviceInterfaceClassName, String... providerClassNames)
serviceInterfaceClassName - the interface whose service interface descriptor file we want to embedproviderClassNames - the list of provider class names that must already be mentioned in the filepublic ServiceProviderBuildItem(String serviceInterfaceClassName, Collection<String> providers)
serviceInterfaceClassName - the interface whose service interface descriptor file we want to embedproviders - a collection of provider class names that must already be mentioned in the filepublic ServiceProviderBuildItem(String serviceInterfaceClassName, List<String> providers)
serviceInterfaceClassName - the interface whose service interface descriptor file we want to embedproviders - the list of provider class names that must already be mentioned in the filepublic static ServiceProviderBuildItem allProviders(String serviceInterfaceClassName, Path serviceInterfaceDescriptorFile) throws IOException
ServiceProviderBuildItem for the serviceInterfaceClassName by including
all the providers that are listed in the service interface descriptor file.serviceInterfaceClassName - the interface whose service interface descriptor file we want to embedserviceInterfaceDescriptorFile - the path to the service interface descriptor fileIOExceptionpublic static ServiceProviderBuildItem allProvidersFromClassPath(String serviceInterfaceClassName)
ServiceProviderBuildItem for the given serviceInterfaceClassName by
including all the providers that are listed in service interface descriptor files
"META-INF/services/" + serviceInterfaceClassName findable in the Context Class Loader of the current
thread.serviceInterfaceClassName - the interface whose service interface descriptor file we want to embedServiceProviderBuildItemRuntimeException - wrapping any IOExceptions thrown when accessing class path resourcespublic String serviceDescriptorFile()
Copyright © 2021 JBoss by Red Hat. All rights reserved.