public class WebPluginLifeCycle extends Embedded
| Modifier and Type | Field and Description |
|---|---|
private ServletContext |
context
.
|
private static Map<String,PluginContext> |
contextMap
.
|
private static Object |
lock
.
|
private Map<String,FSMountFactory<?>> |
mountContexts
.
|
private boolean |
registered
.
|
log| Constructor and Description |
|---|
WebPluginLifeCycle() |
| Modifier and Type | Method and Description |
|---|---|
void |
contextDestroyed(ServletContextEvent sce) |
void |
contextInitialized(ServletContextEvent sce) |
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. |
protected String |
getDefaultCmdMountPointConfig() |
protected String |
getDefaultConfMountPointConfig() |
protected Map<String,FSMountFactory<?>> |
getMountFactories()
This implementation register three file system drivers:
file : the current file system
classpath : the classpath
war : the war content
|
static PluginContext |
getPluginContext(String contextPath)
Returns a plugin context associated with the servlet context or null if such context does not exist.
|
protected String |
resolveCmdMountPointConfig() |
protected String |
resolveConfMountPointConfig() |
private String |
resolvePathProperty(String propertyName,
String defaultValue)
The path property is resolved from the servlet context parameters.
|
create, createCommandFS, createConfFS, createFS, startgetConfig, getContext, setConfig, start, stopprivate static final Map<String,PluginContext> contextMap
private boolean registered
private Map<String,FSMountFactory<?>> mountContexts
private ServletContext context
public WebPluginLifeCycle()
public static PluginContext getPluginContext(String contextPath) throws NullPointerException
contextPath - the context pathNullPointerException - if the servlet context argument is nullprotected Map<String,FSMountFactory<?>> getMountFactories()
file : the current file systemclasspath : the classpathwar : the war contentgetMountFactories in class Embeddedprotected PluginDiscovery createDiscovery(ServletContext context, ClassLoader classLoader)
ServiceLoaderDiscovery instance.context - the servlet contextclassLoader - the class loaderpublic void contextInitialized(ServletContextEvent sce)
private String resolvePathProperty(String propertyName, String defaultValue)
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.propertyName - the property name to resolvedefaultValue - the default property valueprotected String resolveConfMountPointConfig()
resolveConfMountPointConfig in class EmbeddedresolvePathProperty(String, String) with the crash.mountpointconfig.conf name
and the getDefaultConfMountPointConfig() default valueprotected String resolveCmdMountPointConfig()
resolveCmdMountPointConfig in class EmbeddedresolvePathProperty(String, String) with the crash.mountpointconfig.cmd name
and the getDefaultCmdMountPointConfig() default valueprotected String getDefaultCmdMountPointConfig()
war:/WEB-INF/crash/commands/protected String getDefaultConfMountPointConfig()
war:/WEB-INF/crash/public void contextDestroyed(ServletContextEvent sce)
Copyright © 2015 eXo Platform SAS. All Rights Reserved.