Package org.atmosphere.nativeimage
Class PoolNativeImageMetadataProvider
java.lang.Object
org.atmosphere.nativeimage.PoolNativeImageMetadataProvider
- All Implemented Interfaces:
NativeImageMetadataProvider
Pooled-object types, contributed only when commons-pool2 is present.
The demonstration of why NativeImageMetadataProvider.isAvailable()
exists: these types extend commons-pool2 interfaces, so naming them in an
image built without that dependency asks GraalVM to resolve a supertype that
is not there. Gating on the dependency keeps the metadata honest about what
this particular application actually contains.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether this provider applies to the current classpath.name()Identifier for logs and the generated metadata's provenance comment.Fully-qualified names of types that are constructed, inspected or invoked reflectively — typically anything selected by an init-param or read from aServiceLoaderfile.isAvailable()alone is not enough for the metadata shipped in theatmosphere-runtimejar: it is generated where commons-pool2 is on the classpath, so the condition keeps an application image without commons-pool2 from initializing these types against a missing supertype.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.atmosphere.nativeimage.NativeImageMetadataProvider
priority, resourcePatterns
-
Constructor Details
-
PoolNativeImageMetadataProvider
public PoolNativeImageMetadataProvider()
-
-
Method Details
-
name
Description copied from interface:NativeImageMetadataProviderIdentifier for logs and the generated metadata's provenance comment.- Specified by:
namein interfaceNativeImageMetadataProvider
-
isAvailable
public boolean isAvailable()Description copied from interface:NativeImageMetadataProviderWhether this provider applies to the current classpath. A provider covering an optional dependency returnsfalsewhen that dependency is absent, so its types are not registered into an image that cannot contain them.- Specified by:
isAvailablein interfaceNativeImageMetadataProvider- Returns:
trueto include this provider's metadata
-
typeReachedCondition
isAvailable()alone is not enough for the metadata shipped in theatmosphere-runtimejar: it is generated where commons-pool2 is on the classpath, so the condition keeps an application image without commons-pool2 from initializing these types against a missing supertype.- Specified by:
typeReachedConditionin interfaceNativeImageMetadataProvider- Returns:
- a fully-qualified type name, or
nullfor unconditional
-
reflectiveTypes
Description copied from interface:NativeImageMetadataProviderFully-qualified names of types that are constructed, inspected or invoked reflectively — typically anything selected by an init-param or read from aServiceLoaderfile.Names rather than
Classliterals: a provider must be able to declare a type from an optional dependency without forcing that dependency to be present, which is the same reason the framework's ownAtmosphereReflectiveTypesis a list of strings.- Specified by:
reflectiveTypesin interfaceNativeImageMetadataProvider- Returns:
- type names, never
null
-