Enum Class GshTemplateMode

java.lang.Object
java.lang.Enum<GshTemplateMode>
edu.internet2.middleware.grouper.app.gsh.template.GshTemplateMode
All Implemented Interfaces:
Serializable, Comparable<GshTemplateMode>, Constable

public enum GshTemplateMode extends Enum<GshTemplateMode>
Execution mode for a GSH template. The mode determines which engine handles the template's source body at runtime.
  • interpreted — the legacy path. The source body (Groovy or Java-syntax-compatible-with-Groovy) is parsed and executed by the Groovy engine on each invocation. Available for templateType values gsh, abac, and provisioner. Default for backward compat — existing config rows without an explicit templateMode behave exactly as they always have.
  • compiled — the new path. The source body is real Java, compiled to bytecode once (and re-compiled when the source hash changes), defined in a per-template ByteArrayClassLoader, and invoked as method calls on the loaded class. Available for every templateType. Required for the new types (daemon, daemonChangeLog, report, customUi, hook, library) since they have no legacy interpreted path.
GRP-7011
  • Enum Constant Details

    • interpreted

      public static final GshTemplateMode interpreted
      legacy Groovy-engine-interpreted source
    • compiled

      public static final GshTemplateMode compiled
      compiled-on-save Java source, loaded via the per-template classloader registry
  • Method Details

    • values

      public static GshTemplateMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static GshTemplateMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • valueOfIgnoreCase

      public static GshTemplateMode valueOfIgnoreCase(String string, boolean exceptionOnNotFound)
      Resolve an enum value by case-insensitive name, mirroring the convention used by GshTemplateType.
      Parameters:
      string - name of the enum value (case insensitive)
      exceptionOnNotFound - true to throw if the name doesn't match
      Returns:
      the matched enum value, or null if not found and exceptionOnNotFound is false