Klasse ActionThreadManager

java.lang.Object
java.lang.Thread
eu.hobbydev.bracheus.manager.ActionThreadManager
Alle implementierten Schnittstellen:
Runnable

public class ActionThreadManager extends Thread
The ActionThreadManager class is responsible for managing and executing actions in a separate thread. It processes actions from a queue and handles them using the provided SeleniumManager instance. This class extends the Thread class to run in the background, processing actions asynchronously.

It supports action registration and ensures thread-safe interaction with the action queue. The thread can be stopped by invoking the stopThread method, which safely terminates the running thread.

  • Konstruktordetails

    • ActionThreadManager

      public ActionThreadManager(SeleniumManager seleniumManager)
      Constructs a new ActionThreadManager with the given SeleniumManager.
      Parameter:
      seleniumManager - the SeleniumManager instance that will be used to handle actions.
  • Methodendetails

    • run

      public void run()
      Runs the thread that continuously processes actions from the action queue. Each action is handled by calling its Actions.handleAction() method. The thread continues to run until the stopThread method is called.
      Angegeben von:
      run in Schnittstelle Runnable
      Setzt außer Kraft:
      run in Klasse Thread
    • stopThread

      public void stopThread()
      Stops the thread from running by setting the running flag to false and interrupting the thread.
    • registerActions

      public void registerActions(Actions action)
      Registers an action to be processed by the thread. The action is added to the action queue. If the thread is interrupted while adding the action to the queue, the interrupt status is preserved.
      Parameter:
      action - the action to be registered.
    • getSeleniumManager

      public SeleniumManager getSeleniumManager()
      Returns the SeleniumManager instance associated with this ActionThreadManager.
      Gibt zurück:
      the SeleniumManager instance used for handling actions.
    • size

      public int size()
      Returns the size() of actions
      Gibt zurück:
      size() of actions
    • getIsHandeling

      public boolean getIsHandeling()