Package eu.hobbydev.bracheus.manager
Klasse ActionThreadManager
java.lang.Object
java.lang.Thread
eu.hobbydev.bracheus.manager.ActionThreadManager
- Alle implementierten Schnittstellen:
Runnable
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.
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Feldübersicht
Von Klasse geerbte Felder java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungActionThreadManager(SeleniumManager seleniumManager) Constructs a new ActionThreadManager with the given SeleniumManager. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanReturns the SeleniumManager instance associated with this ActionThreadManager.voidregisterActions(Actions action) Registers an action to be processed by the thread.voidrun()Runs the thread that continuously processes actions from the action queue.intsize()Returns the size() of actionsvoidStops the thread from running by setting the running flag to false and interrupting the thread.Von Klasse geerbte Methoden java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, toString, yield
-
Konstruktordetails
-
ActionThreadManager
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 itsActions.handleAction()method. The thread continues to run until the stopThread method is called. -
stopThread
public void stopThread()Stops the thread from running by setting the running flag to false and interrupting the thread. -
registerActions
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
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()
-