Package org.ametys.runtime.servlet
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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.File
getAmetysHome()
Returns the Ametys home directory.Date
getApplicationBuildDate()
Returns the application build date, if provided.String
getApplicationVersion()
Returns the application version nameMap<String,String>
getComponents()
Returns a Map<role, component id> containing the choosen implementation for the given component roleString
getDefaultWorkspace()
Returns the name of the default workspace.Collection<String>
getExcludedFeatures()
Returns a Collection containing the names of the excluded (deactivated) featuresCollection<String>
getExcludedPlugins()
Returns a Collection containing the names of the excluded (deactivated) pluginsCollection<String>
getExcludedWorkspaces()
Returns a Collection containing the names of the excluded (deactivated) workspacesFile
getExternalKernel()
Returns the absolute external location of the kernel, if any.
Returns null if the kernel is not externalized.Map<String,File>
getExternalPlugins()
Returns the declared external plugins (ie.Map<String,File>
getExternalWorkspaces()
Returns the declared external workspaces (ie.String
getInitClassName()
Returns the name of the class to be excuted at the end of the initialization process, if any.
May be null.static RuntimeConfig
getInstance()
Returns the shared instance of theRuntimeConfig
Map<String,String>
getOverridenThemes()
Return a Map association a workspace name and its associated themeCollection<String>
getPluginsLocations()
Returns a Collection containing the locations of the pluginsstatic boolean
isConfigured()
Returns true if the Runtime has been configured (ie.boolean
isSafeMode()
Returns true if safe mode is needed (ie.
-
-
-
Method Detail
-
getInstance
public static RuntimeConfig getInstance()
Returns the shared instance of theRuntimeConfig
- Returns:
- the shared instance of the
RuntimeConfig
-
isConfigured
public static boolean isConfigured()
Returns true if the Runtime has been configured (ie. if theconfigure(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 directorycontextPath
- 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<String> getPluginsLocations()
Returns a Collection containing the locations of the plugins- Returns:
- a Collection containing the locations of the plugins
-
getExternalPlugins
public Map<String,File> getExternalPlugins()
Returns the declared external plugins (ie. not located in the webapp context).- Returns:
- the declared external plugins
-
getExternalWorkspaces
public Map<String,File> getExternalWorkspaces()
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<String> getExcludedPlugins()
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<String> getExcludedFeatures()
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<String> getExcludedWorkspaces()
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,String> getOverridenThemes()
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,String> 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
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.
-
-