org.crsh.plugin
Class WebPluginLifeCycle
java.lang.Object
org.crsh.plugin.PluginLifeCycle
org.crsh.plugin.Embedded
org.crsh.plugin.WebPluginLifeCycle
-
public class WebPluginLifeCycle
- extends Embedded
-
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lock
private static final Object lock
-
.
contextMap
private static final Map<String,PluginContext> contextMap
-
.
registered
private boolean registered
-
.
mountContexts
private Map<String,FSMountFactory<?>> mountContexts
-
.
context
private ServletContext context
-
.
WebPluginLifeCycle
public WebPluginLifeCycle()
getPluginContext
public static PluginContext getPluginContext(String contextPath)
throws NullPointerException
-
Returns a plugin context associated with the servlet context or null if such context does not exist.
-
- Parameters:
contextPath
- the context path
- Returns:
- the associated plugin context
- Throws:
NullPointerException
- if the servlet context argument is null
getMountFactories
protected Map<String,FSMountFactory<?>> getMountFactories()
-
This implementation register three file system drivers:
file
: the current file system
classpath
: the classpath
war
: the war content
-
- Overrides:
getMountFactories
in class Embedded
-
- Returns:
- the drivers
createDiscovery
protected PluginDiscovery createDiscovery(ServletContext context,
ClassLoader classLoader)
-
Create the service loader discovery, this can be subclassed to provide an implementation, the current implementation returns a
ServiceLoaderDiscovery
instance.
-
- Parameters:
context
- the servlet context
classLoader
- the class loader
- Returns:
- the plugin discovery
contextInitialized
public void contextInitialized(ServletContextEvent sce)
-
resolvePathProperty
private String resolvePathProperty(String propertyName,
String defaultValue)
-
The path property is resolved from the servlet context parameters. When the parameter does not exist, the
defaultValue
argument is used instead, so it should not be null. After the path is resolved, it is interpolated using the JVM system properties and the syntax defined by the Utils.interpolate(String, java.util.Map)
function.
-
- Parameters:
propertyName
- the property name to resolve
defaultValue
- the default property value
- Returns:
- the path value
resolveConfMountPointConfig
protected String resolveConfMountPointConfig()
-
- Overrides:
resolveConfMountPointConfig
in class Embedded
-
- Returns:
- the value returned by
resolvePathProperty(String, String)
with the crash.mountpointconfig.conf
name and the getDefaultConfMountPointConfig()
default value
resolveCmdMountPointConfig
protected String resolveCmdMountPointConfig()
-
- Overrides:
resolveCmdMountPointConfig
in class Embedded
-
- Returns:
- the value returned by
resolvePathProperty(String, String)
with the crash.mountpointconfig.cmd
name and the getDefaultCmdMountPointConfig()
default value
getDefaultCmdMountPointConfig
protected String getDefaultCmdMountPointConfig()
-
- Returns:
war:/WEB-INF/crash/commands/
getDefaultConfMountPointConfig
protected String getDefaultConfMountPointConfig()
-
- Returns:
war:/WEB-INF/crash/
contextDestroyed
public void contextDestroyed(ServletContextEvent sce)
-
Copyright © 2015 eXo Platform SAS. All Rights Reserved.