WebScripts: replace custom cloneEmpty with standard Spring factory pattern (follow-on from r8293 & r8335)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8349 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2008-02-21 12:12:14 +00:00
parent 6ad23dfa26
commit 7f0a4aeabc
2 changed files with 22 additions and 3 deletions

View File

@@ -56,6 +56,7 @@ import org.alfresco.web.scripts.Description.RequiredAuthentication;
import org.alfresco.web.scripts.Description.RequiredTransaction;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.ObjectFactory;
/**
@@ -76,14 +77,24 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
private PermissionService permissionService;
private DescriptorService descriptorService;
private TenantDeployerService tenantDeployerService;
private ObjectFactory registryFactory;
private SimpleCache<String, Registry> webScriptsRegistryCache;
/**
* @param webScriptsRegistryCache
*/
public void setWebScriptsRegistryCache(SimpleCache<String, Registry> webScriptsRegistryCache)
{
this.webScriptsRegistryCache = webScriptsRegistryCache;
}
/**
* @param registryFactory
*/
public void setRegistryFactory(ObjectFactory registryFactory) {
this.registryFactory = registryFactory;
}
/**
* @param repository
*/
@@ -366,7 +377,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
{
tenantDeployerService.register(this);
Registry registry = super.getRegistry().cloneEmpty();
Registry registry = (Registry)registryFactory.getObject();
webScriptsRegistryCache.put(tenantDeployerService.getCurrentUserDomain(), registry);
super.reset();