org.crsh.plugin
Class WebPluginLifeCycle

java.lang.Object
  extended by org.crsh.plugin.PluginLifeCycle
      extended by org.crsh.plugin.Embedded
          extended by org.crsh.plugin.WebPluginLifeCycle
All Implemented Interfaces:
EventListener, javax.servlet.ServletContextListener

public class WebPluginLifeCycle
extends Embedded
implements javax.servlet.ServletContextListener


Field Summary
 
Fields inherited from class org.crsh.plugin.PluginLifeCycle
log
 
Constructor Summary
WebPluginLifeCycle()
           
 
Method Summary
 void contextDestroyed(javax.servlet.ServletContextEvent sce)
           
 void contextInitialized(javax.servlet.ServletContextEvent sce)
           
protected  PluginDiscovery createDiscovery(javax.servlet.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()
           
 
Methods inherited from class org.crsh.plugin.Embedded
create, createCommandFS, createConfFS, createFS, start
 
Methods inherited from class org.crsh.plugin.PluginLifeCycle
getConfig, getContext, setConfig, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebPluginLifeCycle

public WebPluginLifeCycle()
Method Detail

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:

Overrides:
getMountFactories in class Embedded
Returns:
the drivers

createDiscovery

protected PluginDiscovery createDiscovery(javax.servlet.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(javax.servlet.ServletContextEvent sce)
Specified by:
contextInitialized in interface javax.servlet.ServletContextListener

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(javax.servlet.ServletContextEvent sce)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener


Copyright © 2015 eXo Platform SAS. All Rights Reserved.