Interface QueueService
- All Known Implementing Classes:
StandardQueueService
Supported API: true
Extendable: false
-
Method Summary
Modifier and TypeMethodDescriptionaddEntry(ProcessingQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args) Creates a new QueueEntry object corresponding to a processing request.addEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time) Creates a new QueueEntry object corresponding to a processing request.addEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time, StatusInfo statusInfo) Add a schedule entry specifying its status info
Supported API: truevoidaddMultiEntry(ProcessingQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Collection collection) Create and commit multiple Queue entires from a Collection.voidaddMultiEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Collection collection, Timestamp[] sched_time) Create and commit multiple Queue entires from a Collection.addUniqueEntry(ScheduleQueue queue, WTPrincipal princ, String t_method, String t_class, Class[] arg_types, Object[] args, Timestamp sched_time) Deprecated.voiddeleteEntries(List<? extends Persistable> entries) Deletes a List of
Supported API: truevoiddeleteEntries(ProcessingQueue queue) Deletes all entries for the given queue
Supported API: truevoiddeleteEntries(ProcessingQueue queue, String status_code) Deletes all entries that have the status code specified.voiddeleteEntries(ScheduleQueue queue) Deletes all entries for the given queue QUEUE_ENTRY_DELETE event is emmited
Supported API: truevoiddeleteEntries(ScheduleQueue queue, String status_code) Deletes all entries that have the status code specified.voiddeleteEntry(wt.queue.QueueInfo qi, wt.queue.QueueEntryInfo qei) Delete a queue entry
Supported API: truevoiddeleteEntry(WtQueue queue, WtQueueEntry queueEntry) Delete a queue entry
Supported API: trueenableThreadPoolExecution(WtQueue queue) Enables thread pool execution for this queue (and saves the change to the database).enableThreadPoolExecution(WtQueue queue, boolean value) Enables or disables thread pool execution for this queue (and saves the change to the database).voidexecEntries(ProcessingQueue queue) Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.voidexecEntries(ScheduleQueue queue) Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.execEntry(ProcessingQueue queue, WtQueueEntry entry) Executes a the queue entry passed as argument.execEntry(ScheduleQueue queue, WtQueueEntry entry) Executes a the queue entry passed as argument.Return a queue with the given name
Supported API: trueReturn a queue with the given name and type
Supported API: truebooleanhasItems(ProcessingQueue queue, String[] statuses) The method checks if there exist at least one queue entry with one of the specified statuses.queueEntries(ProcessingQueue queue) Returns all queue entries as an enumeration for the given queue
Supported API: truequeueEntries(ProcessingQueue queue, String status_code) Returns all queue entries that with the given state for the specified queue
Supported API: truequeueEntries(ProcessingQueue queue, Vector status_codes) Returns all queue entries that with the given state for the specified queue
Supported API: truequeueEntries(ScheduleQueue queue) Returns all queue entries as an enumeration for the given queue
Supported API: truequeueEntries(ScheduleQueue queue, String status_code) Returns all queue entries that with the given state for the specified queue
Supported API: truevoidresetQueueEntry(ProcessingQueue queue, String entry_num) Resets the specified queue entry to the ready state
Supported API: truevoidresetQueueEntry(ScheduleQueue queue, String entry_num) Resets the specified queue entry to the ready state
Supported API: trueupdateQueueEntry(WtQueue queue, wt.queue.UpdateEntry entryInfo) Update a queue entries status (only)
Supported API: trueupdateQueueEntry(WtQueue queue, WtQueueEntry newEntryState) Update a queue entry Supports updating the status and scheduled execution time (for schedule queues)
Supported API: true
-
Method Details
-
getQueue
Return a queue with the given name
Supported API: true- Parameters:
queue_name-- Returns:
- ProcessingQueue
- Throws:
WTException
-
getQueue
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
Executes a the queue entry passed as argument.
Supported API: true- Parameters:
entry-- Returns:
- WtQueueEntry
- Throws:
WTException
-
execEntry
Executes a the queue entry passed as argument.
Supported API: true- Parameters:
entry-- Returns:
- WtQueueEntry
- Throws:
WTException
-
execEntries
Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.
Supported API: true- Throws:
WTException
-
execEntries
Execute all queue entries in the 'READY' state, in the increasing order of their 'entryNumbers'.
Supported API: true- Throws:
WTException
-
hasItems
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
Deletes all entries for the given queue
Supported API: true- Parameters:
queue-- Throws:
WTException
-
deleteEntries
Deletes all entries for the given queue QUEUE_ENTRY_DELETE event is emmited
Supported API: true- Parameters:
queue-- Throws:
WTException
-
deleteEntries
Deletes a List of
Supported API: true- Parameters:
queue-- Throws:
WTException
-
deleteEntries
Deletes all entries that have the status code specified. for the given queue
Supported API: true- Parameters:
queue-status_code-- Throws:
WTException
-
deleteEntries
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
Returns all queue entries as an enumeration for the given queue
Supported API: true- Parameters:
queue-- Returns:
- Enumeration
- Throws:
WTException
-
queueEntries
Returns all queue entries as an enumeration for the given queue
Supported API: true- Parameters:
queue-- Returns:
- Enumeration
- Throws:
WTException
-
queueEntries
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
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
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
Resets the specified queue entry to the ready state
Supported API: true- Parameters:
queue-entry_num-- Throws:
WTException
-
resetQueueEntry
Resets the specified queue entry to the ready state
Supported API: true- Parameters:
queue-entry_num-- Throws:
WTException
-
deleteEntry
Delete a queue entry
Supported API: true- Parameters:
qi-qei-- Throws:
WTException
-
deleteEntry
Delete a queue entry
Supported API: true- Parameters:
queue-queueEntry-- Throws:
WTException
-
updateQueueEntry
Update a queue entries status (only)
Supported API: true- Parameters:
queue-entryInfo-- Returns:
- WtQueueEntry
- Throws:
WTException
-
updateQueueEntry
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
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 aScheduleQueuewill 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
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 aScheduleQueuewill 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 forvalue- Boolean to enable or disable usage of pool execution- Returns:
- WtQueue
- Throws:
WTException
-