checkServiceAvailability

open fun checkServiceAvailability(@NotNull serviceContainer: @NotNull ServiceContainer, @NotNull checkedClass: @NotNull Class<out Any>): @Nullable String(source)

Checks if the given class can be instantiated, if an error message is returned, the service cannot be instantiated.

Exceptions caused by failed service retrieval will be caught, and used as the error message, which will render the given class unusable and may or may not prevent initialization.

Return

An error string if the service is not instantiable, null otherwise

Parameters

serviceContainer

The service container for this context

checkedClass

The primary type of the service being created, the class being instantiated for services, or the return type for service factories