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
. Depending on module and security configuration,
this may allow invoking non-public no-argument constructors.
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()
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Method Details
-
of
-
of
-
isPresent
public boolean isPresent()- Specified by:
isPresentin interfaceServiceDefinition<S>- Returns:
- is the service present
-
getName
- Specified by:
getNamein interfaceServiceDefinition<S>- Returns:
- The full class name of the service
-
load
- Specified by:
loadin interfaceServiceDefinition<S>- Returns:
- load the service
-