类 AbandonedConnectionCleanupThread
- java.lang.Object
-
- com.mysql.cj.jdbc.AbandonedConnectionCleanupThread
-
- 所有已实现的接口:
Runnable
public class AbandonedConnectionCleanupThread extends Object implements Runnable
This class implements a thread that is responsible for closing abandoned MySQL connections, i.e., connections that are not explicitly closed. There is only one instance of this class and there is a single thread to do this task. This thread's executor is statically referenced in this same class.
-
-
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 static voidcheckedShutdown()Performs a checked shutdown, i.e., the context ClassLoaders from this and the caller thread are checked for consistency prior to performing the shutdown operation.static booleanisAlive()Returns true if the working thread is alive.voidrun()protected static voidtrackConnection(MysqlConnection conn, NetworkResources io)Tracks the finalization of aMysqlConnectionobject and keeps a reference to itsNetworkResourcesso that they can be later released.static voiduncheckedShutdown()Performs an unchecked shutdown, i.e., the shutdown is performed independently of the context ClassLoaders from the involved threads.
-
-
-
方法详细资料
-
checkedShutdown
public static void checkedShutdown()
Performs a checked shutdown, i.e., the context ClassLoaders from this and the caller thread are checked for consistency prior to performing the shutdown operation.
-
uncheckedShutdown
public static void uncheckedShutdown()
Performs an unchecked shutdown, i.e., the shutdown is performed independently of the context ClassLoaders from the involved threads.
-
isAlive
public static boolean isAlive()
Returns true if the working thread is alive. It is alive if it was initialized successfully and wasn't shutdown yet.- 返回:
- true if the working thread is alive; false otherwise.
-
trackConnection
protected static void trackConnection(MysqlConnection conn, NetworkResources io)
Tracks the finalization of aMysqlConnectionobject and keeps a reference to itsNetworkResourcesso that they can be later released.- 参数:
conn- the Connection object to track for finalizationio- the network resources to close on the connection finalization
-
-