Top Description Fields Constructors Methods
org.h2.engine

pack-priv Class DelayedDatabaseCloser

extends Thread
Class Inheritance
Imports
java.lang.ref.WeakReference, org.h2.message.Trace

This class is responsible to close a database after the specified delay. A database closer object only exists if there is no user connected to the database.

Field Summary

Modifier and TypeField and Description
private volatile WeakReference<Database>
private int
private final Trace
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
pack-priv
DelayedDatabaseCloser(Database db, int delayInMillis)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
reset()

Stop and disable the database closer.

public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

databaseRefback to summary
private volatile WeakReference<Database> databaseRef
delayInMillisback to summary
private int delayInMillis
traceback to summary
private final Trace trace

Constructor Detail

DelayedDatabaseCloserback to summary
pack-priv DelayedDatabaseCloser(Database db, int delayInMillis)

Method Detail

resetback to summary
pack-priv void reset()

Stop and disable the database closer. This method is called after a session has been created.

runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override