Interface Queue


  • @ProviderType
    public interface Queue
    This is a job queue processing job events.
    Since:
    3.0
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      QueueConfiguration getConfiguration()
      Get the corresponding configuration.
      java.lang.String getName()
      Get the queue name.
      java.lang.Object getState​(java.lang.String key)
      For monitoring purposes and possible extensions from the different queue types.
      java.lang.String getStateInfo()
      Return some information about the current state of the queue.
      Statistics getStatistics()
      Return statistics information about this queue.
      boolean isSuspended()
      Is the queue currently suspended?
      void removeAll()
      Remove all outstanding jobs and delete them.
      void resume()
      Resume a suspended queue.
      void suspend()
      Suspend the queue - when a queue is suspended it stops processing jobs - however already started jobs are finished (but not rescheduled).
    • Method Detail

      • getName

        java.lang.String getName()
        Get the queue name.
        Returns:
        The queue name
      • getStatistics

        Statistics getStatistics()
        Return statistics information about this queue.
        Returns:
        The queue statistics
      • getConfiguration

        QueueConfiguration getConfiguration()
        Get the corresponding configuration.
        Returns:
        The queue configuration
      • suspend

        void suspend()
        Suspend the queue - when a queue is suspended it stops processing jobs - however already started jobs are finished (but not rescheduled). Depending on the queue implementation, the queue is only suspended for a specific time. A queue can be resumed with resume().
      • resume

        void resume()
        Resume a suspended queue. suspend(). If the queue is not suspended, calling this method has no effect. Depending on the queue implementation, if a job failed a job queue might sleep for a configured time, before a new job is processed. By calling this method, the job queue can be woken up and force an immediate reprocessing. This feature is only supported by ordered queues at the moment. If a queue does not support this feature, calling this method has only an effect if the queue is really suspended.
      • isSuspended

        boolean isSuspended()
        Is the queue currently suspended?
        Returns:
        {code true} if the queue is supsended
      • removeAll

        void removeAll()
        Remove all outstanding jobs and delete them. This actually cancels all outstanding jobs.
      • getStateInfo

        java.lang.String getStateInfo()
        Return some information about the current state of the queue. This method is meant to see the internal state of the queue for debugging or monitoring purposes.
        Returns:
        Additional state info
      • getState

        java.lang.Object getState​(java.lang.String key)
        For monitoring purposes and possible extensions from the different queue types. This method allows to query state information.
        Parameters:
        key - The key for the state
        Returns:
        The state or null.