类 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.
    • 方法详细资料

      • run

        public void run()
        指定者:
        run 在接口中 Runnable
      • 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 a MysqlConnection object and keeps a reference to its NetworkResources so that they can be later released.
        参数:
        conn - the Connection object to track for finalization
        io - the network resources to close on the connection finalization