Class WebApplication

java.lang.Object
org.wso2.carbon.webapp.mgt.WebApplication

public class WebApplication extends Object
Represents a Tomcat Web Application
  • Field Details

  • Constructor Details

  • Method Details

    • setServletContextParameters

      public void setServletContextParameters(List<WebContextParameter> parameters)
      Set ServletContext parameters for this webapp
      Parameters:
      parameters - ServletContext attributes for this webapp
    • getWebappFile

      public File getWebappFile()
    • setWebappFile

      public void setWebappFile(File webappFile)
    • getContextName

      public String getContextName()
    • getDisplayName

      public String getDisplayName()
    • setDisplayName

      public void setDisplayName(String name)
    • setLastModifiedTime

      public void setLastModifiedTime(long lastModifiedTime)
    • getLastModifiedTime

      public long getLastModifiedTime()
    • setState

      public void setState(String state)
    • getState

      public String getState()
    • getFaultReason

      public Exception getFaultReason()
    • setFaultReason

      public void setFaultReason(Exception faultReason)
    • setProperty

      public void setProperty(String key, Object value)
    • getProperty

      public Object getProperty(String key)
    • getDistributable

      public boolean getDistributable()
    • setDistributable

      public void setDistributable(boolean distributable)
    • getDocBase

      public String getDocBase()
    • setDocBase

      public void setDocBase(String docBase)
    • addParameter

      public void addParameter(String name, String value)
    • removeParameter

      public void removeParameter(String name)
    • findParameter

      public String findParameter(String contextParamName)
    • findParameters

      public String[] findParameters()
    • getTomcatGenericWebappsDeployer

      public TomcatGenericWebappsDeployer getTomcatGenericWebappsDeployer()
    • reload

      public boolean reload()
    • getBamEnableFromWebappMetaData

      protected String getBamEnableFromWebappMetaData() throws org.apache.axis2.AxisFault, org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException
      Reads from webappmeta files and return wether bam enabled.
      Returns:
      Throws:
      org.apache.axis2.AxisFault
      org.wso2.carbon.core.persistence.metadata.ArtifactMetadataException
    • updateWebappMetaDataforBam

      protected void updateWebappMetaDataforBam(String value)
    • stop

      public boolean stop() throws org.wso2.carbon.CarbonException
      Temporarilly 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.CarbonException
      Start 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.CarbonException
      Lazily unload this Web application.
      Throws:
      org.wso2.carbon.CarbonException - If an error occurs while lazy unloading
    • undeploy

      public void undeploy() throws org.wso2.carbon.CarbonException
      Completely 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.CarbonException
      Completely delete invalid input: '&' destroy this Web application
      Throws:
      org.wso2.carbon.CarbonException - If an error occurs while undeploying this webapp
    • getAppBase

      protected File 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 to maxLifetimeMillis
      Parameters:
      maxLifetimeMillis - The maximum session lifetime in milliseconds
    • expireSessions

      public void expireSessions(String[] sessionIDs) throws org.wso2.carbon.CarbonException
      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

      public List<WebApplication.HttpSession> 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 the sessionId
      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

      public WebApplication.Statistics getStatistics()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getServiceListPath

      public String getServiceListPath()
    • setServiceListPath

      public void setServiceListPath(String serviceListPath)
    • getVersion

      public String getVersion()
    • setVersion

      public void setVersion(String version)
    • getHostName

      public String getHostName()
    • setHostName

      public void setHostName(String hostName)
    • 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