public static JobHooks loadJobHooks() {
    List<JobHooks> jobHooks = new ArrayList<>();
    ServiceLoader.load(JobHooksExtension.class)
        .iterator()
        .forEachRemaining(
            extension -> {
              extension.initialize();
              jobHooks.add(extension.getJobHooks());
            });
    return jobHooks.isEmpty()
        ? new DefaultJobHooks()
        : new MultiplexJobHooks(jobHooks.toArray(new JobHooks[0]));
  }
Helper for loading job hooks extensions.
portability-spi-transfer/src/main/java/org/datatransferproject/spi/transfer/hooks/JobHooksLoader.java