Class AsynchronousViewLifecycleProcessor

java.lang.Object
org.kuali.rice.krad.uif.lifecycle.ViewLifecycleProcessorBase
org.kuali.rice.krad.uif.lifecycle.AsynchronousViewLifecycleProcessor
All Implemented Interfaces:
ViewLifecycleProcessor

public final class AsynchronousViewLifecycleProcessor extends ViewLifecycleProcessorBase
Static utility class for handling executor configuration and spreading ViewLifecycle across multiple threads.
Author:
Kuali Rice Team (rice.collab@kuali.org)
  • Method Details

    • getMinThreads

      public static int getMinThreads()
      Gets the minimum number of lifecycle worker threads to maintain.

      This value is controlled by the configuration parameter "krad.uif.lifecycle.asynchronous.minThreads".

      Returns:
      minimum number of worker threads to maintain
    • getMaxThreads

      public static int getMaxThreads()
      Gets the maximum number of lifecycle worker threads to maintain.

      This value is controlled by the configuration parameter "krad.uif.lifecycle.asynchronous.maxThreads".

      Returns:
      maximum number of worker threads to maintain
    • getTimeout

      public static long getTimeout()
      Gets the time, in milliseconds, to wait for a initial phase to process.

      This value is controlled by the configuration parameter "krad.uif.lifecycle.asynchronous.timeout".

      Returns:
      time in milliseconds to wait for the initial phase to process
    • getActivePhase

      public ViewLifecyclePhase getActivePhase()
      Gets the phase actively being processing on the current thread.
      Returns:
      lifecycle phase active on the current thread
    • getRenderingContext

      public LifecycleRenderingContext getRenderingContext()
      Gets a thread-local rending context for invoking FreeMarker operations on the current thread.
      Returns:
      rending context for invoking FreeMarker operations on the current thread
    • getExpressionEvaluator

      public ExpressionEvaluator getExpressionEvaluator()
      Returns an instance of ExpressionEvaluator that can be used for evaluating expressions contained on the view.

      A ExpressionEvaluator must be initialized with a model for expression evaluation. One instance is constructed for the view lifecycle and made available to all components/helpers through this method

      Returns:
      instance of ExpressionEvaluator
    • pushPendingPhase

      public void pushPendingPhase(ViewLifecyclePhase phase)
      Pushes lifecycle phases to be processed within the lifecycle associated with this processor.

      A phase submitted using this method will be added to the front of the queue, to be processed by the next available processor.

      Parameters:
      phase - The phase to be processed within the lifecycle associated with this processor.
    • offerPendingPhase

      public void offerPendingPhase(ViewLifecyclePhase phase)
      Queues a lifecycle phase to be processed within the lifecycle associated with this processor.

      A phase submitted using this method will be added to the end of the queue, to be processed after all other phases currently in the queue have been submitted.

      Parameters:
      phase - The phase to be processed within the lifecycle associated with this processor.
    • performPhase

      public void performPhase(ViewLifecyclePhase initialPhase)
      Performs a lifecycle phase according to this processor's semantics, blocking until the phase has been completely processed. Once the initial phase has been completely processed, this method will return.

      This method should only be called a single time by the controlling thread in order to wait for all pending phases to be performed, and should not be called by any worker threads.

      Parameters:
      initialPhase - The initial lifecycle phase