Interface PerRealmRetainedIdentifier


public interface PerRealmRetainedIdentifier
Implementations of this interface are called by the maintenance service for every realm to retain.

Implementation must be annotated as @ApplicationScoped for CDI-usage.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Called to identify "live" references and objects for a realm.
    Human-readable name.
  • Method Details

    • name

      String name()
      Human-readable name.
    • identifyRetained

      boolean identifyRetained(@Nonnull RetainedCollector collector)
      Called to identify "live" references and objects for a realm.

      The given collector must be invoked for every reference and object to retain. The maintenance service is allowed to purge references and objects that were not passed to the collector's retain*() functions.

      Any exception thrown from this function aborts the whole maintenance run. Exceptions thrown from functionality called by the implementation must be properly handled.

      The purpose of the boolean return value is meant as a safety net in case to not accidentally purge a realm.

      Parameters:
      collector - consumer of "live" references and objects
      Returns:
      true if this function was able to handle the realm, false if the implementation did not process the realm or wants to defer the decision to another implementation.