org.kohsuke.stapler.framework
T
- The type of the root object instancepublic abstract class AbstractWebAppMain<T> extends java.lang.Object implements javax.servlet.ServletContextListener
Applications that use stapler can use this as the base class, and then register that as the servlet context listener.
Modifier and Type | Field and Description |
---|---|
protected javax.servlet.ServletContext |
context |
protected java.io.File |
home
Once the home directory is determined, this value is set to that directory.
|
protected java.lang.Class<T> |
rootType |
Modifier | Constructor and Description |
---|---|
protected |
AbstractWebAppMain(java.lang.Class<T> rootType) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkEnvironment()
Performs pre start-up environment check.
|
protected void |
cleanUp(T app)
Called during the destructino of the web app to perform
any clean up act on the application object.
|
void |
contextDestroyed(javax.servlet.ServletContextEvent event) |
void |
contextInitialized(javax.servlet.ServletContextEvent event) |
protected abstract java.lang.Object |
createApplication()
Creates the root application object.
|
protected java.lang.Object |
createPlaceHolderForAsyncLoad()
If the root application object is loaded asynchronously,
override this method to return the place holder object
to serve the request in the mean time.
|
protected abstract java.lang.String |
getApplicationName()
Returns the application name, like "Hudson" or "Torricelli".
|
protected java.io.File |
getDefaultHomeDir()
If no home directory is configured, this method is called
to determine the default location, which is "~/.appname".
|
protected java.io.File |
getHomeDir()
Determines the home directory for the application.
|
protected void |
setApplicationObject()
Sets the root application object.
|
protected final java.lang.Class<T> rootType
protected javax.servlet.ServletContext context
protected java.io.File home
protected AbstractWebAppMain(java.lang.Class<T> rootType)
protected abstract java.lang.String getApplicationName()
protected java.lang.Object createPlaceHolderForAsyncLoad()
protected abstract java.lang.Object createApplication() throws java.lang.Exception
java.lang.Exception
public void contextInitialized(javax.servlet.ServletContextEvent event)
contextInitialized
in interface javax.servlet.ServletContextListener
protected void setApplicationObject()
protected boolean checkEnvironment()
protected java.io.File getHomeDir()
String.trim()
.protected java.io.File getDefaultHomeDir()
public void contextDestroyed(javax.servlet.ServletContextEvent event)
contextDestroyed
in interface javax.servlet.ServletContextListener
protected void cleanUp(T app)
Copyright © 2014. All Rights Reserved.