Package fr.becpg.repo.helper
Class TenantJobHelper
java.lang.Object
fr.becpg.repo.helper.TenantJobHelper
Runs the work of a scheduled job as System in the default domain and in each enabled tenant.
- Author:
- matthieu
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondomainsToServe(org.alfresco.repo.tenant.TenantAdminService tenantAdminService) private static voidrunAsSystem(Runnable work, String tenantDomain) static voidrunForEachTenant(org.alfresco.repo.tenant.TenantAdminService tenantAdminService, Runnable work) Runs the work in the default domain, then once in each other enabled tenant.
-
Field Details
-
logger
private static final org.apache.commons.logging.Log logger
-
-
Constructor Details
-
TenantJobHelper
private TenantJobHelper()
-
-
Method Details
-
runForEachTenant
public static void runForEachTenant(org.alfresco.repo.tenant.TenantAdminService tenantAdminService, Runnable work) Runs the work in the default domain, then once in each other enabled tenant.A failure in one domain is logged and does not keep the work from running in the following ones. An exception the transaction helper retries on is the exception of that rule: it is thrown again untouched, so that a job called inside a retrying transaction is still replayed.
- Parameters:
tenantAdminService- the tenant admin service, null when multi-tenancy is not wiredwork- the work to run
-
domainsToServe
-
runAsSystem
-