Package org.zkoss.zkex.zul.impl
Class OperationThread
java.lang.Object
java.lang.Thread
org.zkoss.zkex.zul.impl.OperationThread
- All Implemented Interfaces:
Runnable
This class is for model sharer developer only, you rarely need to use this class.
Available in ZK PE and ZK EE.
OperationThread has only one instance in each desktop, it store it-self in the desktop by setAttribute.
It create and monitor the OperationQueue, if there are any operation in queue, it will consume it.
- Since:
- 3.0.0
- Author:
- Dennis.Chen
-
Nested Class Summary
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddestroyWith(org.zkoss.zk.ui.Desktop desktop) Terminate a OperationThread which is stored in desktop and clear it.static OperationQueuegetQueue(org.zkoss.zk.ui.Desktop desktop) Get theOperationQueueof OperationThread, It is check is there any OperationThread exist in desktop.booleanIs this thread still runningvoidrun()voidTerminate this thread. thread will be stopped after last run trip.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, start, stop, suspend, toString, yield
-
Method Details
-
getQueue
Get theOperationQueueof OperationThread, It is check is there any OperationThread exist in desktop. If no, create one ,start it and store in desktop, then return thread's operation queue. If yes, return operation queue directly. There is only one OperationThread in each desktop.- Parameters:
desktop- the associated desktop- Returns:
- a queue which associate to desktop
-
destroyWith
public static void destroyWith(org.zkoss.zk.ui.Desktop desktop) Terminate a OperationThread which is stored in desktop and clear it.- Parameters:
desktop- the associated desktop
-
isRunning
public boolean isRunning()Is this thread still running- Returns:
- true is thread still running
-
terminate
public void terminate()Terminate this thread. thread will be stopped after last run trip. -
run
public void run()
-