com.caucho.server.webapp
Class WebAppController

java.lang.Object
  extended by com.caucho.server.deploy.DeployController<I>
      extended by com.caucho.server.deploy.ExpandDeployController<I>
          extended by com.caucho.server.deploy.EnvironmentDeployController<WebApp,WebAppConfig>
              extended by com.caucho.server.webapp.WebAppController
All Implemented Interfaces:
EnvironmentListener, AlarmListener, Dependency, java.util.EventListener
Direct Known Subclasses:
WebAppVersioningController

public class WebAppController
extends EnvironmentDeployController<WebApp,WebAppConfig>

A configuration entry for a web-app.


Nested Class Summary
 class WebAppController.Var
          EL variables for the app.
 
Field Summary
protected  WebAppContainer _container
           
 
Fields inherited from class com.caucho.server.deploy.DeployController
_lifecycle, REDEPLOY_AUTOMATIC, REDEPLOY_CHECK_INTERVAL, REDEPLOY_DEFAULT, REDEPLOY_LAZY, REDEPLOY_MANUAL, STARTUP_AUTOMATIC, STARTUP_DEFAULT, STARTUP_LAZY, STARTUP_MANUAL
 
Constructor Summary
WebAppController()
           
WebAppController(java.lang.String name, java.lang.String contextPath, Path rootDirectory, WebAppContainer container)
           
 
Method Summary
 void addDepend(Path path)
          Adds a dependent file.
protected  void addDependencies()
          Adding any dependencies.
protected  Path calculateRootDirectory()
           
protected  void configureInstanceVariables(WebApp app)
          Creates the webApp.
 boolean destroy()
          Returns the webApp object.
protected  void extendJMXContext(java.util.Map<java.lang.String,java.lang.String> context)
           
protected  void fillInitList(java.util.ArrayList<DeployConfig> initList)
           
 WebAppAdmin getAdmin()
          Returns the admin.
 WebAppContainer getContainer()
          Returns the web-app container.
 java.lang.String getContextPath()
          Returns the webApp's context path
 java.lang.String getContextPath(java.lang.String uri)
          Returns the webApp's context path
protected  DeployControllerAdmin getDeployAdmin()
          Returns the deploy admin.
 Host getHost()
          Returns the containing host.
 long getLifetimeClientDisconnectCount()
           
 long getLifetimeConnectionCount()
           
 long getLifetimeConnectionTime()
           
 long getLifetimeReadBytes()
           
 long getLifetimeWriteBytes()
           
protected  java.util.logging.Logger getLog()
          Returns the appropriate log for debugging.
protected  java.lang.String getMBeanId()
           
protected  java.lang.String getMBeanTypeName()
           
 WebAppController getParent()
          Returns the parent controller.
 java.lang.String getSourceType()
          Returns the source (for backwards compatibility)
 java.lang.String getURL()
          Gets the URL
 WebAppController.Var getVar()
          Returns the var.
 java.lang.String getVersion()
          Gets the version id.
 java.lang.String getWarName()
          Gets the war name prefix.
 WebApp getWebApp()
          Returns the webApp object.
protected  void initBegin()
          Initialize the controller.
protected  void initEnd()
          Initialize the controller.
protected  WebApp instantiateDeployInstance()
          Instantiate the webApp.
 boolean isDynamicDeploy()
          Returns true for a dynamically deployed webApp.
 boolean isInheritSession()
          True for inherit-session webApps.
 boolean isNameMatch(java.lang.String url)
          Returns true if the controller matches.
protected  WebAppController merge(WebAppController newController)
          Merges two entries.
protected  void protectedWebApp()
          Any extra steps needed to deploy the webApp.
protected  void removeExpandFile(Path path, java.lang.String relPath)
          Override to prevent removing of special files.
 void setContextPath(java.lang.String contextPath)
          Sets the webApp's context path
 void setDynamicDeploy(boolean isDynamicDeploy)
          Set true for a dynamically deployed webApp.
 void setInheritSession(boolean inheritSession)
          True for inherit-session
 void setOldWebApp(WebAppController oldWebApp, long expireTime)
          Sets the old version web-app.
 void setParentWebApp(WebAppController parent)
          Sets the parent controller.
 void setRegexpValues(java.util.ArrayList<java.lang.String> values)
          Sets the regexp values.
 void setSourceType(java.lang.String type)
          Sets the source (for backwards compatibility)
protected  void setVersion(java.lang.String version)
          Sets the version id.
 void setWarName(java.lang.String warName)
          Sets the war name prefix.
 java.lang.String toString()
          Returns a printable view.
 void updateStatistics(long milliseconds, int readBytes, int writeBytes, boolean isClientDisconnect)
          Update statistics with the results of one request.
 
Methods inherited from class com.caucho.server.deploy.EnvironmentDeployController
addConfigDefault, configureInstance, environmentBind, environmentConfigure, environmentStart, environmentStop, getArchivePath, getConfig, getConfigException, getMBean, getObjectName, getPrologue, getVariableMap, mergeController, setConfig, setConfigException, setPrologue
 
Methods inherited from class com.caucho.server.deploy.ExpandDeployController
addManifestClassPath, equals, expandArchive, getGit, getGitRefPath, getManifest, getManifestAttributes, getRootDirectory, hashCode, removeExpandDirectory, removeExpandDirectory, setArchivePath, setExpandCleanupFileSet, setGit, setGitRefPath, setManifestClassLoader, setRootDirectory
 
Methods inherited from class com.caucho.server.deploy.DeployController
addLifecycleListener, getDeployInstance, getId, getParentClassLoader, getRedeployCheckInterval, getRedeployMode, getStartTime, getStartupMode, getStartupPriority, getState, handleAlarm, init, isActive, isActiveIdle, isDestroyed, isError, isErrorNow, isModified, isModifiedNow, isStopped, isStoppedLazy, logModified, mergeRedeployCheckInterval, mergeRedeployMode, mergeStartupMode, request, restart, setRedeployCheckInterval, setRedeployMode, setStartupMode, setStartupPriority, start, startImpl, startOnInit, stop, subrequest, toRedeployCode, toStartupCode, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_container

protected WebAppContainer _container
Constructor Detail

WebAppController

public WebAppController()

WebAppController

public WebAppController(java.lang.String name,
                        java.lang.String contextPath,
                        Path rootDirectory,
                        WebAppContainer container)
Method Detail

getContextPath

public java.lang.String getContextPath()
Returns the webApp's context path


setContextPath

public void setContextPath(java.lang.String contextPath)
Sets the webApp's context path


getContextPath

public java.lang.String getContextPath(java.lang.String uri)
Returns the webApp's context path


setWarName

public void setWarName(java.lang.String warName)
Sets the war name prefix.


getWarName

public java.lang.String getWarName()
Gets the war name prefix.


getURL

public java.lang.String getURL()
Gets the URL


getParent

public WebAppController getParent()
Returns the parent controller.


getContainer

public WebAppContainer getContainer()
Returns the web-app container.


setParentWebApp

public void setParentWebApp(WebAppController parent)
Sets the parent controller.


getHost

public Host getHost()
Returns the containing host.


getSourceType

public java.lang.String getSourceType()
Returns the source (for backwards compatibility)


setSourceType

public void setSourceType(java.lang.String type)
Sets the source (for backwards compatibility)


setRegexpValues

public void setRegexpValues(java.util.ArrayList<java.lang.String> values)
Sets the regexp values.


isInheritSession

public boolean isInheritSession()
True for inherit-session webApps.


setInheritSession

public void setInheritSession(boolean inheritSession)
True for inherit-session


getWebApp

public WebApp getWebApp()
Returns the webApp object.


setDynamicDeploy

public void setDynamicDeploy(boolean isDynamicDeploy)
Set true for a dynamically deployed webApp.


isDynamicDeploy

public boolean isDynamicDeploy()
Returns true for a dynamically deployed webApp.


getMBeanTypeName

protected java.lang.String getMBeanTypeName()
Overrides:
getMBeanTypeName in class DeployController<WebApp>

getMBeanId

protected java.lang.String getMBeanId()
Overrides:
getMBeanId in class DeployController<WebApp>

setVersion

protected void setVersion(java.lang.String version)
Sets the version id.


getVersion

public java.lang.String getVersion()
Gets the version id.


setOldWebApp

public void setOldWebApp(WebAppController oldWebApp,
                         long expireTime)
Sets the old version web-app.


getDeployAdmin

protected DeployControllerAdmin getDeployAdmin()
Returns the deploy admin.

Overrides:
getDeployAdmin in class DeployController<WebApp>

initEnd

protected void initEnd()
Description copied from class: EnvironmentDeployController
Initialize the controller.

Overrides:
initEnd in class EnvironmentDeployController<WebApp,WebAppConfig>

getAdmin

public WebAppAdmin getAdmin()
Returns the admin.


isNameMatch

public boolean isNameMatch(java.lang.String url)
Returns true if the controller matches.

Overrides:
isNameMatch in class EnvironmentDeployController<WebApp,WebAppConfig>

merge

protected WebAppController merge(WebAppController newController)
Merges two entries.


getVar

public WebAppController.Var getVar()
Returns the var.


destroy

public boolean destroy()
Returns the webApp object.

Overrides:
destroy in class EnvironmentDeployController<WebApp,WebAppConfig>

protectedWebApp

protected void protectedWebApp()
                        throws java.lang.Exception
Any extra steps needed to deploy the webApp.

Throws:
java.lang.Exception

addDependencies

protected void addDependencies()
                        throws java.lang.Exception
Adding any dependencies.

Throws:
java.lang.Exception

addDepend

public void addDepend(Path path)
Adds a dependent file.


initBegin

protected void initBegin()
Initialize the controller.

Overrides:
initBegin in class DeployController<WebApp>

fillInitList

protected void fillInitList(java.util.ArrayList<DeployConfig> initList)
Overrides:
fillInitList in class EnvironmentDeployController<WebApp,WebAppConfig>

instantiateDeployInstance

protected WebApp instantiateDeployInstance()
Instantiate the webApp.

Specified by:
instantiateDeployInstance in class DeployController<WebApp>

configureInstanceVariables

protected void configureInstanceVariables(WebApp app)
                                   throws java.lang.Throwable
Creates the webApp.

Overrides:
configureInstanceVariables in class EnvironmentDeployController<WebApp,WebAppConfig>
Throws:
java.lang.Throwable

extendJMXContext

protected void extendJMXContext(java.util.Map<java.lang.String,java.lang.String> context)
Overrides:
extendJMXContext in class EnvironmentDeployController<WebApp,WebAppConfig>

calculateRootDirectory

protected Path calculateRootDirectory()
                               throws ELException
Throws:
ELException

removeExpandFile

protected void removeExpandFile(Path path,
                                java.lang.String relPath)
                         throws java.io.IOException
Override to prevent removing of special files.

Overrides:
removeExpandFile in class ExpandDeployController<WebApp>
Throws:
java.io.IOException

getLifetimeConnectionCount

public long getLifetimeConnectionCount()

getLifetimeConnectionTime

public long getLifetimeConnectionTime()

getLifetimeReadBytes

public long getLifetimeReadBytes()

getLifetimeWriteBytes

public long getLifetimeWriteBytes()

getLifetimeClientDisconnectCount

public long getLifetimeClientDisconnectCount()

updateStatistics

public void updateStatistics(long milliseconds,
                             int readBytes,
                             int writeBytes,
                             boolean isClientDisconnect)
Update statistics with the results of one request.

Parameters:
milliseconds - the number of millesconds for the request
readBytes - the number of bytes read
writeBytes - the number of bytes written
isClientDisconnect - true if the request ended with a client DisconnectException

getLog

protected java.util.logging.Logger getLog()
Description copied from class: DeployController
Returns the appropriate log for debugging.

Overrides:
getLog in class DeployController<WebApp>

toString

public java.lang.String toString()
Returns a printable view.

Overrides:
toString in class EnvironmentDeployController<WebApp,WebAppConfig>