com.caucho.env.deploy
Class ExpandDeployController<I extends DeployInstance>

java.lang.Object
  extended by com.caucho.env.deploy.DeployController<I>
      extended by com.caucho.env.deploy.ExpandDeployController<I>
All Implemented Interfaces:
DeployActionHandler, DeployControllerApi<I>, RepositoryTagListener, Dependency
Direct Known Subclasses:
EnvironmentDeployController

public abstract class ExpandDeployController<I extends DeployInstance>
extends DeployController<I>
implements RepositoryTagListener

A deployment entry that expands from an archive (Jar/Zip) file.


Field Summary
static java.lang.String APPLICATION_HASH_PATH
           
 
Fields inherited from class com.caucho.env.deploy.DeployController
_lifecycle, REDEPLOY_CHECK_INTERVAL
 
Constructor Summary
protected ExpandDeployController(java.lang.String id)
           
protected ExpandDeployController(java.lang.String id, java.lang.ClassLoader loader, Path rootDirectory, DeployContainerApi<?> container)
           
 
Method Summary
protected  void addDependencies()
           
 void addExpandCleanupFileSet(FileSetType fileSet)
          Sets the archive auto-remove file set.
 void addExpandPreserveFileset(FileSetType fileSet)
          Sets the archive auto-remove file set.
protected  void addManifestClassPath()
          Adds any class path from the manifest.
protected  void configureInstance(I deployInstance)
          Configuration of the instance
protected  boolean controllerLogModified(java.util.logging.Logger log)
           
 void deploy()
          Deploys the controller
protected  void deployImpl()
          Deploys the controller
 boolean equals(java.lang.Object o)
          Returns equality.
 Path getArchivePath()
          Gets the archive path.
 java.lang.String getAutoDeployStage()
           
 java.lang.String getAutoDeployTag()
           
 java.lang.Throwable getConfigException()
           
 java.util.jar.Manifest getManifest()
          Returns the manifest.
 java.util.Map<java.lang.String,java.lang.String> getManifestAttributes()
          Returns the manifest as an attribute map
 Repository getRepository()
          Returns the repository
 Path getRootDirectory()
          Gets the root directory
 Dependency getVersionDependency()
           
 int hashCode()
          Returns the hash code.
protected  void initEnd()
          Final calls for init.
 boolean isAllowRepository()
           
protected  boolean isControllerModified()
           
protected  boolean isControllerModifiedNow()
           
 void merge(DeployControllerApi<I> newControllerV)
          Merges with the new controller.
protected  void onActive()
           
protected  void onDestroy()
           
protected  void onError(java.lang.Throwable e)
           
protected  void onStop()
           
 void onTagChange(java.lang.String tag)
           
protected  void postConfigureInstance(I deployInstance)
          After instance configuration
protected  void postExtract(boolean isExtract)
          Called after the application is extracted from the repository.
protected  void preConfigureInstance(I deployInstance)
          Before instance configuration
protected  void removeExpandDirectory(Path path)
          Recursively remove all files in a directory.
protected  void removeExpandDirectory(Path path, java.lang.String prefix)
          Recursively remove all files in a directory.
protected  void removeExpandFile(Path path, java.lang.String prefix)
          Removes an expanded file.
 void setAllowRepository(boolean isAllowRepository)
           
 void setArchivePath(Path path)
          Sets the archive path.
 void setDependencyCheckInterval(long period)
           
protected  void setRootDirectory(Path rootDirectory)
          Sets the root directory
 void setVersionDependency(Dependency versionDependency)
           
 
Methods inherited from class com.caucho.env.deploy.DeployController
addLifecycleListener, alarm, close, createDeployInstance, destroy, destroyInstance, getActiveDeployInstance, getActiveWaitTime, getControllerType, getDeployInstance, getDeployInstanceImpl, getId, getIdKey, getIdStage, getIdType, getLog, getParentClassLoader, getRedeployCheckInterval, getRedeployMode, getStartTime, getStartupMode, getStartupPriority, getState, init, initBegin, instantiateDeployInstance, isIdleTimeout, isModified, isModifiedNow, isNameMatch, logModified, mergeRedeployCheckInterval, mergeRedeployMode, onStartComplete, request, restart, setActiveWaitTimeMillis, setControllerType, setRedeployCheckInterval, setRedeployMode, setStartupMode, setStartupPriority, start, startImpl, startOnInit, stop, stopImpl, stopLazyImpl, subrequest, toRestart, toStart, toStop, toString, update
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

APPLICATION_HASH_PATH

public static final java.lang.String APPLICATION_HASH_PATH
See Also:
Constant Field Values
Constructor Detail

ExpandDeployController

protected ExpandDeployController(java.lang.String id)

ExpandDeployController

protected ExpandDeployController(java.lang.String id,
                                 java.lang.ClassLoader loader,
                                 Path rootDirectory,
                                 DeployContainerApi<?> container)
Method Detail

getRootDirectory

public Path getRootDirectory()
Gets the root directory


setRootDirectory

protected void setRootDirectory(Path rootDirectory)
Sets the root directory


getArchivePath

public Path getArchivePath()
Gets the archive path.


setArchivePath

public void setArchivePath(Path path)
Sets the archive path.


setAllowRepository

public void setAllowRepository(boolean isAllowRepository)

isAllowRepository

public boolean isAllowRepository()

getRepository

public Repository getRepository()
Returns the repository


getManifest

public java.util.jar.Manifest getManifest()
Returns the manifest.


getManifestAttributes

public java.util.Map<java.lang.String,java.lang.String> getManifestAttributes()
Returns the manifest as an attribute map


addExpandCleanupFileSet

public void addExpandCleanupFileSet(FileSetType fileSet)
Sets the archive auto-remove file set.


addExpandPreserveFileset

public void addExpandPreserveFileset(FileSetType fileSet)
Sets the archive auto-remove file set.


getAutoDeployStage

public java.lang.String getAutoDeployStage()

setDependencyCheckInterval

public void setDependencyCheckInterval(long period)

initEnd

protected void initEnd()
Final calls for init.

Overrides:
initEnd in class DeployController<I extends DeployInstance>

merge

public void merge(DeployControllerApi<I> newControllerV)
Merges with the new controller.

Specified by:
merge in interface DeployControllerApi<I extends DeployInstance>
Overrides:
merge in class DeployController<I extends DeployInstance>

deploy

public void deploy()
Deploys the controller


deployImpl

protected void deployImpl()
Deploys the controller


preConfigureInstance

protected void preConfigureInstance(I deployInstance)
                             throws java.lang.Exception
Description copied from class: DeployController
Before instance configuration

Overrides:
preConfigureInstance in class DeployController<I extends DeployInstance>
Throws:
java.lang.Exception

configureInstance

protected void configureInstance(I deployInstance)
                          throws java.lang.Exception
Description copied from class: DeployController
Configuration of the instance

Overrides:
configureInstance in class DeployController<I extends DeployInstance>
Throws:
java.lang.Exception

postConfigureInstance

protected void postConfigureInstance(I deployInstance)
                              throws java.lang.Exception
Description copied from class: DeployController
After instance configuration

Overrides:
postConfigureInstance in class DeployController<I extends DeployInstance>
Throws:
java.lang.Exception

onTagChange

public void onTagChange(java.lang.String tag)
Specified by:
onTagChange in interface RepositoryTagListener

postExtract

protected void postExtract(boolean isExtract)
                    throws java.io.IOException
Called after the application is extracted from the repository.

Throws:
java.io.IOException

addManifestClassPath

protected void addManifestClassPath()
                             throws java.io.IOException
Adds any class path from the manifest.

Throws:
java.io.IOException

getAutoDeployTag

public java.lang.String getAutoDeployTag()

isControllerModified

protected boolean isControllerModified()
Overrides:
isControllerModified in class DeployController<I extends DeployInstance>

isControllerModifiedNow

protected boolean isControllerModifiedNow()
Overrides:
isControllerModifiedNow in class DeployController<I extends DeployInstance>

controllerLogModified

protected boolean controllerLogModified(java.util.logging.Logger log)
Overrides:
controllerLogModified in class DeployController<I extends DeployInstance>

addDependencies

protected void addDependencies()

getVersionDependency

public Dependency getVersionDependency()

setVersionDependency

public void setVersionDependency(Dependency versionDependency)

removeExpandDirectory

protected void removeExpandDirectory(Path path)
Recursively remove all files in a directory. Used for wars when they change.

Parameters:
path - root directory to start removal

getConfigException

public java.lang.Throwable getConfigException()

removeExpandDirectory

protected void removeExpandDirectory(Path path,
                                     java.lang.String prefix)
Recursively remove all files in a directory. Used for wars when they change.

Parameters:
dir - root directory to start removal

removeExpandFile

protected void removeExpandFile(Path path,
                                java.lang.String prefix)
                         throws java.io.IOException
Removes an expanded file.

Throws:
java.io.IOException

onActive

protected void onActive()
Overrides:
onActive in class DeployController<I extends DeployInstance>

onError

protected void onError(java.lang.Throwable e)
Overrides:
onError in class DeployController<I extends DeployInstance>

onStop

protected void onStop()
Overrides:
onStop in class DeployController<I extends DeployInstance>

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class DeployController<I extends DeployInstance>

hashCode

public int hashCode()
Returns the hash code.

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Returns equality.

Overrides:
equals in class java.lang.Object