Merged HEAD-BUG-FIX (4.3/Cloud) to HEAD (4.3/Cloud)

68201: Merged PLATFORM1 (4.3/Cloud) to HEAD-BUG-FIX (4.3/Cloud)
      64815: Put transaction back around licenseService.verifyLicense() (removed in r63894)
       - ACE-525 - BM-0013: SOAK: v420b214_01: DescriptorService intercepts retrying exception during concurrent start
       - The transaction is required for concurrency, etc.
       - Added code to inspect any resulting exception in order to dig out a LicenseException


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@68464 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2014-04-30 16:33:07 +00:00
parent 13d3965663
commit 03f7156590

View File

@@ -22,6 +22,7 @@ import java.io.InputStream;
import java.lang.reflect.Constructor;
import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.error.ExceptionStackUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
@@ -299,15 +300,34 @@ public class DescriptorServiceImpl extends AbstractLifecycleBean
// Now listen for future license changes
licenseService.registerOnLicenseChange(this);
try
// load the license
RetryingTransactionCallback<Void> loadLicenseCallback = new RetryingTransactionCallback<Void>()
{
@Override
public Void execute() throws Throwable
{
// Verify license has side effect of loading any new licenses
licenseService.verifyLicense();
return null;
}
catch (LicenseException e)
};
try
{
helper.doInTransaction(loadLicenseCallback, false, false);
}
catch (Exception e)
{
// Swallow Licence Exception Here
if (ExceptionStackUtil.getCause(e, LicenseException.class) != null)
{
// We found a LicenseException in the bowels
// Don't log error: It'll be reported by other means
}
else
{
// The error here is something else unforeseen
throw e;
}
};
}
@@ -385,8 +405,7 @@ public class DescriptorServiceImpl extends AbstractLifecycleBean
{
if (currentRepoDescriptor == null)
{
currentRepoDescriptor = currentRepoDescriptorDAO.updateDescriptor(serverDescriptor,
LicenseMode.UNKNOWN);
currentRepoDescriptor = currentRepoDescriptorDAO.updateDescriptor(serverDescriptor, LicenseMode.UNKNOWN);
}
}
}