MOB-687 - WCM Deployment - Select multiple test servers

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14337 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-05-15 15:35:58 +00:00
parent 17fd83154b
commit 91452b1bae
3 changed files with 85 additions and 56 deletions

View File

@@ -372,13 +372,13 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
logger.debug("Starting deployment of " + actionedUponNodeRef.toString() +
" to " + serverUri + " at " + startDate);
if (delayDeploymentLogger.isDebugEnabled() && delay > 0)
{
delayDeploymentLogger.debug("Delaying deployment by " + delay + "s...");
// add a delay for testing purposes if the delay logger level is debug
try { Thread.sleep(1000*delay); } catch (Throwable e) {}
}
// if (delayDeploymentLogger.isDebugEnabled() && delay > 0)
// {
// delayDeploymentLogger.debug("Delaying deployment by " + delay + "s...");
//
// // add a delay for testing purposes if the delay logger level is debug
// try { Thread.sleep(1000*delay); } catch (Throwable e) {}
// }
// make the deploy call passing in the DeploymentCallback, if present
Throwable deployError = null;
@@ -441,7 +441,8 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
// create the deployment report node
createDeploymentReportNode(report, attemptRef, serverProps, version,
websiteRef, startDate, deployError);
websiteRef, startDate, deployError);
}
/**
@@ -497,6 +498,7 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
reportProps.put(WCMAppModel.PROP_DEPLOYFAILEDREASON, errorMsg);
}
reportRef = this.nodeService.createNode(attempt,
WCMAppModel.ASSOC_DEPLOYMENTREPORTS, WCMAppModel.ASSOC_DEPLOYMENTREPORTS,
WCMAppModel.TYPE_DEPLOYMENTREPORT, reportProps).getChildRef();
@@ -540,6 +542,4 @@ public class AVMDeployWebsiteAction extends ActionExecuterAbstractBase
return reportRef;
}
}

View File

@@ -183,17 +183,18 @@ public class DeploymentServiceImpl implements DeploymentService
*/
fgLogger.debug("creating snapshot of local version");
final String storeName = srcPath.substring(0, srcPath.indexOf(":"));
version = snapshotLocal(storeName);
RetryingTransactionCallback<Integer> localSnapshot = new RetryingTransactionCallback<Integer>()
{
public Integer execute() throws Throwable
{
int newVersion = fAVMService.createSnapshot(storeName, null, null).get(storeName);
return new Integer(newVersion);
}
};
version = trn.doInTransaction(localSnapshot, false, true).intValue();
fgLogger.debug("snapshot local created " + storeName + ", " + version);
// RetryingTransactionCallback<Integer> localSnapshot = new RetryingTransactionCallback<Integer>()
// {
// public Integer execute() throws Throwable
// {
// int newVersion = fAVMService.createSnapshot(storeName, null, null).get(storeName);
// return new Integer(newVersion);
// }
// };
// version = trn.doInTransaction(localSnapshot, false, true).intValue();
// fgLogger.debug("snapshot local created " + storeName + ", " + version);
}
{
@@ -854,6 +855,34 @@ public class DeploymentServiceImpl implements DeploymentService
prevPath = currPath;
}
}
/**
* Create a new local snapshot
* @param storeName
* @return the version
*/
private int snapshotLocal(final String storeName)
{
RetryingTransactionHelper trn = trxService.getRetryingTransactionHelper();
/**
* If version is -1, Create a local snapshot to deploy
*/
fgLogger.debug("creating snapshot of local version");
RetryingTransactionCallback<Integer> localSnapshot = new RetryingTransactionCallback<Integer>()
{
public Integer execute() throws Throwable
{
int newVersion = fAVMService.createSnapshot(storeName, null, null).get(storeName);
return new Integer(newVersion);
}
};
int version = trn.doInTransaction(localSnapshot, false, true).intValue();
fgLogger.debug("snapshot local created " + storeName + ", " + version);
return version;
}
/**
* Deploy differences to a File System Receiver, FSR
@@ -916,7 +945,8 @@ public class DeploymentServiceImpl implements DeploymentService
if (version < 0)
{
String storeName = srcPath.substring(0, srcPath.indexOf(':'));
version = fAVMService.createSnapshot(storeName, null, null).get(storeName);
version = snapshotLocal(storeName);
//version = fAVMService.createSnapshot(storeName, null, null).get(storeName);
}
transformers = getTransformers(adapterName);