Class AttestationModuleLoader


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

      • LOGGER

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

        private final java.util.Map<java.lang.Integer,​AttestationModule> workerFactoriesMap
    • Constructor Detail

      • AttestationModuleLoader

        public AttestationModuleLoader()
        Default constructor.
    • Method Detail

      • 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 java.util.Set<java.lang.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