mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
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:
@@ -22,6 +22,7 @@ import java.io.InputStream;
|
|||||||
import java.lang.reflect.Constructor;
|
import java.lang.reflect.Constructor;
|
||||||
|
|
||||||
import org.alfresco.error.AlfrescoRuntimeException;
|
import org.alfresco.error.AlfrescoRuntimeException;
|
||||||
|
import org.alfresco.error.ExceptionStackUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil;
|
||||||
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
import org.alfresco.repo.security.authentication.AuthenticationUtil.RunAsWork;
|
||||||
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
import org.alfresco.repo.transaction.RetryingTransactionHelper;
|
||||||
@@ -261,7 +262,7 @@ public class DescriptorServiceImpl extends AbstractLifecycleBean
|
|||||||
{
|
{
|
||||||
public Descriptor execute()
|
public Descriptor execute()
|
||||||
{
|
{
|
||||||
return installedRepoDescriptorDAO.getDescriptor();
|
return installedRepoDescriptorDAO.getDescriptor();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Descriptor installed = helper.doInTransaction(getDescriptorCallback, false, false);
|
Descriptor installed = helper.doInTransaction(getDescriptorCallback, false, false);
|
||||||
@@ -299,15 +300,34 @@ public class DescriptorServiceImpl extends AbstractLifecycleBean
|
|||||||
// Now listen for future license changes
|
// Now listen for future license changes
|
||||||
licenseService.registerOnLicenseChange(this);
|
licenseService.registerOnLicenseChange(this);
|
||||||
|
|
||||||
|
// 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;
|
||||||
|
}
|
||||||
|
};
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Verify license has side effect of loading any new licenses
|
helper.doInTransaction(loadLicenseCallback, false, false);
|
||||||
licenseService.verifyLicense();
|
|
||||||
}
|
}
|
||||||
catch (LicenseException e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// Swallow Licence Exception Here
|
// Swallow Licence Exception Here
|
||||||
// Don't log error: It'll be reported by other means
|
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)
|
if (currentRepoDescriptor == null)
|
||||||
{
|
{
|
||||||
currentRepoDescriptor = currentRepoDescriptorDAO.updateDescriptor(serverDescriptor,
|
currentRepoDescriptor = currentRepoDescriptorDAO.updateDescriptor(serverDescriptor, LicenseMode.UNKNOWN);
|
||||||
LicenseMode.UNKNOWN);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user