public final class JRebirthThread extends Thread implements ConcurrentMessages
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
private JRebirthApplication<?> |
application
The javaFX application that launch this thread.
|
private GlobalFacade |
facade
The Global Facade object that handle other sub facade.
|
private AtomicBoolean |
forceClose
Flag that indicate that the closure must be forced.
|
private AtomicBoolean |
hasStarted
Flag indicating that current thread has started and is ready to process events.
|
private AtomicBoolean |
infiniteLoop
Flag to stop the infinite loop that process JRebirth Events.
|
private static JRebirthThread |
internalThread
The unique instance of the current class.
|
static String |
JIT_NAME
The JRebirth Internal Thread name [JIT].
|
private static JRLogger |
LOGGER
The class logger.
|
private PriorityBlockingQueue<JRebirthRunnable> |
processingTasks
The list of tasks being processed, all access MUST BE synchronized.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYBOOT_UP_ERROR, FUTURE_DONE, HPTP_QUEUED, JIT_ERROR, JTP_ERROR, JTP_ERROR_EXPLANATION, JTP_QUEUED, RUN_IT, SHUTDOWN_ERROR, THREAD_ERROR| Modifier | Constructor and Description |
|---|---|
private |
JRebirthThread()
private final boolean readyToShutdown = false;
/** Build the JRebirth Thread.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bootUp()
Attach the first view and run pre and post command.
|
void |
close()
This method can be called a lot of time while application is running.
|
private static void |
destroyInstance()
Destroy the singleton that hold the thread.
|
JRebirthApplication<?> |
getApplication() |
GlobalFacade |
getFacade() |
protected Wave |
getLaunchFirstViewWave()
Launch the first view by adding it into the root node.
|
static JRebirthThread |
getThread()
Return the JRebirthThread used to manage facades and waves.
|
boolean |
hasStarted()
Return true if JRebirth has been correctly started (boot action is done).
|
void |
interrupt() |
private void |
manageStyleSheetReloading(Scene scene)
Manage style sheet reloading by using a custom service provide by JRebirth Core.
|
void |
prepare(JRebirthApplication<?> application)
Launch the JRebirth thread.
|
void |
run() |
void |
runIntoJTP(JRebirthRunnable runnable)
Run into thread pool.
|
void |
runLater(JRebirthRunnable runnable)
Run this task as soon as possible.
|
private void |
shutdown()
Release all resources.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic static final String JIT_NAME
private static final JRLogger LOGGER
private static JRebirthThread internalThread
private transient GlobalFacade facade
private transient JRebirthApplication<?> application
private final PriorityBlockingQueue<JRebirthRunnable> processingTasks
private final AtomicBoolean hasStarted
private final AtomicBoolean infiniteLoop
private final AtomicBoolean forceClose
private JRebirthThread()
public void runIntoJTP(JRebirthRunnable runnable)
runnable - the task to runpublic void runLater(JRebirthRunnable runnable)
runnable - the task to runpublic void prepare(JRebirthApplication<?> application)
application - the javaFX application instancepublic boolean hasStarted()
private void manageStyleSheetReloading(Scene scene)
scene - the scene to reload in case of Style Sheet updatepublic void bootUp()
throws JRebirthThreadException
JRebirthThreadException - if a problem occurred while calling the commandpublic void close()
private void shutdown()
private static void destroyInstance()
protected Wave getLaunchFirstViewWave()
public JRebirthApplication<?> getApplication()
public GlobalFacade getFacade()
public static JRebirthThread getThread()
Copyright © 2011–2014 JRebirth OSS. All rights reserved.