register Service Supplier
inline fun <T : Any> BServiceConfigBuilder.registerServiceSupplier(name: String = ServiceSupplier.defaultName(T::class), additionalTypes: Set<KClass<in T>> = emptySet(), isPrimary: Boolean = false, isLazy: Boolean = false, priority: Int = 0, annotations: List<Annotation> = emptyList(), noinline supplier: (BContext) -> T)(source)
Registers a supplier which gets loaded in the same manner as annotated service classes/factories.
Note: The annotations passed will not be readable using standard reflection, they are only read when functions like ServiceContainer.findAnnotationOnService or ServiceContainer.getServiceNamesForAnnotation are used.
Parameters
T
The type as which the service will be registered as
name
The name to register the service as
additional Types
Additional types this service can be retrieved as
is Primary
Whether this service should be a primary service
is Lazy
Whether this service should be initialized only when requested
priority
The priority of this service
annotations
Annotations which should be tied to this service
supplier
The function supplying the service