From 0a1c57a07ebd9d1adc9f40b4564db173c2ac9625 Mon Sep 17 00:00:00 2001 From: Derek Hulley Date: Wed, 5 Aug 2015 11:02:28 +0000 Subject: [PATCH] Fixed tabs during review git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@109608 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../repo/module/ModuleComponentHelper.java | 152 +++++++++--------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/source/java/org/alfresco/repo/module/ModuleComponentHelper.java b/source/java/org/alfresco/repo/module/ModuleComponentHelper.java index 28f7ae6e93..9d71394cac 100644 --- a/source/java/org/alfresco/repo/module/ModuleComponentHelper.java +++ b/source/java/org/alfresco/repo/module/ModuleComponentHelper.java @@ -203,7 +203,7 @@ public class ModuleComponentHelper /* * Ensure transactionality and the correct authentication */ - AuthenticationUtil.runAs(new RunAsWork() + AuthenticationUtil.runAs(new RunAsWork() { public Object doWork() throws Exception { @@ -244,82 +244,82 @@ public class ModuleComponentHelper } } } - - final List tenants = tenantsNonFinal; - - for (final ModuleDetails module : modules) - { - RetryingTransactionCallback startModuleWork = new RetryingTransactionCallback() - { - public Object execute() throws Exception - { - startModule(module, mapStartedModules.get(tenantDomainCtx), mapExecutedComponents.get(tenantDomainCtx)); - - if (tenants != null) - { - for (Tenant tenant : tenants) - { - final String tenantDomain = tenant.getTenantDomain(); - TenantUtil.runAsSystemTenant(new TenantRunAsWork() - { - public Object doWork() throws Exception - { - startModule(module, mapStartedModules.get(tenantDomain), mapExecutedComponents.get(tenantDomain)); - return null; - } - }, tenantDomain); - } - } - - return null; - } - }; + + final List tenants = tenantsNonFinal; + + for (final ModuleDetails module : modules) + { + RetryingTransactionCallback startModuleWork = new RetryingTransactionCallback() + { + public Object execute() throws Exception + { + startModule(module, mapStartedModules.get(tenantDomainCtx), mapExecutedComponents.get(tenantDomainCtx)); + + if (tenants != null) + { + for (Tenant tenant : tenants) + { + final String tenantDomain = tenant.getTenantDomain(); + TenantUtil.runAsSystemTenant(new TenantRunAsWork() + { + public Object doWork() throws Exception + { + startModule(module, mapStartedModules.get(tenantDomain), mapExecutedComponents.get(tenantDomain)); + return null; + } + }, tenantDomain); + } + } + + return null; + } + }; transactionService.getRetryingTransactionHelper().doInTransaction(startModuleWork, transactionService.isReadOnly()); - } - - // Check for missing modules. - checkForMissingModules(); - - if (tenants != null) - { - for (Tenant tenant : tenants) - { - TenantUtil.runAsSystemTenant(new TenantRunAsWork() - { - public Object doWork() throws Exception - { - checkForMissingModules(); - return null; - } - }, tenant.getTenantDomain()); - } - } - - // Check that all components where executed, or considered for execution - checkForOrphanComponents(mapExecutedComponents.get(tenantDomainCtx)); - - if (tenants != null) - { - for (Tenant tenant : tenants) - { - final String tenantDomain = tenant.getTenantDomain(); - TenantUtil.runAsSystemTenant(new TenantRunAsWork() - { - public Object doWork() throws Exception - { - checkForOrphanComponents(mapExecutedComponents.get(tenantDomain)); - return null; - } - }, tenantDomain); - } - } - } - catch (Throwable e) - { - throw new AlfrescoRuntimeException("Failed to start modules", e); - } - - return null; + } + + // Check for missing modules. + checkForMissingModules(); + + if (tenants != null) + { + for (Tenant tenant : tenants) + { + TenantUtil.runAsSystemTenant(new TenantRunAsWork() + { + public Object doWork() throws Exception + { + checkForMissingModules(); + return null; + } + }, tenant.getTenantDomain()); + } + } + + // Check that all components where executed, or considered for execution + checkForOrphanComponents(mapExecutedComponents.get(tenantDomainCtx)); + + if (tenants != null) + { + for (Tenant tenant : tenants) + { + final String tenantDomain = tenant.getTenantDomain(); + TenantUtil.runAsSystemTenant(new TenantRunAsWork() + { + public Object doWork() throws Exception + { + checkForOrphanComponents(mapExecutedComponents.get(tenantDomain)); + return null; + } + }, tenantDomain); + } + } + } + catch (Throwable e) + { + throw new AlfrescoRuntimeException("Failed to start modules", e); + } + + return null; } }, AuthenticationUtil.getSystemUserName()); }