Package org.godot.utilities.engine
Class EngineThread
- java.lang.Object
-
- java.lang.Thread
-
- org.godot.utilities.engine.EngineThread
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEngineThread.EngineStateEngine thread states-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description EngineThread(@NotNull Engine e)Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcloseAndKill()Kill current threadvoidrun()If this thread was constructed using a separateRunnablerun object, then thatRunnableobject'srunmethod is called; otherwise, this method does nothing and returns.voidsetOnEngineClosingListener(IEngineCallbacks.IEngineClosingCallback callback)Set engine closing listener.voidsetOnEngineStateChangeListener(IEngineCallbacks.IEngineStateChangedCallback callback)Set state changed listenervoidsetOnExecutionDataListener(IEngineCallbacks.IEngineExecutionCallback callback)Set execution listener.voidstart()Causes this thread to begin execution; the Java Virtual Machine calls therunmethod of this thread.voidstart(EngineArgs.Builder args)-
Methods inherited from class 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, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, suspend, toString, yield
-
-
-
-
Method Detail
-
start
public void start()
Causes this thread to begin execution; the Java Virtual Machine calls therunmethod of this thread.The result is that two threads are running concurrently: the current thread (which returns from the call to the
startmethod) and the other thread (which executes itsrunmethod).It is never legal to start a thread more than once. In particular, a thread may not be restarted once it has completed execution.
- Overrides:
startin classThread- Throws:
IllegalThreadStateException- if the thread was already started.- See Also:
run()
-
start
public void start(@NotNull EngineArgs.Builder args)
- Parameters:
args- Engine arguments- See Also:
start()
-
run
public void run()
If this thread was constructed using a separateRunnablerun object, then thatRunnableobject'srunmethod is called; otherwise, this method does nothing and returns.Subclasses of
Threadshould override this method.
-
closeAndKill
public void closeAndKill()
Kill current thread
-
setOnEngineStateChangeListener
public void setOnEngineStateChangeListener(IEngineCallbacks.IEngineStateChangedCallback callback)
Set state changed listener- Parameters:
callback- Target callback
-
setOnExecutionDataListener
public void setOnExecutionDataListener(IEngineCallbacks.IEngineExecutionCallback callback)
Set execution listener.- Parameters:
callback- Target callback
-
setOnEngineClosingListener
public void setOnEngineClosingListener(IEngineCallbacks.IEngineClosingCallback callback)
Set engine closing listener.- Parameters:
callback- Target callback
-
-