Package eu.hobbydev.bracheus.manager
Klasse ListenerThreadManager
java.lang.Object
java.lang.Thread
eu.hobbydev.bracheus.manager.ListenerThreadManager
- Alle implementierten Schnittstellen:
HumanizerTools,Runnable
The ListenerThreadManager class is responsible for managing and executing listeners in a separate thread.
This class extends the Thread class and continuously checks each registered listener at regular intervals.
The listeners perform specific checks and actions as defined by their implementation.
The thread can be stopped gracefully by calling the stopManager method, which halts the thread's execution.
-
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
KonstruktorenKonstruktorBeschreibungListenerThreadManager(SeleniumManager seleniumManager) Constructs a new ListenerThreadManager with the specified SeleniumManager. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddListener(Listener listener) Adds a listener to the list of listeners.Returns the SeleniumManager instance associated with this ListenerThreadManager.voidrun()Runs the thread that continuously checks each registered listener.voidStops the listener thread 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, yieldVon Klasse geerbte Methoden java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitVon Schnittstelle geerbte Methoden eu.hobbydev.bracheus.utils.HumanizerTools
checkingActionQueue, inputDelay, siteDelay
-
Konstruktordetails
-
ListenerThreadManager
Constructs a new ListenerThreadManager with the specified SeleniumManager. This manager will handle the execution of the listeners.- Parameter:
seleniumManager- the SeleniumManager instance that may be used for actions within the listeners.
-
-
Methodendetails
-
addListener
Adds a listener to the list of listeners. This method is synchronized to ensure thread-safety when adding listeners.- Parameter:
listener- the listener to be added to the list.
-
stopManager
public void stopManager()Stops the listener thread by setting the running flag to false and interrupting the thread. This will terminate the execution of the listener checks. -
run
public void run()Runs the thread that continuously checks each registered listener. It invokes theListener.runCheckup()method for each listener and waits for a defined period before repeating. If no listeners are registered, the thread will wait for 30 seconds before checking again. -
getSeleniumManager
Returns the SeleniumManager instance associated with this ListenerThreadManager.- Gibt zurück:
- the SeleniumManager instance used for handling listener.
-