com.caucho.server.deploy
Class ExpandDeployGenerator<E extends ExpandDeployController>

java.lang.Object
  extended by com.caucho.server.deploy.DeployGenerator<E>
      extended by com.caucho.server.deploy.ExpandDeployGenerator<E>
All Implemented Interfaces:
EnvironmentListener, AlarmListener, Dependency, java.util.EventListener
Direct Known Subclasses:
EarDeployGenerator, HostExpandDeployGenerator, WebAppExpandDeployGenerator

public abstract class ExpandDeployGenerator<E extends ExpandDeployController>
extends DeployGenerator<E>
implements AlarmListener

The generator for the deploy


Constructor Summary
ExpandDeployGenerator(DeployContainer<E> container, Path containerRootDirectory)
          Creates the deploy.
 
Method Summary
 void addRequireFile(java.lang.String file)
          Adds a required file in the expansion.
protected  java.lang.String archiveNameToEntryName(java.lang.String archiveName)
          Converts the entry name to the archive name, returns null if the entry name is not valid.
protected abstract  E createController(java.lang.String name)
          Creates a new entry.
protected  java.lang.String entryNameToArchiveName(java.lang.String entryName)
          Converts the archive name to the entry name, returns null if the archive name is not valid.
 boolean equals(java.lang.Object o)
          Tests for equality.
protected  void fillDeployedKeys(java.util.Set<java.lang.String> keys)
          Returns the deployed keys.
 E generateController(java.lang.String name)
          Finds the matching entry.
 Path getArchiveDirectory()
          Gets the war expand directory.
 Path getArchivePath(java.lang.String name)
          Returns the location for deploying an archive with the specified name.
 java.lang.Throwable getConfigException(java.lang.String name)
          Returns an exception for the named archive or null if there is no exception
 long getDependencyCheckInterval()
           
 Path getExpandDirectory()
          Gets the war expand directory.
protected  java.lang.String getExpandName(java.lang.String name)
          Returns the combination of prefix, name, and suffix used for expanded archives.
 Path getExpandPath(java.lang.String name)
          Returns the location of an expanded archive, or null if no archive with the passed name is deployed.
 java.lang.String getExpandPrefix()
          Gets the expand prefix.
 java.lang.String getExpandSuffix()
          Gets the expand suffix.
 java.lang.String getExtension()
          Returns the extension.
protected  java.util.logging.Logger getLog()
          Returns the log.
 java.lang.String[] getNames()
           
 Path getPath()
          Gets the default path.
 java.util.ArrayList<java.lang.String> getVersionNames(java.lang.String name)
           
 void handleAlarm(Alarm alarm)
          Checks for updates.
protected  void initImpl()
          Configuration checks on init.
protected  boolean isDeployedKey(java.lang.String key)
          Return true for a matching key.
 boolean isModified()
          Returns true if the deployment has modified.
protected  boolean isValidDirectory(Path rootDirectory, java.lang.String pathName)
           
 boolean isVersioning()
          Sets true to enable versioning
 boolean logModified(java.util.logging.Logger log)
          Log the reason for modification
protected  java.lang.String pathNameToEntryName(java.lang.String name)
          Converts the expand-path name to the entry name, returns null if the path name is not valid.
 void request()
          Redeploys if modified.
 void setArchiveDirectory(Path path)
          Sets the war expand dir to check for new archive files.
 void setDependencyCheckInterval(Period period)
          Sets the dependency check interval.
 void setExpandCleanupFileset(FileSetType fileSet)
          Sets the expand remove file set.
 void setExpandDirectory(Path path)
          Sets the war expand dir to check for new applications.
 void setExpandPath(Path path)
          Sets the war expand dir to check for new applications.
 void setExpandPrefix(java.lang.String prefix)
          Sets the expand prefix to check for new applications.
 void setExpandSuffix(java.lang.String suffix)
          Sets the expand suffix to check for new applications.
 void setExtension(java.lang.String extension)
          Sets the extension.
 void setPath(Path path)
          Sets the deploy directory.
 void setVersioning(boolean isVersioning)
          Sets true to enable versioning
 boolean start(java.lang.String name)
          Start the archive.
protected  void startImpl()
          Starts the deploy.
 boolean stop(java.lang.String name)
          Stop the archive.
protected  void stopImpl()
          Stops the deploy.
 java.lang.String toString()
           
 boolean undeploy(java.lang.String name)
          Undeploy the archive.
 void update()
          Forces an update.
 
Methods inherited from class com.caucho.server.deploy.DeployGenerator
destroy, destroyImpl, environmentStart, environmentStop, getConfigException, getDeployContainer, getParentClassLoader, getRedeployMode, getStartupMode, getState, init, isActive, isDestroyed, mergeController, setRedeployMode, setStartupMode, start, stop
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ExpandDeployGenerator

public ExpandDeployGenerator(DeployContainer<E> container,
                             Path containerRootDirectory)
Creates the deploy.

Method Detail

getPath

public Path getPath()
Gets the default path.


setPath

public void setPath(Path path)
Sets the deploy directory.


setExpandPath

public void setExpandPath(Path path)
Sets the war expand dir to check for new applications.


setExpandDirectory

public void setExpandDirectory(Path path)
Sets the war expand dir to check for new applications.


getExpandDirectory

public Path getExpandDirectory()
Gets the war expand directory.


getExpandPath

public Path getExpandPath(java.lang.String name)
Returns the location of an expanded archive, or null if no archive with the passed name is deployed.

Parameters:
name - a name, without an extension

getExpandName

protected java.lang.String getExpandName(java.lang.String name)
Returns the combination of prefix, name, and suffix used for expanded archives.

Returns:

setArchiveDirectory

public void setArchiveDirectory(Path path)
Sets the war expand dir to check for new archive files.


getArchiveDirectory

public Path getArchiveDirectory()
Gets the war expand directory.


getArchivePath

public Path getArchivePath(java.lang.String name)
Returns the location for deploying an archive with the specified name.

Parameters:
name - a name, without an extension

setDependencyCheckInterval

public void setDependencyCheckInterval(Period period)
Sets the dependency check interval.


getDependencyCheckInterval

public long getDependencyCheckInterval()

setExpandCleanupFileset

public void setExpandCleanupFileset(FileSetType fileSet)
Sets the expand remove file set.


setExtension

public void setExtension(java.lang.String extension)
                  throws ConfigException
Sets the extension.

Throws:
ConfigException

getExtension

public java.lang.String getExtension()
Returns the extension.


setExpandPrefix

public void setExpandPrefix(java.lang.String prefix)
                     throws ConfigException
Sets the expand prefix to check for new applications.

Throws:
ConfigException

getExpandPrefix

public java.lang.String getExpandPrefix()
Gets the expand prefix.


setExpandSuffix

public void setExpandSuffix(java.lang.String suffix)
                     throws ConfigException
Sets the expand suffix to check for new applications.

Throws:
ConfigException

getExpandSuffix

public java.lang.String getExpandSuffix()
Gets the expand suffix.


addRequireFile

public void addRequireFile(java.lang.String file)
                    throws ConfigException
Adds a required file in the expansion.

Throws:
ConfigException

setVersioning

public void setVersioning(boolean isVersioning)
Sets true to enable versioning


isVersioning

public boolean isVersioning()
Sets true to enable versioning


getLog

protected java.util.logging.Logger getLog()
Returns the log.

Overrides:
getLog in class DeployGenerator<E extends ExpandDeployController>

isModified

public boolean isModified()
Returns true if the deployment has modified.

Specified by:
isModified in interface Dependency
Overrides:
isModified in class DeployGenerator<E extends ExpandDeployController>

logModified

public boolean logModified(java.util.logging.Logger log)
Log the reason for modification

Specified by:
logModified in interface Dependency
Overrides:
logModified in class DeployGenerator<E extends ExpandDeployController>

initImpl

protected void initImpl()
                 throws ConfigException
Configuration checks on init.

Overrides:
initImpl in class DeployGenerator<E extends ExpandDeployController>
Throws:
ConfigException

startImpl

protected void startImpl()
Starts the deploy.

Overrides:
startImpl in class DeployGenerator<E extends ExpandDeployController>

fillDeployedKeys

protected void fillDeployedKeys(java.util.Set<java.lang.String> keys)
Returns the deployed keys.

Overrides:
fillDeployedKeys in class DeployGenerator<E extends ExpandDeployController>

isDeployedKey

protected boolean isDeployedKey(java.lang.String key)
Return true for a matching key.


update

public void update()
Forces an update.

Overrides:
update in class DeployGenerator<E extends ExpandDeployController>

request

public void request()
Redeploys if modified.

Overrides:
request in class DeployGenerator<E extends ExpandDeployController>

generateController

public E generateController(java.lang.String name)
Finds the matching entry.

Overrides:
generateController in class DeployGenerator<E extends ExpandDeployController>

getVersionNames

public java.util.ArrayList<java.lang.String> getVersionNames(java.lang.String name)

isValidDirectory

protected boolean isValidDirectory(Path rootDirectory,
                                   java.lang.String pathName)

pathNameToEntryName

protected java.lang.String pathNameToEntryName(java.lang.String name)
Converts the expand-path name to the entry name, returns null if the path name is not valid.


entryNameToArchiveName

protected java.lang.String entryNameToArchiveName(java.lang.String entryName)
Converts the archive name to the entry name, returns null if the archive name is not valid.


archiveNameToEntryName

protected java.lang.String archiveNameToEntryName(java.lang.String archiveName)
Converts the entry name to the archive name, returns null if the entry name is not valid.


createController

protected abstract E createController(java.lang.String name)
Creates a new entry.


getNames

public java.lang.String[] getNames()

start

public boolean start(java.lang.String name)
Start the archive.


getConfigException

public java.lang.Throwable getConfigException(java.lang.String name)
Returns an exception for the named archive or null if there is no exception


stop

public boolean stop(java.lang.String name)
Stop the archive.


undeploy

public boolean undeploy(java.lang.String name)
Undeploy the archive.


handleAlarm

public void handleAlarm(Alarm alarm)
Checks for updates.

Specified by:
handleAlarm in interface AlarmListener

stopImpl

protected void stopImpl()
Stops the deploy.

Overrides:
stopImpl in class DeployGenerator<E extends ExpandDeployController>

equals

public boolean equals(java.lang.Object o)
Tests for equality.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class DeployGenerator<E extends ExpandDeployController>