Class AppContext

java.lang.Object
org.javalite.activeweb.AppContext

public class AppContext extends Object
Instance of this class can hold application-specific objects for duration of application life span.
Author:
Igor Polevoy
  • Constructor Details

    • AppContext

      public AppContext()
  • Method Details

    • get

      public Object get(String name)
      Retrieves object by name
      Parameters:
      name - name of object
      Returns:
      object by name;
    • get

      public static <T> T get(String name, Class<T> type)
      Retrieves object by name. Convenience generic method.
      Parameters:
      name - name of object
      type - type requested.
      Returns:
      object by name
    • set

      public static void set(String name, Object object)
      Sets an application - wide object by name.
      Parameters:
      name - name of object
      object - - instance.