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

@@ -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);