registerInstanceSupplier

fun <T : Any> registerInstanceSupplier(clazz: Class<T>, instanceSupplier: InstanceSupplier<T>)(source)

Deprecated

For removal, replaced by registerServiceSupplier

Registers a supplier lazily returning an instance of the specified class, the instance is then made available via dependency injection.

The class it is registered as (T) is searched for the usual annotations such as @Primary, @InterfacedService and @Lazy.

Note: The class still needs to be in the search path, either using BConfigBuilder.addSearchPath or BConfigBuilder.addClass.

Parameters

clazz

The primary type as which the service is registered as, other types may be registered with the usual annotations

instanceSupplier

Supplier for the service instance, ran at startup, unless clazz is annotated with @Lazy