Class TaskScheduler

java.lang.Object
java.lang.Thread
bitronix.tm.timer.TaskScheduler
All Implemented Interfaces:
Service, Runnable

public class TaskScheduler extends Thread implements Service
Timed tasks service.
Author:
lorban
  • Constructor Details

    • TaskScheduler

      public TaskScheduler()
  • Method Details

    • countTasksQueued

      public int countTasksQueued()
      Get the amount of tasks currently queued.
      Returns:
      the amount of tasks currently queued.
    • shutdown

      public void shutdown()
      Description copied from interface: Service
      Shutdown the service and free all held resources.
      Specified by:
      shutdown in interface Service
    • scheduleTransactionTimeout

      public void scheduleTransactionTimeout(BitronixTransaction transaction, Date executionTime)
      Schedule a task that will mark the transaction as timed out at the specified date. If this method is called with the same transaction multiple times, the previous timeout date is dropped and replaced by the new one.
      Parameters:
      transaction - the transaction to mark as timeout.
      executionTime - the date at which the transaction must be marked.
    • cancelTransactionTimeout

      public void cancelTransactionTimeout(BitronixTransaction transaction)
      Cancel the task that will mark the transaction as timed out at the specified date.
      Parameters:
      transaction - the transaction to mark as timeout.
    • scheduleRecovery

      public void scheduleRecovery(Recoverer recoverer, Date executionTime)
      Schedule a task that will run background recovery at the specified date.
      Parameters:
      recoverer - the recovery implementation to use.
      executionTime - the date at which the transaction must be marked.
    • cancelRecovery

      public void cancelRecovery(Recoverer recoverer)
      Cancel the task that will run background recovery at the specified date.
      Parameters:
      recoverer - the recovery implementation to use.
    • schedulePoolShrinking

      public void schedulePoolShrinking(XAPool xaPool)
      Schedule a task that will tell a XA pool to close idle connections. The execution time will be provided by the XA pool itself via the XAPool.getNextShrinkDate().
      Parameters:
      xaPool - the XA pool to notify.
    • cancelPoolShrinking

      public void cancelPoolShrinking(XAPool xaPool)
      Cancel the task that will tell a XA pool to close idle connections.
      Parameters:
      xaPool - the XA pool to notify.
    • run

      public void run()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread