Class OperationThread

java.lang.Object
java.lang.Thread
org.zkoss.zkex.zul.impl.OperationThread
All Implemented Interfaces:
Runnable

public class OperationThread extends Thread
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
  • Method Details

    • getQueue

      public static OperationQueue getQueue(org.zkoss.zk.ui.Desktop desktop)
      Get the OperationQueue of 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()
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread