org.crsh.plugin
Class WebPluginLifeCycle

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

public class WebPluginLifeCycle
extends PluginLifeCycle
implements javax.servlet.ServletContextListener


Field Summary
private static Map<String,PluginContext> contextMap
          .
private static Object lock
          .
private  boolean registered
          .
 
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  FS createCommandFS(javax.servlet.ServletContext context)
          Create the command file system, this method binds the /WEB-INF/crash/commands/ path of the servlet context.
protected  FS createConfFS(javax.servlet.ServletContext context)
          Create the conf file system, this method binds the /WEB-INF/crash/ path of the servlet context.
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.
static PluginContext getPluginContext(javax.servlet.ServletContext sc)
          Returns a plugin context associated with the servlet context or null if such context does not exist.
 
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
 

Field Detail

lock

private static final Object lock
.


contextMap

private static final Map<String,PluginContext> contextMap
.


registered

private boolean registered
.

Constructor Detail

WebPluginLifeCycle

public WebPluginLifeCycle()
Method Detail

getPluginContext

public static PluginContext getPluginContext(javax.servlet.ServletContext sc)
                                      throws NullPointerException
Returns a plugin context associated with the servlet context or null if such context does not exist.

Parameters:
sc - the servlet context
Returns:
the associated plugin context
Throws:
NullPointerException - if the servlet context argument is null

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

createCommandFS

protected FS createCommandFS(javax.servlet.ServletContext context)
Create the command file system, this method binds the /WEB-INF/crash/commands/ path of the servlet context.

Parameters:
context - the servlet context
Returns:
the command file system

createConfFS

protected FS createConfFS(javax.servlet.ServletContext context)
Create the conf file system, this method binds the /WEB-INF/crash/ path of the servlet context.

Parameters:
context - the servlet context
Returns:
the conf file system

contextDestroyed

public void contextDestroyed(javax.servlet.ServletContextEvent sce)
Specified by:
contextDestroyed in interface javax.servlet.ServletContextListener


Copyright © 2014 eXo Platform SAS. All Rights Reserved.