Enum Class LoadMode

java.lang.Object
java.lang.Enum<LoadMode>
ch.grengine.load.LoadMode
All Implemented Interfaces:
Serializable, Comparable<LoadMode>, Constable

public enum LoadMode extends Enum<LoadMode>
Mode for loading classes.

The traditional way to load classes in the Java VM is "parent first", while "current first" is a newer approach to load classes, which, for example, servlet containers or similar applications use in some cases. Both approaches have advantages and disadvantages.

The "parent first" approach is maybe often better in more static situations, while "current first" is maybe often better in more dynamic situations, like maybe also often with dynamically compiled Groovy scripts.

Since:
1.0
Author:
Alain Stalder, Made in Switzerland.
  • Enum Constant Details

    • PARENT_FIRST

      public static final LoadMode PARENT_FIRST
      tries to load from the parent class loader first, then (if not found) from the current class loader.
      Since:
      1.0
    • CURRENT_FIRST

      public static final LoadMode CURRENT_FIRST
      tries to load from the current class loader first, then (if not found) from the parent class loader.
      Since:
      1.0
  • Method Details

    • values

      public static LoadMode[] 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 LoadMode 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