Class Executions

  • Direct Known Subclasses:
    ExecutionsCtrl

    public class Executions
    extends java.lang.Object
    Utilities to access Execution.
    Author:
    tomyeh
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.ThreadLocal<Execution> _exec
      Stores the current Execution.
    • Constructor Summary

      Constructors 
      Constructor Description
      Executions()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void activate​(Desktop desktop)
      Activates a thread to allow it access the given desktop synchronously.
      static boolean activate​(Desktop desktop, long timeout)
      Activates a thread to allow it access the given desktop synchronously, or until a certain amount of time has elapsed.
      static Component createComponents​(java.lang.String uri, Component parent, java.util.Map<?,​?> arg)
      Creates components from a page file specified by an URI.
      static Component[] createComponents​(java.lang.String uri, Page page, VariableResolver resolver, java.util.Map<?,​?> arg)
      Creates components that belong to the given page from a page file specified by an URI.
      static Component createComponents​(PageDefinition pagedef, Component parent, java.util.Map<?,​?> arg)
      Creates components based on the specified page definition.
      static Component[] createComponents​(WebApp wapp, java.lang.String uri, java.util.Map<?,​?> arg)
      Creates components that don't belong to any page from a page file specified by an URI.
      static Component[] createComponents​(WebApp wapp, PageDefinition pagedef, java.util.Map<?,​?> arg)
      Creates components that don't belong to any page from the specified page definition.
      static Component createComponentsDirectly​(java.io.Reader reader, java.lang.String extension, Component parent, java.util.Map<?,​?> arg)
      Creates components from the raw content read from the specified reader.
      static Component createComponentsDirectly​(java.lang.String content, java.lang.String extension, Component parent, java.util.Map<?,​?> arg)
      Creates components from the raw content specified by a string.
      static Component createComponentsDirectly​(Document content, java.lang.String extension, Component parent, java.util.Map<?,​?> arg)
      Creates components from the raw content specified by a DOM tree.
      static Component[] createComponentsDirectly​(WebApp wapp, java.io.Reader reader, java.lang.String extension, java.util.Map<?,​?> arg)
      Creates components that don't belong to any page from the raw content read from the specified reader.
      static Component[] createComponentsDirectly​(WebApp wapp, java.lang.String content, java.lang.String extension, java.util.Map<?,​?> arg)
      Creates components that don't belong to any page from the raw content specified by a string.
      static Component[] createComponentsDirectly​(WebApp wapp, Document content, java.lang.String extension, java.util.Map<?,​?> arg)
      Creates components that don't belong to any page from the raw content specified by a DOM tree.
      static void deactivate​(Desktop desktop)
      Deactivates a thread that has invoked activate(org.zkoss.zk.ui.Desktop) successfully.
      static java.net.URL encodeToURL​(java.lang.String uri)
      Encodes the specified URL into an instance of URL.
      static java.lang.String encodeURL​(java.lang.String uri)
      Encodes the specified URL.
      static java.lang.Object evaluate​(Component comp, java.lang.String expr, java.lang.Class expectedType)
      Evaluates the specified expression by use of the current context (getCurrent()).
      static java.lang.Object evaluate​(Page page, java.lang.String expr, java.lang.Class expectedType)
      Evaluates the specified expression with the resolver of the current execution (getCurrent()).
      static void forward​(java.lang.String page)
      A shortcut of Executions.getCurrent().forward(page).
      static Execution getCurrent()
      Returns the current execution.
      static Evaluator getEvaluator​(Component comp, java.lang.Class<? extends ExpressionFactory> expfcls)
      Returns the evaluator of the current execution.
      static Evaluator getEvaluator​(Page page, java.lang.Class<? extends ExpressionFactory> expfcls)
      Returns the evaluator of the current execution.
      static PageDefinition getPageDefinition​(WebApp wapp, java.lang.String uri)
      Returns the page definition from the page file specified by an URI.
      PageDefinition getPageDefinitionDirectly​(WebApp wapp, java.io.Reader reader, java.lang.String extension)
      Reads the raw content from a reader and converts it into a page definition.
      PageDefinition getPageDefinitionDirectly​(WebApp wapp, java.lang.String content, java.lang.String extension)
      Converts the specified page content to a page definition.
      PageDefinition getPageDefinitionDirectly​(WebApp wapp, Document content, java.lang.String extension)
      Converts the specified page content, in DOM, to a page definition.
      static void include​(java.lang.String page)
      A shortcut of Executions.getCurrent().include(page).
      static void notify​(java.lang.Object mutex)
      Wakes up a single event processing thread that is waiting on the specified object.
      static void notify​(Desktop desktop, java.lang.Object mutex)
      Wakes up a single event processing thread for the specified desktop that is waiting on the specified object.
      static void notifyAll​(java.lang.Object mutex)
      Wakes up all event processing thread that are waiting on the specified object.
      static void notifyAll​(Desktop desktop, java.lang.Object mutex)
      Wakes up all event processing threads for the specified desktop that are waiting on the specified object.
      static <T extends Event>
      void
      schedule​(Desktop desktop, EventListener<T> task, T event)
      Schedules a task to run under the server push of the given desktop asynchronously.
      static void sendRedirect​(java.lang.String uri)
      Sends a temporary redirect response to the client using the specified redirect location URL by use of the current execution, getCurrent().
      static void wait​(java.lang.Object mutex)
      Suspends the current processing of an event and wait until the other thread invokes notify(Object), notifyAll(Object), notify(Desktop, Object) or notifyAll(Desktop, Object) for the specified object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait