Package com.suse.coco.attestation
Class ListeningThread
java.lang.Object
com.suse.coco.attestation.AbstractProcessorThread
com.suse.coco.attestation.ListeningThread
- All Implemented Interfaces:
Runnable
Listener thread of the
AttestationQueueProcessor. Waits for the PostgreSQL notifications and notifies
the ProcessingThread when there is data to process.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Objectprivate final DataSourceprivate booleanprivate static final org.apache.logging.log4j.Loggerprivate org.postgresql.jdbc.PgConnectionprivate ProcessingThread -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidvoidrun()voidsetProcessingThread(ProcessingThread processingThreadIn) voidstart()Starts the processing of the thread.voidstop()Stops the processing of the thread, if it is running.private voidupdateConnection(org.postgresql.jdbc.PgConnection pgConnectionIn) Methods inherited from class com.suse.coco.attestation.AbstractProcessorThread
await, isRunning, setRunning
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
connectionLock
-
dataSource
-
forceShutdown
private boolean forceShutdown -
pgConnection
private org.postgresql.jdbc.PgConnection pgConnection -
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
-
start
public void start()Description copied from class:AbstractProcessorThreadStarts the processing of the thread.- Overrides:
startin classAbstractProcessorThread
-
stop
public void stop()Description copied from class:AbstractProcessorThreadStops the processing of the thread, if it is running.- Overrides:
stopin classAbstractProcessorThread
-
run
public void run() -
abortConnection
private void abortConnection() -
updateConnection
private void updateConnection(org.postgresql.jdbc.PgConnection pgConnectionIn)
-