public class AutoDeployer extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AutoDeployer.AutodeploymentStatus |
Modifier and Type | Field and Description |
---|---|
static Logger |
deplLogger |
protected static int |
DEPLOY_FAILURE |
protected static int |
DEPLOY_PENDING |
protected static int |
DEPLOY_SUCCESS |
Constructor and Description |
---|
AutoDeployer(String target,
String directoryPath,
String virtualServer,
boolean jspPrecompilationEnabled,
boolean verifierEnabled,
boolean renameOnSuccess,
boolean forceDeploy,
boolean enabled,
org.glassfish.hk2.api.ServiceLocator habitat)
Creates a new instance of AutoDeployer
|
AutoDeployer(String target,
String directoryPath,
String virtualServer,
boolean jspPrecompilationEnabled,
boolean verifierEnabled,
org.glassfish.hk2.api.ServiceLocator habitat) |
AutoDeployer(String target,
String directoryPath,
String virtualServer,
org.glassfish.hk2.api.ServiceLocator habitat)
Creates a new autodeployer.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel(boolean value)
Set cancel flag, which will ensure that only if there is any current deployment is in process,
it will be completed but the deployer will not do any more deployment.
|
protected AutoDeployer.AutodeploymentStatus |
deploy(File deployablefile,
File autodeployDir)
Deploy any type of module.
|
void |
disableRenameOnSuccess()
If an archive is successfully autodeployed, file will not be
renamed to archive_deployed
|
void |
enableRenameOnSuccess()
If an archive is successfully autodeployed will be renamed
to archive_deployed
|
boolean |
isCancelled()
get cancel flag value
|
void |
run()
Run through the auto-deployment procedure.
|
void |
run(boolean includeSubdir) |
void |
setDirectory(String directoryPath)
Sets the directory to be scanned by the autodeployer.
|
void |
setDirectoryScanner(DirectoryScanner ds)
set DirectoryScanner which will be used for filtering out deployeble component
|
void |
setHabitat(org.glassfish.hk2.api.ServiceLocator habitat)
Sets the habitat for use in creating DeployCommand and UndeployCommand
instances.
|
void |
setJspPreCompilation(boolean jspPreCompilation)
Set whether this AutoDeployer should precompile JSPs or not.
|
void |
setJspPrecompilationEnabled(boolean setting)
Sets whether or not the precompileJSP option should be requested
during autodeployments.
|
void |
setTarget(String target)
set target server where the autual deployment will be done
|
void |
setVerifierEnabled(boolean verify)
Sets whether descriptor verification should be requested during
autodeployments.
|
void |
setVerify(boolean verify)
Set whether this AutoDeployer should verify or not.
|
void |
undeployAll(File autoDeployDir,
boolean includeSubdir)
do undeployment for all deleted applications in autoDeployDir dir.
|
void |
waitUntilIdle() |
public static final Logger deplLogger
protected static final int DEPLOY_SUCCESS
protected static final int DEPLOY_FAILURE
protected static final int DEPLOY_PENDING
public AutoDeployer(String target, String directoryPath, String virtualServer, org.glassfish.hk2.api.ServiceLocator habitat) throws AutoDeploymentException
target
- deployment target for autodeployed applicationsdirectoryPath
- directory to be scanned for changesvirtualServer
- the virtual server to which to deploy apps tohabitat
- hk2 habitat for injection supportAutoDeploymentException
public AutoDeployer(String target, String directoryPath, String virtualServer, boolean jspPrecompilationEnabled, boolean verifierEnabled, boolean renameOnSuccess, boolean forceDeploy, boolean enabled, org.glassfish.hk2.api.ServiceLocator habitat) throws AutoDeploymentException
target
- the deployment target for autodeployed applicationsdirectoryPath
- the directory to scanvirtualServer
- the virtual server to deploy tojspPrecompilationEnabled
- whether to precompile JSPsverifierEnabled
- whether to verify applications during deploymentrenameOnSuccess
- rename the file if deployment is successfulforceDeploy
- request that forced deployment occur if the app is already deployedenabled
- whether apps should be enabled upon auto-deploymenthabitat
- HK2 habitat for use in instantiating properly-init'd DeployCommand and UndeployCommandAutoDeploymentException
public AutoDeployer(String target, String directoryPath, String virtualServer, boolean jspPrecompilationEnabled, boolean verifierEnabled, org.glassfish.hk2.api.ServiceLocator habitat) throws AutoDeploymentException
AutoDeploymentException
public void setHabitat(org.glassfish.hk2.api.ServiceLocator habitat)
habitat
- public void setJspPrecompilationEnabled(boolean setting)
setting
- true if JSPs should be precompiled during autodeploymentspublic void setDirectory(String directoryPath) throws AutoDeploymentException
directoryPath
- the directory path to scanAutoDeploymentException
public void setVerifierEnabled(boolean verify)
verify
- true if verification should occur during autodeploymentspublic void setDirectoryScanner(DirectoryScanner ds)
ds
- the new directory scanner to usepublic void setTarget(String target)
target
- public void disableRenameOnSuccess()
public void enableRenameOnSuccess()
public void setVerify(boolean verify)
verify
- whether to verify the app during deploymentpublic void setJspPreCompilation(boolean jspPreCompilation)
jspPreCompilation
- precompilation settingpublic void run()
Clients should invoke this method to execute the auto-deployer once with the current configurable settings.
public void run(boolean includeSubdir)
public void waitUntilIdle() throws InterruptedException
InterruptedException
public void undeployAll(File autoDeployDir, boolean includeSubdir) throws AutoDeploymentException
autoDeployDir
- the directory to scan for deleted filesincludeSubdir
- AutoDeploymentException
public void cancel(boolean value)
value
- the cancel settingpublic boolean isCancelled()
protected AutoDeployer.AutodeploymentStatus deploy(File deployablefile, File autodeployDir) throws AutoDeploymentException
deployablefile
- the file to be deployedautodeployDir
- the directory where the file resides (holdover from earlier impl)AutoDeploymentException
- if any invoked method throws an exceptionCopyright © 2018. All rights reserved.