Class ServiceIndexGenerator.Result

java.lang.Object
io.micronaut.aot.serviceindex.ServiceIndexGenerator.Result
Enclosing class:
ServiceIndexGenerator

@Internal public static final class ServiceIndexGenerator.Result extends Object
The outcome of one generation: its status(), one message() for the caller to log, the entries() to write into the holder and the removals() to delete from it, which the caller applies whatever the status.
Since:
3.2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Map<String,byte[]>
    The entries to write into the holder, by entry name, in order: the classes of the package io.micronaut.aot.serviceindex.generated, and the whole new META-INF/services/io.micronaut.core.optim.StaticOptimizations$Loader file, which names the generated loader first, then the lines the holder had, without an earlier index loader's.
    One line for the caller to log: what was generated, or why nothing was.
    The entries to delete from the holder: what an earlier generation left in the package io.micronaut.aot.serviceindex.generated and entries() does not replace.
    What happened.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • status

      What happened.
      Returns:
      the status
    • message

      public String message()
      One line for the caller to log: what was generated, or why nothing was. It is informational for ServiceIndexGenerator.Status.GENERATED and ServiceIndexGenerator.Status.STOOD_DOWN, and worth a warning for ServiceIndexGenerator.Status.FAILED.
      Returns:
      the line
    • entries

      public Map<String,byte[]> entries()
      The entries to write into the holder, by entry name, in order: the classes of the package io.micronaut.aot.serviceindex.generated, and the whole new META-INF/services/io.micronaut.core.optim.StaticOptimizations$Loader file, which names the generated loader first, then the lines the holder had, without an earlier index loader's. Each replaces an entry of the same name.

      They are also non-empty for ServiceIndexGenerator.Status.STOOD_DOWN or ServiceIndexGenerator.Status.FAILED when those remove an earlier index from the holder: then they hold the loader file without the index loader. Callers always apply them.

      Returns:
      the entries, unmodifiable
    • removals

      public Set<String> removals()
      The entries to delete from the holder: what an earlier generation left in the package io.micronaut.aot.serviceindex.generated and entries() does not replace. A JVM can register one index only, so the earlier one has to go.

      They are also non-empty for ServiceIndexGenerator.Status.STOOD_DOWN or ServiceIndexGenerator.Status.FAILED when those remove an earlier index from the holder, which then includes the loader file if it names no other loader. Callers always apply them.

      Returns:
      the entry names, unmodifiable, sorted