Class RuntimeConfig

java.lang.Object
org.ametys.runtime.servlet.RuntimeConfig

public final class RuntimeConfig extends Object
Java representation of the WEB-INF/param/runtime.xml file.
Contains all runtime configuration values.
  • Method Details

    • getInstance

      public static RuntimeConfig getInstance()
      Returns the shared instance of the RuntimeConfig
      Returns:
      the shared instance of the RuntimeConfig
    • isConfigured

      public static boolean isConfigured()
      Returns true if the Runtime has been configured (ie. if the configure(Configuration, Configuration, File, String) method has been called.
      Returns:
      true if the Runtime has been configured.
    • configure

      public static void configure(Configuration runtimeConf, Configuration externalConf, File ametysHome, String contextPath)
      Configures the Runtime kernel.
      This method must be called before getting the RuntimConfig instance.

      Warning : the implementation allows this method to be called twice or more. This is only to allow the Runtime to be re-started dynamically.
      Be aware that this can cause the application to become unstable.
      Parameters:
      runtimeConf - the Configuration of the Runtime kernel (ie the contents of the WEB-INF/param/runtime.xml file)
      externalConf - the Configuration of external locations (ie the contents of the WEB-INF/param/external-locations.xml file)
      ametysHome - The ametys home directory
      contextPath - the application context path
    • isInvalid

      public boolean isInvalid()
      Returns true if safe mode is needed (ie. if there's been an error reading runtime.xml).
      Returns:
      true if safe mode is needed.
    • getDefaultWorkspace

      Returns the name of the default workspace. Null if none.
      Returns:
      the name of the default workspace
    • getInitClassName

      Returns the name of the class to be excuted at the end of the initialization process, if any.
      May be null.
      Returns:
      Returns the name of the class to be excuted at the end of the initialization process, if any
    • getPluginsLocations

      Returns a Collection containing the locations of the plugins
      Returns:
      a Collection containing the locations of the plugins
    • getExternalPlugins

      Returns the declared external plugins (ie. not located in the webapp context).
      Returns:
      the declared external plugins
    • getExternalWorkspaces

      Returns the declared external workspaces (ie. not located in the webapp context).
      Returns:
      the declared external workspaces
    • getExternalKernel

      Returns the absolute external location of the kernel, if any.
      Returns null if the kernel is not externalized.
      Returns:
      the absolute external location of the kernel, if any.
    • getExcludedPlugins

      Returns a Collection containing the names of the excluded (deactivated) plugins
      Returns:
      a Collection containing the names of the excluded (deactivated) plugins
    • getExcludedFeatures

      Returns a Collection containing the names of the excluded (deactivated) features
      Returns:
      a Collection containing the names of the excluded (deactivated) features
    • getExcludedWorkspaces

      Returns a Collection containing the names of the excluded (deactivated) workspaces
      Returns:
      a Collection containing the names of the excluded (deactivated) workspaces
    • getOverridenThemes

      Return a Map association a workspace name and its associated theme
      Returns:
      a Map association a workspace name and its associated theme
    • getComponents

      Returns a Map<role, component id> containing the choosen implementation for the given component role
      Returns:
      a Map<role, component id> containing the choosen implementation for the given component role
    • getApplicationVersion

      Returns the application version name
      Returns:
      the application version name
    • getApplicationBuildDate

      Returns the application build date, if provided. May be null.
      Returns:
      the application build date.
    • getAmetysHome

      public File getAmetysHome()
      Returns the Ametys home directory. Cannot be null.
      Returns:
      The Ametys home directory.