Class FormWorkerController

  • All Implemented Interfaces:
    Serializable

    public class FormWorkerController
    extends Object
    implements Serializable
    Provides a Form Worker Controller class to protect access to constrained resources.
    See Also:
    Serialized Form
    • Method Detail

      • getFormWorkerSemaphoreList

        public static List<FormWorkerController> getFormWorkerSemaphoreList()
        Return the list of form worker semaphores for the JVM.
        Returns:
        the list of form worker semaphores for the JVM
      • getFormWorkerController

        public static FormWorkerController getFormWorkerController()
        Return the web application form worker controller instance.
        Returns:
        the web application form worker controller instance
      • releaseSemaphore

        public void releaseSemaphore()
        Release the form worker semaphore.
      • hasFormRenderCapacity

        public boolean hasFormRenderCapacity()
        Return true if semaphore queue is less or equal to than the max_form_worker_queue depth.
        Returns:
        true if semaphore queue is less or equal to than the max_form_worker_queue depth
      • registerNoCapacityEvent

        public void registerNoCapacityEvent()
        Manually register a no capacity event. Use to register FormServer not available events.
      • registerRenderMetric

        public void registerRenderMetric​(Integer renderTime,
                                         Integer loadTime,
                                         Integer totalTime)
        Register the render time, load time and total time rendering metrics.
        Parameters:
        renderTime - the render time (ms)
        loadTime - the browser load time (ms)
        totalTime - the browser load time (ms)
      • getQueueLength

        public int getQueueLength()
        Return the form worker semaphore queue depth.
        Returns:
        the form worker semaphore queue depth.
      • getThreadCount

        public int getThreadCount()
        Return the form worker current thread count (max threads - available permits).
        Returns:
        the form worker current thread count (max threads - available permits)
      • getAndResetNoCapacityEvents

        public int getAndResetNoCapacityEvents()
        Get and reset the number of no capacity events.
        Returns:
        the number of no capacity events
      • getSumRenderMetricAndReset

        public FormWorkerController.RenderMetric getSumRenderMetricAndReset()
        Return the average render metric for the last period and reset.
        Returns:
        the average render metric for the last period and reset.
      • toString

        public String toString()
        Return the string representation of this object.
        Overrides:
        toString in class Object
        Returns:
        the string representation of this object