Class RuntimeConfig


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

      • getInstance

        public static RuntimeConfig getInstance()
        Returns the shared instance of the RuntimeConfig
        Returns:
        the shared instance of the RuntimeConfig
      • 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
      • isSafeMode

        public boolean isSafeMode()
        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

        public String getDefaultWorkspace()
        Returns the name of the default workspace. Null if none.
        Returns:
        the name of the default workspace
      • getInitClassName

        public String 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

        public Collection<StringgetPluginsLocations()
        Returns a Collection containing the locations of the plugins
        Returns:
        a Collection containing the locations of the plugins
      • getExternalPlugins

        public Map<String,​FilegetExternalPlugins()
        Returns the declared external plugins (ie. not located in the webapp context).
        Returns:
        the declared external plugins
      • getExternalWorkspaces

        public Map<String,​FilegetExternalWorkspaces()
        Returns the declared external workspaces (ie. not located in the webapp context).
        Returns:
        the declared external workspaces
      • getExternalKernel

        public File 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

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

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

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

        public Map<String,​StringgetOverridenThemes()
        Return a Map association a workspace name and its associated theme
        Returns:
        a Map association a workspace name and its associated theme
      • getComponents

        public Map<String,​StringgetComponents()
        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

        public String getApplicationVersion()
        Returns the application version name
        Returns:
        the application version name
      • getApplicationBuildDate

        public Date 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.