Class SoftServiceLoader.StaticDefinition<S>

java.lang.Object
io.micronaut.core.io.service.SoftServiceLoader.StaticDefinition<S>
Type Parameters:
S - The service type
All Implemented Interfaces:
ServiceDefinition<S>
Enclosing class:
SoftServiceLoader<S>

public static final class SoftServiceLoader.StaticDefinition<S> extends Object implements ServiceDefinition<S>
A ServiceDefinition implementation that creates instances using the same instantiation strategy as SoftServiceLoader.instantiate(Class): it first attempts to invoke a no-argument constructor via a MethodHandles.Lookup method handle, and if that fails due to access restrictions or similar conditions, it falls back to reflective instantiation using
invalid reference
java.lang.Class#getDeclaredConstructor()
. Depending on module and security configuration, this may allow invoking non-public no-argument constructors.
Since:
1.0
Author:
Graeme Rocher