org.codehaus.cargo.container.spi.deployer
Class AbstractCopyingInstalledLocalDeployer

java.lang.Object
  extended by org.codehaus.cargo.util.log.LoggedObject
      extended by org.codehaus.cargo.container.spi.deployer.AbstractDeployer
          extended by org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
              extended by org.codehaus.cargo.container.spi.deployer.AbstractInstalledLocalDeployer
                  extended by org.codehaus.cargo.container.spi.deployer.AbstractCopyingInstalledLocalDeployer
All Implemented Interfaces:
Deployer, Loggable

public abstract class AbstractCopyingInstalledLocalDeployer
extends AbstractInstalledLocalDeployer

Local deployer that deploys WARs, EJBs and EARs to a deployable directory of the given installed container. Note that this deployer supports expanded WARs by copying the expanded WAR to the deployable directory. In other words it does not support in-place expanded WARs (i.e. expanded WARs located in a different directory).

Version:
$Id: AbstractCopyingInstalledLocalDeployer.java 1705 2008-09-02 13:14:55Z adriana $

Constructor Summary
AbstractCopyingInstalledLocalDeployer(InstalledLocalContainer container)
          
 
Method Summary
protected  boolean canBeDeployed(Deployable newDeployable)
          Checks whether the given Deployable can actually be deployed and whether a deployable has a web context path that already exist in another previously deployed Deployable.
 void deploy(Deployable deployable)
          Deploy a Deployable to the running container and make it available for requests.
protected  void deployEar(java.lang.String deployableDir, EAR ear)
          Copy the EAR file to the deployable directory.
protected  void deployEjb(java.lang.String deployableDir, EJB ejb)
          Copy the EJB file to the deployable directory.
protected  void deployExpandedRar(java.lang.String deployableDir, RAR rar)
          Copy the full expanded RAR directory to the deployable directory, renaming it if the user has specified a custom context for this expanded RAR.
protected  void deployExpandedSar(java.lang.String deployableDir, SAR sar)
          Copy the full expanded SAR directory to the deployable directory, renaming it if the user has specified a custom context for this expanded SAR.
protected  void deployExpandedWar(java.lang.String deployableDir, WAR war)
          Copy the full expanded WAR directory to the deployable directory, renaming it if the user has specified a custom context for this expanded WAR.
protected  void deployFile(java.lang.String deployableDir, File file)
          Copy the file to the deployable directory.
protected  void deployRar(java.lang.String deployableDir, RAR rar)
          Copy the RAR file to the deployable directory.
protected  void deploySar(java.lang.String deployableDir, SAR sar)
          Copy the SAR file to the deployable directory.
protected  void deployWar(java.lang.String deployableDir, WAR war)
          Copy the WAR file to the deployable directory, renaming it if the user has specified a custom context for this WAR.
abstract  java.lang.String getDeployableDir()
          Specifies the directory Deployables should be copied to.
 void setShouldDeployExpandedRARs(boolean flag)
          Decide whether expanded RARs should be deployed.
 void setShouldDeployExpandedSARs(boolean flag)
          Decide whether expanded SARs should be deployed.
 void setShouldDeployExpandedWARs(boolean flag)
          Decide whether expanded WARs should be deployed.
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractInstalledLocalDeployer
getType
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractLocalDeployer
getContainer, getFileHandler, setFileHandler
 
Methods inherited from class org.codehaus.cargo.container.spi.deployer.AbstractDeployer
deploy, deploy, redeploy, start, stop, undeploy, undeploy
 
Methods inherited from class org.codehaus.cargo.util.log.LoggedObject
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.util.log.Loggable
getLogger, setLogger
 

Constructor Detail

AbstractCopyingInstalledLocalDeployer

public AbstractCopyingInstalledLocalDeployer(InstalledLocalContainer container)

See Also:
AbstractInstalledLocalDeployer#AbstractInstalledLocalDeployer(org.codehaus.cargo.container.InstalledLocalContainer)
Method Detail

setShouldDeployExpandedWARs

public void setShouldDeployExpandedWARs(boolean flag)
Decide whether expanded WARs should be deployed. Some classes using this deployer may not want to deploy expanded WARs as they may want to deploy them in-situ by modifying the container's configuration file to point to the location of the expanded WAR. This saves some copying time and make it easier for development round-trips.

Parameters:
flag - if true expanded WARs will be deployed

setShouldDeployExpandedSARs

public void setShouldDeployExpandedSARs(boolean flag)
Decide whether expanded SARs should be deployed. Some classes using this deployer may not want to deploy expanded SARs as they may want to deploy them in-situ by modifying the container's configuration file to point to the location of the expanded SAR. This saves some copying time and make it easier for development round-trips.

Parameters:
flag - if true expanded SARs will be deployed

setShouldDeployExpandedRARs

public void setShouldDeployExpandedRARs(boolean flag)
Decide whether expanded RARs should be deployed. Some classes using this deployer may not want to deploy expanded RARs as they may want to deploy them in-situ by modifying the container's configuration file to point to the location of the expanded RAR. This saves some copying time and make it easier for development round-trips.

Parameters:
flag - if true expanded RARs will be deployed

deploy

public void deploy(Deployable deployable)
Deploy a Deployable to the running container and make it available for requests.

Specified by:
deploy in interface Deployer
Overrides:
deploy in class AbstractDeployer
Parameters:
deployable - the Deployable to deploy
See Also:
Deployer.deploy(Deployable)

canBeDeployed

protected boolean canBeDeployed(Deployable newDeployable)
Checks whether the given Deployable can actually be deployed and whether a deployable has a web context path that already exist in another previously deployed Deployable.

Parameters:
newDeployable - deployable
Returns:
true, if the deployable can be deployed

getDeployableDir

public abstract java.lang.String getDeployableDir()
Specifies the directory Deployables should be copied to.

Returns:
Deployable directory

deployEar

protected void deployEar(java.lang.String deployableDir,
                         EAR ear)
Copy the EAR file to the deployable directory.

Parameters:
deployableDir - the directory where the container is expecting deployables to be dropped for deployments
ear - the EAR deployable

deploySar

protected void deploySar(java.lang.String deployableDir,
                         SAR sar)
Copy the SAR file to the deployable directory.

Parameters:
deployableDir - The directory to copy it too
sar - the sar to copy

deployRar

protected void deployRar(java.lang.String deployableDir,
                         RAR rar)
Copy the RAR file to the deployable directory.

Parameters:
deployableDir - The directory to copy it too
rar - the rar to copy

deployEjb

protected void deployEjb(java.lang.String deployableDir,
                         EJB ejb)
Copy the EJB file to the deployable directory.

Parameters:
deployableDir - the container's deployable directory
ejb - the EJB deployable

deployWar

protected void deployWar(java.lang.String deployableDir,
                         WAR war)
Copy the WAR file to the deployable directory, renaming it if the user has specified a custom context for this WAR.

Parameters:
deployableDir - the directory where the container is expecting deployables to be dropped for deployments
war - the WAR war

deployExpandedWar

protected void deployExpandedWar(java.lang.String deployableDir,
                                 WAR war)
Copy the full expanded WAR directory to the deployable directory, renaming it if the user has specified a custom context for this expanded WAR.

Parameters:
deployableDir - the directory where the container is expecting deployables to be dropped for deployments
war - the expanded WAR war

deployExpandedSar

protected void deployExpandedSar(java.lang.String deployableDir,
                                 SAR sar)
Copy the full expanded SAR directory to the deployable directory, renaming it if the user has specified a custom context for this expanded SAR.

Parameters:
deployableDir - the directory to deploy the expanded SAR
sar - the expanded SAR sar

deployExpandedRar

protected void deployExpandedRar(java.lang.String deployableDir,
                                 RAR rar)
Copy the full expanded RAR directory to the deployable directory, renaming it if the user has specified a custom context for this expanded RAR.

Parameters:
deployableDir - the directory to deploy the expanded RAR
rar - the expanded RAR rar

deployFile

protected void deployFile(java.lang.String deployableDir,
                          File file)
Copy the file to the deployable directory.

Parameters:
deployableDir - the directory to hold the file
file - The file to copy


Copyright © 2004-2011 Codehaus. All Rights Reserved.