Methods Summary |
---|
private java.lang.String | getString(java.lang.String s)
return localStrings.getString("enterprise.deployment.AutoDirRedeploy." + s);
|
protected java.util.Properties | getUndeployActionProperties(java.lang.String name)
DeploymentProperties dProps =
(DeploymentProperties)super.getUndeployActionProperties(name);
dProps.setReload(true);
return (Properties)dProps;
|
boolean | invokeDeploymentService(java.io.File deployablefile, java.lang.String action, java.lang.Object[] params, java.lang.String[] signature)I had to override this method because of a bunch of AutoDeployer-specific
error handling that isn't appropriate here
boolean status = false;
try
{
Object result = getMBeanServer().invoke(getMBeanName(), action, params, signature);
int returnStatus = parseResult(result);
if (returnStatus == DeploymentStatus.SUCCESS ||
returnStatus == DeploymentStatus.WARNING) {
status = true;
} else {
status = false;
}
}
catch(AutoDeploymentException de)
{
throw de;
}
catch(Exception e)
{
String msg = "Error in AutoReDeployer.invokeDeploymentService";
throw new AutoDeploymentException(msg, e);
}
return status;
|
public boolean | redeploy()
boolean status = false;
int deployResult = DEPLOY_FAILURE;
try
{
init();
verify();
File source = req.getFileSource().getFile();
String name = req.getName();
deployResult = deploy(source, null, name);
}
catch(AutoDeploymentException ade)
{
throw ade;
}
catch(Exception e)
{
throw new AutoDeploymentException("Error in AutoDirReDeployer.redeploy", e);
}
status = (deployResult == DEPLOY_SUCCESS);
return status;
|
private void | verify()
// make sure we have valid info.
// first -- only ejb modules and J2EE Apps are supported
if(!req.isApplication() && !req.isEjbModule() && !req.isWebModule())
throw new AutoDeploymentException(getString("wrongType"));
// make sure it is a directory. Don't worry about NPE here!
if(!FileUtils.safeIsDirectory(req.getFileSource().getFile()))
throw new AutoDeploymentException(getString("notDir") + req.getFileSource().getFile().getAbsolutePath());
// check that there is a valid name.
if(!StringUtils.ok(req.getName()))
throw new AutoDeploymentException(getString("noName"));
|