|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.portal.processqueue.QueueManager
public class QueueManager
Manager that executes all interactions with the process queue. Implements
IProcessQueueManager
to execute producing related activities and IProcessQueueManagerSPI
to execute consuming related activities.
Constructor Summary | |
---|---|
QueueManager()
Default constructor. |
Method Summary | |
---|---|
protected QueueTaskProcess |
createQueueItem(IQueueTask task,
String groupId,
String title)
Helper method to create a QueueTaskProcess based on values passed. |
protected QueueTaskProcess |
createQueueItem(IQueueTask task,
String groupId,
String title,
Date scheduledDate)
Helper method to create a QueueTaskProcess based on values passed. |
IQueueTaskProcess |
getNextQueuedItem()
Retrieves the next QueueItem that is queued state or is in scheduled but the scheduled time has already passed and sets its status to InProgress. |
IQueueTaskProcess |
getNextScheduledProcess()
Returns the next scheduled IQueueItem. |
IQueueStatistics |
getQueueStatistics()
Retrieves the current situation statistics of the queue. |
IQueueTaskProcess |
getTaskProcess(String processId)
Retrieves the queue item of represented by the processId. |
void |
removeFromQueue(IQueueTaskProcess item,
boolean notifyListeners)
Removes from queue the current item. |
void |
reprocess(String processId)
Triggers the process to be retried. |
String |
schedule(IQueueTask task,
Date schedule)
Schedules an IQueueTask to be executed at a specific time. |
String |
schedule(IQueueTask task,
Date schedule,
String group,
String title)
Schedules an IQueueTask to be executed at a specific time, in the specified group,
with the informed title. |
String |
send(IQueueTask task)
Sends a IQueueTask to be executed. |
String |
send(IQueueTask task,
String groupId)
Sends a IQueueTask to be executed in within the order of a group. |
String |
send(IQueueTask task,
String groupId,
String title)
Sends an IQueueTask to the queue for a specific group with the given title. |
String |
send(String title,
IQueueTask task)
Sends an IQueueTask to the queue with the given title. |
void |
setFailedStatus(IQueueTaskProcess queueItem)
Sets the given process the status of QueueTaskProcessStatus.Failed . |
void |
waitForQueueReadyToProcess(long timeout)
Informs the thread that is is supposed to wait for a process to enter queue or wait timeout before waking up. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public QueueManager()
Method Detail |
---|
protected QueueTaskProcess createQueueItem(IQueueTask task, String groupId, String title, Date scheduledDate)
QueueTaskProcess
based on values passed.
task
- to be executedgroupId
- to execute task intitle
- to help identify in queuescheduledDate
- target date/time to execute item in.
protected QueueTaskProcess createQueueItem(IQueueTask task, String groupId, String title)
QueueTaskProcess
based on values passed.
task
- to be executedgroupId
- to execute task intitle
- to help identify in queue
public String send(IQueueTask task, String groupId) throws PortalException
IProcessQueueManager
IQueueTask
to be executed in within the order of a group.
send
in interface IProcessQueueManager
task
- to be executed.groupId
- of the group the task should respect the order.
PortalException
public String schedule(IQueueTask task, Date schedule, String group, String title) throws PortalException
IProcessQueueManager
IQueueTask
to be executed at a specific time, in the specified group,
with the informed title.
schedule
in interface IProcessQueueManager
task
- to be executed.schedule
- date/time the task is to be executed.group
- group in which the task should be executed.title
- of the task to help identify it in the queue.
PortalException
public IQueueTaskProcess getTaskProcess(String processId) throws PortalException
IProcessQueueManager
getTaskProcess
in interface IProcessQueueManager
PortalException
public String send(IQueueTask task) throws PortalException
IProcessQueueManager
IQueueTask
to be executed.
send
in interface IProcessQueueManager
task
- to be executed.
PortalException
public String schedule(IQueueTask task, Date schedule) throws PortalException
IProcessQueueManager
IQueueTask
to be executed at a specific time.
schedule
in interface IProcessQueueManager
task
- to be executed.schedule
- date/time the task is to be executed.
PortalException
public IQueueTaskProcess getNextQueuedItem() throws PortalException
IProcessQueueManagerSPI
getNextQueuedItem
in interface IProcessQueueManagerSPI
PortalException
public void removeFromQueue(IQueueTaskProcess item, boolean notifyListeners) throws PortalException
IProcessQueueManagerSPI
removeFromQueue
in interface IProcessQueueManagerSPI
item
- to be removed from queue.notifyListeners
- if the threads should be waken up.
PortalException
public void setFailedStatus(IQueueTaskProcess queueItem) throws PortalException
IProcessQueueManagerSPI
QueueTaskProcessStatus.Failed
.
setFailedStatus
in interface IProcessQueueManagerSPI
queueItem
- item to be put in failed status.
PortalException
public String send(String title, IQueueTask task) throws PortalException
IProcessQueueManager
IQueueTask
to the queue with the given title.
send
in interface IProcessQueueManager
title
- to help identify the process in the queue.task
- to be executed.
PortalException
public String send(IQueueTask task, String groupId, String title) throws PortalException
IProcessQueueManager
IQueueTask
to the queue for a specific group with the given title.
send
in interface IProcessQueueManager
task
- to be executed.groupId
- group in which the task should be executed.title
- of the task to help identify it in the queue.
PortalException
public void waitForQueueReadyToProcess(long timeout) throws InterruptedException
IProcessQueueManagerSPI
waitForQueueReadyToProcess
in interface IProcessQueueManagerSPI
timeout
- max time to wait for a process to enter the queue.
InterruptedException
- when the thread is waken.public IQueueTaskProcess getNextScheduledProcess() throws PortalException
IProcessQueueManagerSPI
getNextScheduledProcess
in interface IProcessQueueManagerSPI
PortalException
public IQueueStatistics getQueueStatistics() throws PortalException
IProcessQueueManager
getQueueStatistics
in interface IProcessQueueManager
PortalException
public void reprocess(String processId) throws PortalException
IProcessQueueManager
reprocess
in interface IProcessQueueManager
processId
- id of the process to be reprocessed.
PortalException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |