Package com.suse.coco.attestation
Class ListeningThread
- java.lang.Object
-
- com.suse.coco.attestation.AbstractProcessorThread
-
- com.suse.coco.attestation.ListeningThread
-
- All Implemented Interfaces:
java.lang.Runnable
class ListeningThread extends AbstractProcessorThread
Listener thread of theAttestationQueueProcessor. Waits for the PostgreSQL notifications and notifies theProcessingThreadwhen there is data to process.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.ObjectconnectionLockprivate javax.sql.DataSourcedataSourceprivate booleanforceShutdownprivate static org.apache.logging.log4j.LoggerLOGGERprivate org.postgresql.jdbc.PgConnectionpgConnectionprivate ProcessingThreadprocessingThread
-
Constructor Summary
Constructors Constructor Description ListeningThread(javax.sql.DataSource dataSourceIn)Builds a listener thread
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidabortConnection()voidrun()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 Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
connectionLock
private final java.lang.Object connectionLock
-
dataSource
private final javax.sql.DataSource dataSource
-
forceShutdown
private boolean forceShutdown
-
pgConnection
private org.postgresql.jdbc.PgConnection pgConnection
-
processingThread
private ProcessingThread processingThread
-
-
Method Detail
-
setProcessingThread
public void setProcessingThread(ProcessingThread processingThreadIn)
-
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)
-
-