Package wt.queue

Interface QueueService

All Known Implementing Classes:
StandardQueueService

@RemoteInterface public interface QueueService
Interface containing the methods supported by the queue service implementations. Methods allow the creation, starting, stopping, deleting and customizing queue execution.

Supported API: true

Extendable: false
  • Method Details

    • getQueue

      ProcessingQueue getQueue(String queue_name) throws WTException
      Return a queue with the given name

      Supported API: true
      Parameters:
      queue_name -
      Returns:
      ProcessingQueue
      Throws:
      WTException
    • getQueue

      WtQueue getQueue(String queue_name, Class queue_type) throws WTException
      Return a queue with the given name and type

      Supported API: true
      Parameters:
      queue_name -
      queue_type -
      Returns:
      WtQueue
      Throws:
      WTException
    • addEntry

      QueueEntry addEntry(ProcessingQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args) throws WTException
      Creates a new QueueEntry object corresponding to a processing request.

      Supported API: true
      Parameters:
      queue -
      princ -
      t_method -
      t_class -
      arg_types -
      args -
      Returns:
      QueueEntry
      Throws:
      WTException
    • execEntry

      WtQueueEntry execEntry(ProcessingQueue queue, WtQueueEntry entry) throws WTException
      Executes a the queue entry passed as argument.

      Supported API: true
      Parameters:
      entry -
      Returns:
      WtQueueEntry
      Throws:
      WTException
    • execEntry

      WtQueueEntry execEntry(ScheduleQueue queue, WtQueueEntry entry) throws WTException
      Executes a the queue entry passed as argument.

      Supported API: true
      Parameters:
      entry -
      Returns:
      WtQueueEntry
      Throws:
      WTException
    • execEntries

      void execEntries(ProcessingQueue queue) throws WTException
      Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.

      Supported API: true
      Throws:
      WTException
    • execEntries

      void execEntries(ScheduleQueue queue) throws WTException
      Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.

      Supported API: true
      Throws:
      WTException
    • hasItems

      boolean hasItems(ProcessingQueue queue, String[] statuses) throws WTException
      The method checks if there exist at least one queue entry with one of the specified statuses.

      Supported API: true
      Parameters:
      statuses - List of statuses to consider. Constants from StatusInfo class.
      Returns:
      boolean
      Throws:
      WTException
    • addMultiEntry

      void addMultiEntry(ProcessingQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Collection collection) throws WTException
      Create and commit multiple Queue entires from a Collection. All entries are batch commited. The arg_types is used to define the type of arguments and number of entries to be created from the Collection. The collection itself will contain one or more sets of these arguments. This method will iterate through the collection creating multiple queue entires each containing the number and type of arguments specified in arg_types. If the number of values in the collection is not evenly divisiable by the number of types (in arg_types) a WTException will be thrown.

      Supported API: true
      Parameters:
      queue -
      princ -
      t_method -
      t_class -
      arg_types -
      collection -
      Throws:
      WTException
    • addUniqueEntry

      @Deprecated ScheduleQueueEntry addUniqueEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time) throws WTException
      Deprecated.
      Add a Queue entry with the given method invalid input: '&' class signature if one does not exist. Note this method doesn't tell us anything about whether more than one entry exists with the specified method invalid input: '&' class signature

      Supported API: true
      Parameters:
      queue -
      princ -
      t_method -
      t_class -
      arg_types -
      args -
      sched_time -
      Returns:
      Throws:
      WTException
    • addEntry

      ScheduleQueueEntry addEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time) throws WTException
      Creates a new QueueEntry object corresponding to a processing request.

      Supported API: true
      Parameters:
      queue -
      princ -
      t_method -
      t_class -
      arg_types -
      args -
      sched_time -
      Returns:
      ScheduleQueueEntry
      Throws:
      WTException
    • addEntry

      ScheduleQueueEntry addEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time, StatusInfo statusInfo) throws WTException
      Add a schedule entry specifying its status info

      Supported API: true
      Parameters:
      princ -
      t_method -
      t_class -
      arg_types -
      args -
      sched_time -
      statusInfo -
      Returns:
      Throws:
      WTException
    • addMultiEntry

      void addMultiEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Collection collection, Timestamp[] sched_time) throws WTException
      Create and commit multiple Queue entires from a Collection. All entries are batch commited. The arg_types is used to define the type of arguments and number of entries to be created from the Collection. The collection itself will contain one or more sets of these arguments. This method will iterate through the collection creating multiple queue entires each containing the number and type of arguments specified in arg_types. If the number of values in the collection is not evenly divisiable by the number of types (in arg_types) a WTException will be thrown. An array of Timestamp(s) is provides such that each entry may be scheduled at a different time

      Supported API: true
      Parameters:
      queue -
      princ -
      t_method -
      t_class -
      arg_types -
      collection -
      sched_time -
      Throws:
      WTException
    • deleteEntries

      void deleteEntries(ProcessingQueue queue) throws WTException
      Deletes all entries for the given queue

      Supported API: true
      Parameters:
      queue -
      Throws:
      WTException
    • deleteEntries

      void deleteEntries(ScheduleQueue queue) throws WTException
      Deletes all entries for the given queue QUEUE_ENTRY_DELETE event is emmited

      Supported API: true
      Parameters:
      queue -
      Throws:
      WTException
    • deleteEntries

      void deleteEntries(List<? extends Persistable> entries) throws WTException
      Deletes a List of

      Supported API: true
      Parameters:
      queue -
      Throws:
      WTException
    • deleteEntries

      void deleteEntries(ProcessingQueue queue, String status_code) throws WTException
      Deletes all entries that have the status code specified. for the given queue

      Supported API: true
      Parameters:
      queue -
      status_code -
      Throws:
      WTException
    • deleteEntries

      void deleteEntries(ScheduleQueue queue, String status_code) throws WTException
      Deletes all entries that have the status code specified. for the given queue QUEUE_ENTRY_DELETE event is emitted. ImmutableQueueException is thrown if attempt made to delete entry from Immutable queue.

      Supported API: true
      Parameters:
      queue -
      status_code -
      Throws:
      WTException
    • queueEntries

      Enumeration queueEntries(ProcessingQueue queue) throws WTException
      Returns all queue entries as an enumeration for the given queue

      Supported API: true
      Parameters:
      queue -
      Returns:
      Enumeration
      Throws:
      WTException
    • queueEntries

      Enumeration queueEntries(ScheduleQueue queue) throws WTException
      Returns all queue entries as an enumeration for the given queue

      Supported API: true
      Parameters:
      queue -
      Returns:
      Enumeration
      Throws:
      WTException
    • queueEntries

      Enumeration queueEntries(ProcessingQueue queue, String status_code) throws WTException
      Returns all queue entries that with the given state for the specified queue

      Supported API: true
      Parameters:
      queue -
      status_code -
      Returns:
      Enumeration
      Throws:
      WTException
    • queueEntries

      Enumeration queueEntries(ProcessingQueue queue, Vector status_codes) throws WTException
      Returns all queue entries that with the given state for the specified queue

      Supported API: true
      Parameters:
      queue -
      status_codes -
      Returns:
      Enumeration
      Throws:
      WTException
    • queueEntries

      Enumeration queueEntries(ScheduleQueue queue, String status_code) throws WTException
      Returns all queue entries that with the given state for the specified queue

      Supported API: true
      Parameters:
      queue -
      status_code -
      Returns:
      Enumeration
      Throws:
      WTException
    • resetQueueEntry

      void resetQueueEntry(ProcessingQueue queue, String entry_num) throws WTException
      Resets the specified queue entry to the ready state

      Supported API: true
      Parameters:
      queue -
      entry_num -
      Throws:
      WTException
    • resetQueueEntry

      void resetQueueEntry(ScheduleQueue queue, String entry_num) throws WTException
      Resets the specified queue entry to the ready state

      Supported API: true
      Parameters:
      queue -
      entry_num -
      Throws:
      WTException
    • deleteEntry

      void deleteEntry(wt.queue.QueueInfo qi, wt.queue.QueueEntryInfo qei) throws WTException
      Delete a queue entry

      Supported API: true
      Parameters:
      qi -
      qei -
      Throws:
      WTException
    • deleteEntry

      void deleteEntry(WtQueue queue, WtQueueEntry queueEntry) throws WTException
      Delete a queue entry

      Supported API: true
      Parameters:
      queue -
      queueEntry -
      Throws:
      WTException
    • updateQueueEntry

      WtQueueEntry updateQueueEntry(WtQueue queue, wt.queue.UpdateEntry entryInfo) throws WTException
      Update a queue entries status (only)

      Supported API: true
      Parameters:
      queue -
      entryInfo -
      Returns:
      WtQueueEntry
      Throws:
      WTException
    • updateQueueEntry

      WtQueueEntry updateQueueEntry(WtQueue queue, WtQueueEntry newEntryState) throws WTException
      Update a queue entry Supports updating the status and scheduled execution time (for schedule queues)

      Supported API: true
      Parameters:
      queue -
      entryInfo -
      Returns:
      WtQueueEntry
      Throws:
      WTException
    • enableThreadPoolExecution

      WtQueue enableThreadPoolExecution(WtQueue queue) throws WTException
      Enables thread pool execution for this queue (and saves the change to the database).

      This is currently only supported for ProcessingQueues. Calling this method with a ScheduleQueue will result in an exception.

      When thread pool execution is enabled for a queue, there is no guaranteed order of entry execution. Rather than being first-in, first-out, the queue will execute on a less strict first-in, first-priority basis. In return, multiple threads (and multiple method servers) may execute entries in parallel for higher throughput.

      Tuning of pool execution is necessary for optimal performance. One can control the thread pool size for a given queue via wt.queue.PoolQueue.QueueName.threadPoolSize in wt.properties, where the default is the value of wt.queue.execEntriesCount.

      Customization code should never call this method with an out-of-the-box (non-custom) queue as an argument. Doing this is completely unsupported and could lead to serious data integrity issues.

      Supported API: true

      Parameters:
      queue - Queue to enable thread pool execution for
      Returns:
      WtQueue
      Throws:
      WTException
    • enableThreadPoolExecution

      WtQueue enableThreadPoolExecution(WtQueue queue, boolean value) throws WTException
      Enables or disables thread pool execution for this queue (and saves the change to the database).

      This is currently only supported for ProcessingQueues. Calling this method with a ScheduleQueue will result in an exception.

      When thread pool execution is enabled for a queue, there is no guaranteed order of entry execution. Rather than being first-in, first-out, the queue will execute on a less strict first-in, first-priority basis. In return, multiple threads (and multiple method servers) may execute entries in parallel for higher throughput.

      Tuning of pool execution is necessary for optimal performance. One can control the thread pool size for a given queue via wt.queue.PoolQueue.QueueName.threadPoolSize in wt.properties, where the default is the value of wt.queue.execEntriesCount.

      Customization code should never call this method with an out-of-the-box (non-custom) queue as an argument. Doing this is completely unsupported and could lead to serious data integrity issues.

      Supported API: true

      Parameters:
      queue - Queue to enable thread pool execution for
      value - Boolean to enable or disable usage of pool execution
      Returns:
      WtQueue
      Throws:
      WTException