Minor performance tweak (for single-tenant mode) as per KR's profiling test

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6729 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2007-09-10 15:51:41 +00:00
parent a3ddf17f8e
commit a8b55a36f7

View File

@@ -336,12 +336,16 @@ public class DictionaryDAOImpl implements DictionaryDAO
* @return mapped models * @return mapped models
*/ */
private List<CompiledModel> getModelsForUri(String uri) private List<CompiledModel> getModelsForUri(String uri)
{
if (tenantService.isEnabled())
{ {
// note: special case, if running as System - e.g. addAuditAspect // note: special case, if running as System - e.g. addAuditAspect
String currentUserName = AuthenticationUtil.getCurrentUserName(); String currentUserName = AuthenticationUtil.getCurrentUserName();
if ((tenantService.isTenantUser()) || if (currentUserName != null)
(tenantService.isTenantName(uri) && (currentUserName != null) && (currentUserName.equals(AuthenticationUtil.getSystemUserName())))) {
if ((tenantService.isTenantUser(currentUserName)) ||
(currentUserName.equals(AuthenticationUtil.getSystemUserName()) && tenantService.isTenantName(uri)))
{ {
String tenantDomain = null; String tenantDomain = null;
if (currentUserName.equals(AuthenticationUtil.getSystemUserName())) if (currentUserName.equals(AuthenticationUtil.getSystemUserName()))
@@ -391,8 +395,9 @@ public class DictionaryDAOImpl implements DictionaryDAO
} }
return models; return models;
} }
else }
{ }
List<CompiledModel> models = getUriToModels().get(uri); List<CompiledModel> models = getUriToModels().get(uri);
if (models == null) if (models == null)
{ {
@@ -400,7 +405,6 @@ public class DictionaryDAOImpl implements DictionaryDAO
} }
return models; return models;
} }
}
/** /**