Class TenantJobHelper

java.lang.Object
fr.becpg.repo.helper.TenantJobHelper

public final class TenantJobHelper extends Object
Runs the work of a scheduled job as System in the default domain and in each enabled tenant.
Author:
matthieu
  • 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 wired
      work - the work to run
    • domainsToServe

      private static List<String> domainsToServe(org.alfresco.repo.tenant.TenantAdminService tenantAdminService)
    • runAsSystem

      private static void runAsSystem(Runnable work, String tenantDomain)