Class AbstractSuspendable

java.lang.Object
com.jsql.model.suspendable.AbstractSuspendable
Direct Known Subclasses:
SuspendableGetCharInsertion, SuspendableGetIndexes, SuspendableGetRows, SuspendableGetVendor

public abstract class AbstractSuspendable extends Object
A thread used to inject database ; stoppable and pausable.
  • Field Details

  • Constructor Details

    • AbstractSuspendable

      protected AbstractSuspendable(InjectionModel injectionModel)
  • Method Details

    • run

      public abstract String run(Object... args) throws JSqlException
      The pausable/stoppable action.
      Parameters:
      args -
      Returns:
      Throws:
      JSqlException
    • isSuspended

      public boolean isSuspended()
      Thread's states Pause and Stop are processed by this method.
      - Pause action in infinite loop if invoked while shouldPauseThread is set to true,
      - Return stop state.
      Returns:
      Stop state
    • stop

      public void stop()
      Mark as stopped.
    • pause

      public void pause()
      Mark as paused.
    • unpause

      public void unpause()
      Mark as unpaused.
    • isPaused

      public boolean isPaused()
      Return true if thread is paused, false otherwise.
      Returns:
      Pause state
    • resume

      public void resume()
      Wake threads.