Package org.gatein.wci.spi
Class CatalinaWebAppContext
- java.lang.Object
-
- org.gatein.wci.spi.CatalinaWebAppContext
-
- All Implemented Interfaces:
WebAppContext
public abstract class CatalinaWebAppContext extends Object implements WebAppContext
- Author:
- Ken Finnigan
-
-
Field Summary
Fields Modifier and Type Field Description protected ClassLoaderclassLoader.protected StringcontextPath.protected static intGATEIN_SERVLET_LOAD_ON_STARTUPprotected static StringGATEIN_SERVLET_NAMEprotected static StringGATEIN_SERVLET_PATHprotected static org.gatein.common.logging.Loggerlogprotected javax.servlet.ServletContextservletContext.
-
Constructor Summary
Constructors Constructor Description CatalinaWebAppContext(javax.servlet.ServletContext servletContext, ClassLoader classLoader, String contextPath)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidcleanup()voidfireRequestDestroyed(javax.servlet.ServletRequest servletRequest)voidfireRequestInitialized(javax.servlet.ServletRequest servletRequest)ClassLoadergetClassLoader()Returns the class loader of the web application.protected StringgetCommandServletClassName()StringgetContextPath()Returns the context path of the web application.javax.servlet.ServletContextgetServletContext()Returns the servlet context of the web application.booleanimportFile(String parentDirRelativePath, String name, InputStream source, boolean overwrite)Import a file in the war file.protected abstract voidperformStartup()voidstart()Start the web application context usage from a client point of view.voidstop()Stop the web application context usage.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.gatein.wci.spi.WebAppContext
getHttpSession
-
-
-
-
Field Detail
-
log
protected static final org.gatein.common.logging.Logger log
-
GATEIN_SERVLET_NAME
protected static final String GATEIN_SERVLET_NAME
- See Also:
- Constant Field Values
-
GATEIN_SERVLET_PATH
protected static final String GATEIN_SERVLET_PATH
- See Also:
- Constant Field Values
-
GATEIN_SERVLET_LOAD_ON_STARTUP
protected static final int GATEIN_SERVLET_LOAD_ON_STARTUP
- See Also:
- Constant Field Values
-
servletContext
protected javax.servlet.ServletContext servletContext
.
-
classLoader
protected ClassLoader classLoader
.
-
contextPath
protected String contextPath
.
-
-
Constructor Detail
-
CatalinaWebAppContext
public CatalinaWebAppContext(javax.servlet.ServletContext servletContext, ClassLoader classLoader, String contextPath)
-
-
Method Detail
-
start
public void start() throws ExceptionDescription copied from interface:WebAppContextStart the web application context usage from a client point of view. The life cycle is not related to the web application deployment life cycle. The invocation means that the servlet container spi framework want to start to use the web application.- Specified by:
startin interfaceWebAppContext- Throws:
Exception- any exception that would veto the usage of the web application
-
stop
public void stop()
Description copied from interface:WebAppContextStop the web application context usage.- Specified by:
stopin interfaceWebAppContext
-
getServletContext
public javax.servlet.ServletContext getServletContext()
Description copied from interface:WebAppContextReturns the servlet context of the web application.- Specified by:
getServletContextin interfaceWebAppContext- Returns:
- the servlet context
-
getClassLoader
public ClassLoader getClassLoader()
Description copied from interface:WebAppContextReturns the class loader of the web application.- Specified by:
getClassLoaderin interfaceWebAppContext- Returns:
- the web application class loader
-
getContextPath
public String getContextPath()
Description copied from interface:WebAppContextReturns the context path of the web application.- Specified by:
getContextPathin interfaceWebAppContext- Returns:
- the web application context path
-
importFile
public boolean importFile(String parentDirRelativePath, String name, InputStream source, boolean overwrite) throws IOException
Description copied from interface:WebAppContextImport a file in the war file. The file could not be created for some reasons which are :- The parent dir exists and is a file
- The parent dir does not exist and its creation failed
- An underlying exception occurs when writing bytes from the source
Inputstreamto the targetOutputStream
- Specified by:
importFilein interfaceWebAppContext- Parameters:
parentDirRelativePath- the parent relative path in the web app starting from the app rootname- the name the created file should havesource- the data of the target fileoverwrite- if false and the file already exists nothing is done- Returns:
- true if the file has been created
- Throws:
IOException- if the file cannot be created
-
getCommandServletClassName
protected String getCommandServletClassName()
-
fireRequestDestroyed
public void fireRequestDestroyed(javax.servlet.ServletRequest servletRequest)
- Specified by:
fireRequestDestroyedin interfaceWebAppContext
-
fireRequestInitialized
public void fireRequestInitialized(javax.servlet.ServletRequest servletRequest)
- Specified by:
fireRequestInitializedin interfaceWebAppContext
-
cleanup
protected abstract void cleanup()
-
-