T - type of the service to be loadedpublic static final class HelidonServiceLoader.Builder<T> extends Object implements Builder<HelidonServiceLoader<T>>
HelidonServiceLoader.| Modifier and Type | Method and Description |
|---|---|
HelidonServiceLoader.Builder<T> |
addExcludedClass(Class<? extends T> excluded)
Add an excluded implementation class - if such a service implementation is configured (either through
Java Service loader or through
addService(Object)), it would be ignored. |
HelidonServiceLoader.Builder<T> |
addExcludedClassName(String excludeName)
Add an excluded implementation class - if such a service implementation is configured (either through
Java Service loader or through
addService(Object)), it would be ignored. |
HelidonServiceLoader.Builder<T> |
addService(T service)
Add a custom service implementation to the list of services.
|
HelidonServiceLoader.Builder<T> |
addService(T service,
int priority)
Add a custom service implementation to the list of services with a custom priority.
|
HelidonServiceLoader<T> |
build() |
HelidonServiceLoader.Builder<T> |
replaceImplementations(boolean replace)
When configured to replace implementations, then a service implementation configured through
addService(Object)
will replace the same implementation loaded from the Java Service loader (compared by fully qualified class name). |
HelidonServiceLoader.Builder<T> |
useSystemExcludes(boolean useSysPropExclude)
When configured to use system excludes, system property is used to get the
comma separated list of service implementations to exclude them from the loaded list.
|
HelidonServiceLoader.Builder<T> |
useSystemServiceLoader(boolean useServiceLoader)
When configured to use Java Service loader, then the result is a combination of all service implementations
loaded from the Java Service loader and those added by
addService(Object) or addService(Object, int). |
public HelidonServiceLoader<T> build()
build in interface Builder<HelidonServiceLoader<T>>public HelidonServiceLoader.Builder<T> useSystemExcludes(boolean useSysPropExclude)
This defaults to true.
useSysPropExclude - whether to use a system property to exclude service implementationspublic HelidonServiceLoader.Builder<T> useSystemServiceLoader(boolean useServiceLoader)
addService(Object) or addService(Object, int).
When set to false the Java Service loader is ignored.
This defaults to true.
useServiceLoader - whether to use the Java Service loaderpublic HelidonServiceLoader.Builder<T> replaceImplementations(boolean replace)
addService(Object)
will replace the same implementation loaded from the Java Service loader (compared by fully qualified class name).
This defaults to true.
replace - whether to replace service instances loaded by java service loader with the ones provided
through builder methodspublic HelidonServiceLoader.Builder<T> addService(T service)
service - a new service instancepublic HelidonServiceLoader.Builder<T> addService(T service, int priority)
service - a new service instancepriority - priority to use when ordering service instancespublic HelidonServiceLoader.Builder<T> addExcludedClass(Class<? extends T> excluded)
addService(Object)), it would be ignored.excluded - excluded implementation classpublic HelidonServiceLoader.Builder<T> addExcludedClassName(String excludeName)
addService(Object)), it would be ignored.excludeName - excluded implementation class nameCopyright © 2018–2019 Oracle Corporation. All rights reserved.