Package org.wso2.carbon.webapp.mgt
Class WebApplication
java.lang.Object
org.wso2.carbon.webapp.mgt.WebApplication
Represents a Tomcat Web Application
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents an HTTP sessionfinal classRepresents statistics corresponding to this webapp -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWebApplication(TomcatGenericWebappsDeployer tomcatGenericWebappsDeployer, org.apache.catalina.Context context, File webappFile) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(String name, String value) voiddelete()Completely delete invalid input: '&' destroy this Web applicationvoidExpire all sessions of this webappvoidexpireSessions(long maxLifetimeMillis) Expire sessions whose lifetime is greater than or equal tomaxLifetimeMillisvoidexpireSessions(String[] sessionIDs) Expire all specified sessionsfindParameter(String contextParamName) String[]protected FileReturn a File object representing the "application root" directory for our associated Host.protected StringReads from webappmeta files and return wether bam enabled.org.apache.catalina.ContextThis method will return the Catalina Context for a particular webappbooleanlonggetProperty(String key) getSession(String sessionId) Get the session corresponding to thesessionIdGet all the current sessions for this webappgetState()voidLazily unload this Web application.booleanreload()voidremoveParameter(String name) voidsetDisplayName(String name) voidsetDistributable(boolean distributable) voidsetDocBase(String docBase) voidsetFaultReason(Exception faultReason) voidsetHostName(String hostName) voidsetIsGhostWebapp(boolean isThisGhost) We need this method in ghost mode because, this will set a static variable which indicates whether this Webapp is a ghost.voidsetLastModifiedTime(long lastModifiedTime) voidsetProperty(String key, Object value) voidsetServiceListPath(String serviceListPath) voidsetServletContextParameters(List<WebContextParameter> parameters) Set ServletContext parameters for this webappvoidvoidsetVersion(String version) voidsetWebappFile(File webappFile) booleanstart()Start a webapp which was stoppedbooleanstop()Temporarilly stop this Web application.toString()voidundeploy()Completely delete invalid input: '&' destroy this Web application.protected voidupdateWebappMetaDataforBam(String value)
-
Field Details
-
ENABLE_SAAS
Key for the enable SAAS context parameter- See Also:
-
-
Constructor Details
-
WebApplication
public WebApplication(TomcatGenericWebappsDeployer tomcatGenericWebappsDeployer, org.apache.catalina.Context context, File webappFile)
-
-
Method Details
-
setServletContextParameters
Set ServletContext parameters for this webapp- Parameters:
parameters- ServletContext attributes for this webapp
-
getWebappFile
-
setWebappFile
-
getContextName
-
getDisplayName
-
setDisplayName
-
setLastModifiedTime
public void setLastModifiedTime(long lastModifiedTime) -
getLastModifiedTime
public long getLastModifiedTime() -
setState
-
getState
-
getFaultReason
-
setFaultReason
-
setProperty
-
getProperty
-
getDistributable
public boolean getDistributable() -
setDistributable
public void setDistributable(boolean distributable) -
getDocBase
-
setDocBase
-
addParameter
-
removeParameter
-
findParameter
-
findParameters
-
getTomcatGenericWebappsDeployer
-
reload
public boolean reload() -
getBamEnableFromWebappMetaData
protected String getBamEnableFromWebappMetaData() throws org.apache.axis2.AxisFault, org.wso2.carbon.core.persistence.metadata.ArtifactMetadataExceptionReads from webappmeta files and return wether bam enabled.- Returns:
- Throws:
org.apache.axis2.AxisFaultorg.wso2.carbon.core.persistence.metadata.ArtifactMetadataException
-
updateWebappMetaDataforBam
-
stop
public boolean stop() throws org.wso2.carbon.CarbonExceptionTemporarilly stop this Web application. When a request is made to a stopped webapp resource, an HTTP 503 (Temporarilly Unavailable) will be returned.- Returns:
- true - If hte webapp was successfully stopped
- Throws:
org.wso2.carbon.CarbonException- If an error occurs while stopping this webapp
-
start
public boolean start() throws org.wso2.carbon.CarbonExceptionStart a webapp which was stopped- Returns:
- true - if the webapp was successfully started
- Throws:
org.wso2.carbon.CarbonException- If an error occurs while starting this webapp
-
lazyUnload
public void lazyUnload() throws org.wso2.carbon.CarbonExceptionLazily unload this Web application.- Throws:
org.wso2.carbon.CarbonException- If an error occurs while lazy unloading
-
undeploy
public void undeploy() throws org.wso2.carbon.CarbonExceptionCompletely delete invalid input: '&' destroy this Web application. When a request is made to an undeployed webapp resource, an HTTP 404 (Not Found) will be returned.- Throws:
org.wso2.carbon.CarbonException- If an error occurs while undeploying this webapp
-
delete
public void delete() throws org.wso2.carbon.CarbonExceptionCompletely delete invalid input: '&' destroy this Web application- Throws:
org.wso2.carbon.CarbonException- If an error occurs while undeploying this webapp
-
getAppBase
Return a File object representing the "application root" directory for our associated Host.- Returns:
- The AppBase //TODO - when webapp exploding is supported for stratos, this should return the tenant's webapp dir
-
expireAllSessions
public void expireAllSessions()Expire all sessions of this webapp -
expireSessions
public void expireSessions(long maxLifetimeMillis) Expire sessions whose lifetime is greater than or equal tomaxLifetimeMillis- Parameters:
maxLifetimeMillis- The maximum session lifetime in milliseconds
-
expireSessions
Expire all specified sessions- Parameters:
sessionIDs- The IDs of the sessions to be expired- Throws:
org.wso2.carbon.CarbonException- If an error occurs while getting the session
-
getSessions
Get all the current sessions for this webapp- Returns:
- the current sessions for this webapp
-
getSession
public WebApplication.HttpSession getSession(String sessionId) throws org.wso2.carbon.CarbonException Get the session corresponding to thesessionId- Parameters:
sessionId- The session ID- Returns:
- the session corresponding to the
sessionId - Throws:
org.wso2.carbon.CarbonException- If an error occurs while retrieving the session
-
getStatistics
-
toString
-
getServiceListPath
-
setServiceListPath
-
getVersion
-
setVersion
-
getHostName
-
setHostName
-
getContext
public org.apache.catalina.Context getContext()This method will return the Catalina Context for a particular webapp- Returns:
- Context
-
setIsGhostWebapp
public void setIsGhostWebapp(boolean isThisGhost) We need this method in ghost mode because, this will set a static variable which indicates whether this Webapp is a ghost. We need a static variable to use it in the Statistics inner class, which is a static class.- Parameters:
isThisGhost- boolean parameter to set the static variable
-