Class CmsUgcSessionQueue

  • public class CmsUgcSessionQueue
    extends java.lang.Object
    A queue used to enforce a certain wait time between requests for sessions for the same form configuration.

    • Constructor Detail

      • CmsUgcSessionQueue

        public CmsUgcSessionQueue​(boolean enabled,
                                  long interval,
                                  int maxLength)
        Creates a new instance.

        enabled - true if the queue should be enabled
        interval - the wait time to use between multiple session requests
        maxLength - the maximum length of the queue
    • Method Detail

      • createQueue

        public static CmsUgcSessionQueue createQueue​(CmsUgcConfiguration config)
        Creates a session queue based on the given configuration.

        config - the configuration for which to create the session queue
        the newly created session queue
      • waitForSlot

        public boolean waitForSlot()
        If there are currently any threads waiting on this queue, wait for the interval given on construction after the currenly last thread stops waiting.

        false if the queue was too long to wait, true otherwise