Class AttestationQueueProcessor


  • public class AttestationQueueProcessor
    extends java.lang.Object
    Process entry in the table suseAttestationResult and executes the proper based on the result type.
    • Constructor Detail

      • AttestationQueueProcessor

        public AttestationQueueProcessor​(org.apache.ibatis.session.SqlSessionFactory sessionFactory,
                                         Configuration configuration,
                                         AttestationModuleLoader moduleLoader)
        Create an attestation queue processor.
        Parameters:
        sessionFactory - the session factory to access the database
        configuration - the current application configuration
        moduleLoader - the attestation module loader
      • AttestationQueueProcessor

        protected AttestationQueueProcessor​(javax.sql.DataSource dataSource,
                                            AttestationResultService service,
                                            java.util.concurrent.ExecutorService executorService,
                                            AttestationModuleLoader moduleLoader,
                                            int batchSize)
        Create an attestation queue processor.
        Parameters:
        dataSource - the datasource to be used to listen to the database notification
        service - the attestation result service
        executorService - the executor to perform the process
        moduleLoader - the attestation module loader
        batchSize - the batch size
    • Method Detail

      • start

        public void start()
        Start the execution of the queue processor. This method will start the processing asynchronously and exit immediately. Use awaitTermination() to wait for the processor to complete.
      • awaitTermination

        public void awaitTermination()
                              throws java.lang.InterruptedException
        Wait indefinitely for the processor to complete. This is the same as awaitTermination(0L)
        Throws:
        java.lang.InterruptedException - if the wait for all the threads to stop is interrupted
      • stop

        public void stop()
        Interrupts the execution of this processor.
      • isRunning

        public boolean isRunning()
        Check if this attestation processor is running
        Returns:
        true if at least one of the processor threads is still running