mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
ALF-1946: Cut down repository startup time by only refreshing web script registry once!
- A discovery by Kev - RepositoryContainer now remembers whether or not it is initialized and doesn't refresh a registry returned by getRegistry() when it is not (as the superclass will think it has to initialize it) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@19217 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -91,6 +91,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
private TenantAdminService tenantAdminService;
|
||||
private ObjectFactory registryFactory;
|
||||
private SimpleCache<String, Registry> webScriptsRegistryCache;
|
||||
private boolean initialized;
|
||||
|
||||
/**
|
||||
* @param webScriptsRegistryCache
|
||||
@@ -457,7 +458,11 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
if (registry == null)
|
||||
{
|
||||
registry = (Registry)registryFactory.getObject();
|
||||
registry.reset();
|
||||
// We only need to reset the registry if the superclass thinks its already initialized
|
||||
if (initialized)
|
||||
{
|
||||
registry.reset();
|
||||
}
|
||||
webScriptsRegistryCache.put(tenantDomain, registry);
|
||||
}
|
||||
return registry;
|
||||
@@ -552,6 +557,8 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
tenantAdminService.register(this);
|
||||
|
||||
super.reset();
|
||||
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
@@ -560,6 +567,8 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
public void destroy()
|
||||
{
|
||||
webScriptsRegistryCache.remove(tenantAdminService.getCurrentUserDomain());
|
||||
|
||||
initialized = false;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user