Class CoreNativeImageMetadataProvider

java.lang.Object
org.atmosphere.nativeimage.CoreNativeImageMetadataProvider
All Implemented Interfaces:
NativeImageMetadataProvider

public class CoreNativeImageMetadataProvider extends Object implements NativeImageMetadataProvider
What atmosphere-runtime itself needs in a native image.

Covers the framework's own by-name lookups: broadcasters and their caches, the default interceptor chain, annotation processors, websocket protocols and async-support implementations — all selected through init-params and loaded with IOUtils.loadClass, none of them reachable by static analysis.

The ServiceLoader files matter as much as the classes. Injectable implementations are discovered rather than referenced, so if the file is dropped from the image the framework finds nothing to inject and reports no error — the same silent shape as the bugs this SPI exists to prevent.

  • Constructor Details

    • CoreNativeImageMetadataProvider

      public CoreNativeImageMetadataProvider()
  • Method Details

    • name

      public String name()
      Description copied from interface: NativeImageMetadataProvider
      Identifier for logs and the generated metadata's provenance comment.
      Specified by:
      name in interface NativeImageMetadataProvider
    • priority

      public int priority()
      Runs first so the framework's own types lead the generated metadata.
      Specified by:
      priority in interface NativeImageMetadataProvider
      Returns:
      the priority, default 0
    • reflectiveTypes

      public Collection<String> reflectiveTypes()
      Description copied from interface: NativeImageMetadataProvider
      Fully-qualified names of types that are constructed, inspected or invoked reflectively — typically anything selected by an init-param or read from a ServiceLoader file.

      Names rather than Class literals: 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 own AtmosphereReflectiveTypes is a list of strings.

      Specified by:
      reflectiveTypes in interface NativeImageMetadataProvider
      Returns:
      type names, never null
    • resourcePatterns

      public Collection<String> resourcePatterns()
      Description copied from interface: NativeImageMetadataProvider
      Resource patterns that must survive into the image — ServiceLoader files above all, since a missing one turns a discovered implementation into a silently absent one.
      Specified by:
      resourcePatterns in interface NativeImageMetadataProvider
      Returns:
      patterns understood by GraalVM's resource configuration, never null