mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Turned WebScripts registry into an asynchronously-refreshed component
- The size of the object and the nature in which it is read means that it does not really fit into the clustered cache model. We just notify the cluster if the cache entry it needs to be reloaded, serving stale data for a short while - ALF-19982: BM-0013: Reindex: WebScripts registry is repeatedly reset (DeclarativeRegistry) - ALF-19983 BM-0013: Reindex: Solr reindex works very slowly git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@55415 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -27,31 +27,25 @@ public class PublicApiRepositoryContainer extends TenantRepositoryContainer
|
||||
{
|
||||
protected static final Log logger = LogFactory.getLog(PublicApiRepositoryContainer.class);
|
||||
|
||||
/**
|
||||
/**
|
||||
* Execute script within required level of transaction
|
||||
*
|
||||
* @param scriptReq
|
||||
* @param scriptRes
|
||||
* @throws IOException
|
||||
*/
|
||||
@Override
|
||||
protected void transactionedExecute(final WebScript script, final WebScriptRequest scriptReq, final WebScriptResponse scriptRes)
|
||||
throws IOException
|
||||
{
|
||||
final HttpServletRequest httpServletRequest = WebScriptServletRuntime.getHttpServletRequest(scriptReq);
|
||||
if(httpServletRequest instanceof PublicApiHttpServletRequest)
|
||||
{
|
||||
// reset the request input stream if it has been read e.g. by getParameter
|
||||
PublicApiHttpServletRequest publicApiRequest = (PublicApiHttpServletRequest)httpServletRequest;
|
||||
publicApiRequest.resetInputStream();
|
||||
}
|
||||
final HttpServletRequest httpServletRequest = WebScriptServletRuntime.getHttpServletRequest(scriptReq);
|
||||
if(httpServletRequest instanceof PublicApiHttpServletRequest)
|
||||
{
|
||||
// reset the request input stream if it has been read e.g. by getParameter
|
||||
PublicApiHttpServletRequest publicApiRequest = (PublicApiHttpServletRequest)httpServletRequest;
|
||||
publicApiRequest.resetInputStream();
|
||||
}
|
||||
|
||||
super.transactionedExecute(script, scriptReq, scriptRes);
|
||||
super.transactionedExecute(script, scriptReq, scriptRes);
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.alfresco.web.scripts.RuntimeContainer#executeScript(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.WebScriptResponse, org.alfresco.web.scripts.Authenticator)
|
||||
*/
|
||||
@Override
|
||||
public void executeScript(final WebScriptRequest scriptReq, final WebScriptResponse scriptRes, final Authenticator auth)
|
||||
throws IOException
|
||||
{
|
||||
@@ -84,7 +78,7 @@ public class PublicApiRepositoryContainer extends TenantRepositoryContainer
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
PublicApiRepositoryContainer.super.executeScript(scriptReq, scriptRes, auth);
|
||||
PublicApiRepositoryContainer.super.executeScript(scriptReq, scriptRes, auth);
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -94,7 +88,7 @@ public class PublicApiRepositoryContainer extends TenantRepositoryContainer
|
||||
{
|
||||
if (tenant.equalsIgnoreCase(TenantUtil.DEFAULT_TENANT))
|
||||
{
|
||||
tenant = tenantAdminService.getUserDomain(user);
|
||||
tenant = tenantAdminService.getUserDomain(user);
|
||||
}
|
||||
|
||||
// run as explicit tenant
|
||||
@@ -102,7 +96,7 @@ public class PublicApiRepositoryContainer extends TenantRepositoryContainer
|
||||
{
|
||||
public Object doWork() throws Exception
|
||||
{
|
||||
PublicApiRepositoryContainer.super.executeScript(scriptReq, scriptRes, auth);
|
||||
PublicApiRepositoryContainer.super.executeScript(scriptReq, scriptRes, auth);
|
||||
return null;
|
||||
}
|
||||
}, tenant);
|
||||
|
Reference in New Issue
Block a user