Class AttestationModuleLoader

java.lang.Object
com.suse.coco.module.AttestationModuleLoader

public class AttestationModuleLoader extends Object
Load AttestationModule from the classpath using Java ServiceLoader mechanism.
  • Field Details

    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • workerFactoriesMap

      private final Map<Integer,AttestationModule> workerFactoriesMap
  • Constructor Details

    • AttestationModuleLoader

      public AttestationModuleLoader()
      Default constructor.
  • Method Details

    • loadModules

      public long loadModules()
      Load all the available implementations of AttestationModule from the classpath.
      Returns:
      the number of loaded attestation modules.
    • loadModuleMappers

      private static void loadModuleMappers(org.apache.ibatis.session.Configuration config, AttestationModule module)
      Load Mybatis mappers into the current configuration
      Parameters:
      config - the current mybatis configuration
      module - the attestation module
    • getSupportedResultTypes

      public Set<Integer> getSupportedResultTypes()
      Get the supported result types, aggregated from every AttestationModule loaded.
      Returns:
      the set of supported result types
    • createWorker

      public AttestationWorker createWorker(int resultType)
      Create a worker to process an attestation result of the given type
      Parameters:
      resultType - the result type of the attestation result under processing
      Returns:
      a AttestationWorker implementation suitable for the result type