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 serviceLocator)
Creates a new instance of AutoDeployer
|
AutoDeployer(String target,
String directoryPath,
String virtualServer,
boolean jspPrecompilationEnabled,
boolean verifierEnabled,
org.glassfish.hk2.api.ServiceLocator serviceLocator) |
AutoDeployer(String target,
String directoryPath,
String virtualServer,
org.glassfish.hk2.api.ServiceLocator serviceLocator)
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
|
static String |
getNameFromFilePath(File autodeployDir,
File filePath) |
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 directoryScanner)
set DirectoryScanner which will be used for filtering out deployeble component
|
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 |
setServiceLocator(org.glassfish.hk2.api.ServiceLocator serviceLocator)
Sets the serviceLocator for use in creating DeployCommand and UndeployCommand instances.
|
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 serviceLocator) throws AutoDeploymentException
target - deployment target for autodeployed applicationsdirectoryPath - directory to be scanned for changesvirtualServer - the virtual server to which to deploy apps toserviceLocator - hk2 habitat for injection supportAutoDeploymentExceptionpublic AutoDeployer(String target, String directoryPath, String virtualServer, boolean jspPrecompilationEnabled, boolean verifierEnabled, boolean renameOnSuccess, boolean forceDeploy, boolean enabled, org.glassfish.hk2.api.ServiceLocator serviceLocator) 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-deploymentserviceLocator - HK2 serviceLocator for use in instantiating properly-init'd DeployCommand and UndeployCommandAutoDeploymentExceptionpublic AutoDeployer(String target, String directoryPath, String virtualServer, boolean jspPrecompilationEnabled, boolean verifierEnabled, org.glassfish.hk2.api.ServiceLocator serviceLocator) throws AutoDeploymentException
AutoDeploymentExceptionpublic void setServiceLocator(org.glassfish.hk2.api.ServiceLocator serviceLocator)
serviceLocator - 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 scanAutoDeploymentExceptionpublic void setVerifierEnabled(boolean verify)
verify - true if verification should occur during autodeploymentspublic void setDirectoryScanner(DirectoryScanner directoryScanner)
directoryScanner - 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
InterruptedExceptionpublic void undeployAll(File autoDeployDir, boolean includeSubdir) throws AutoDeploymentException
autoDeployDir - the directory to scan for deleted filesincludeSubdir - AutoDeploymentExceptionpublic 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 © 2019. All rights reserved.