Package com.suse.coco.module
Class AttestationModuleLoader
- java.lang.Object
-
- com.suse.coco.module.AttestationModuleLoader
-
public class AttestationModuleLoader extends java.lang.ObjectLoadAttestationModulefrom the classpath using JavaServiceLoadermechanism.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.LoggerLOGGERprivate java.util.Map<java.lang.Integer,AttestationModule>workerFactoriesMap
-
Constructor Summary
Constructors Constructor Description AttestationModuleLoader()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AttestationWorkercreateWorker(int resultType)Create a worker to process an attestation result of the given typejava.util.Set<java.lang.Integer>getSupportedResultTypes()Get the supported result types, aggregated from everyAttestationModuleloaded.private static voidloadModuleMappers(org.apache.ibatis.session.Configuration config, AttestationModule module)Load Mybatis mappers into the current configurationlongloadModules()Load all the available implementations ofAttestationModulefrom the classpath.
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
workerFactoriesMap
private final java.util.Map<java.lang.Integer,AttestationModule> workerFactoriesMap
-
-
Method Detail
-
loadModules
public long loadModules()
Load all the available implementations ofAttestationModulefrom 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 configurationmodule- the attestation module
-
getSupportedResultTypes
public java.util.Set<java.lang.Integer> getSupportedResultTypes()
Get the supported result types, aggregated from everyAttestationModuleloaded.- 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
AttestationWorkerimplementation suitable for the result type
-
-