|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.crsh.plugin.PluginLifeCycle org.crsh.plugin.Embedded org.crsh.plugin.WebPluginLifeCycle
public class WebPluginLifeCycle
Field Summary | |
---|---|
private ServletContext |
context
. |
private static Map<String,PluginContext> |
contextMap
. |
private static Object |
lock
. |
private Map<String,FSMountFactory<?>> |
mountContexts
. |
private boolean |
registered
. |
Fields inherited from class org.crsh.plugin.PluginLifeCycle |
---|
log |
Constructor Summary | |
---|---|
WebPluginLifeCycle()
|
Method Summary | |
---|---|
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. |
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 |
Field Detail |
---|
private static final Object lock
private static final Map<String,PluginContext> contextMap
private boolean registered
private Map<String,FSMountFactory<?>> mountContexts
private ServletContext context
Constructor Detail |
---|
public WebPluginLifeCycle()
Method Detail |
---|
public static PluginContext getPluginContext(String contextPath) throws NullPointerException
contextPath
- the context path
NullPointerException
- if the servlet context argument is nullprotected Map<String,FSMountFactory<?>> getMountFactories()
file
: the current file systemclasspath
: the classpathwar
: the war content
getMountFactories
in class Embedded
protected PluginDiscovery createDiscovery(ServletContext context, ClassLoader classLoader)
ServiceLoaderDiscovery
instance.
context
- the servlet contextclassLoader
- the class loader
public 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 value
protected String resolveConfMountPointConfig()
resolveConfMountPointConfig
in class Embedded
resolvePathProperty(String, String)
with the crash.mountpointconfig.conf
name
and the getDefaultConfMountPointConfig()
default valueprotected String resolveCmdMountPointConfig()
resolveCmdMountPointConfig
in class Embedded
resolvePathProperty(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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |