Class ListeningThread

java.lang.Object
com.suse.coco.attestation.AbstractProcessorThread
com.suse.coco.attestation.ListeningThread
All Implemented Interfaces:
Runnable

class ListeningThread extends AbstractProcessorThread
Listener thread of the AttestationQueueProcessor. Waits for the PostgreSQL notifications and notifies the ProcessingThread when there is data to process.
  • Field Details

    • LOGGER

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

      private final Object connectionLock
    • dataSource

      private final DataSource dataSource
    • forceShutdown

      private boolean forceShutdown
    • pgConnection

      private org.postgresql.jdbc.PgConnection pgConnection
    • processingThread

      private ProcessingThread processingThread
  • Constructor Details

    • ListeningThread

      ListeningThread(DataSource dataSourceIn)
      Builds a listener thread
      Parameters:
      dataSourceIn - the datasource to be used to connect to the database
  • Method Details

    • setProcessingThread

      public void setProcessingThread(ProcessingThread processingThreadIn)
    • start

      public void start()
      Description copied from class: AbstractProcessorThread
      Starts the processing of the thread.
      Overrides:
      start in class AbstractProcessorThread
    • stop

      public void stop()
      Description copied from class: AbstractProcessorThread
      Stops the processing of the thread, if it is running.
      Overrides:
      stop in class AbstractProcessorThread
    • run

      public void run()
    • abortConnection

      private void abortConnection()
    • updateConnection

      private void updateConnection(org.postgresql.jdbc.PgConnection pgConnectionIn)