|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kcb.quartz.ConcurrentJob<MessageDelivery> org.kuali.rice.kcb.quartz.MessageProcessingJob
public class MessageProcessingJob
Job that delivers messages to endpoints. This job is not really stateful, but should not be executed concurrently.
Nested Class Summary | |
---|---|
static class |
MessageProcessingJob.Mode
|
Field Summary | |
---|---|
static String |
GROUP
|
static String |
NAME
|
Fields inherited from class org.kuali.rice.kcb.quartz.ConcurrentJob |
---|
executor, txManager |
Constructor Summary | |
---|---|
MessageProcessingJob()
|
|
MessageProcessingJob(Long messageId,
MessageProcessingJob.Mode mode,
String user,
String cause)
|
Method Summary | |
---|---|
protected Collection<MessageDelivery> |
bulkProcess(BulkMessageDeliverer messageDeliverer,
Collection<MessageDelivery> messageDeliveries,
MessageProcessingJob.Mode mode)
Implements bulk delivery of a collection of MessageDelivery s |
void |
execute(org.quartz.JobExecutionContext context)
|
protected void |
finishProcessing(ProcessingResult<MessageDelivery> result)
Template method called after processing of work items has completed |
protected Collection<Collection<MessageDelivery>> |
groupWorkItems(Collection<MessageDelivery> workItems,
ProcessingResult<MessageDelivery> result)
Group work items by deliverer and notification, so that deliveries to bulk deliverers are grouped by notification |
protected Collection<MessageDelivery> |
process(MessageDeliverer messageDeliverer,
MessageDelivery messageDelivery,
MessageProcessingJob.Mode mode)
Implements delivery of a single MessageDelivery |
protected Collection<MessageDelivery> |
processWorkItems(Collection<MessageDelivery> messageDeliveries)
Template method that subclasses should override to process a given work item and mark it as untaken afterwards |
ProcessingResult<MessageDelivery> |
run()
Main processing method which invokes subclass implementations of template methods to obtain available work items, and process them concurrently |
void |
setGenericDao(GenericDao dao)
Sets the GenericDao |
void |
setMessageDelivererRegistry(MessageDelivererRegistryService registry)
Sets the MessageDelivererRegistryService |
void |
setMessageDeliveryService(MessageDeliveryService messageDeliveryService)
Sets the MessageDeliveryService |
protected Collection<MessageDelivery> |
takeAvailableWorkItems()
Template method that subclasses should override to obtain a set of available work items and mark them as taken |
protected void |
unlockWorkItem(MessageDelivery item)
Template method that subclasses should override to unlock a given work item when procesing has failed. |
protected void |
updateStatusAndUnlock(MessageDelivery messageDelivery,
MessageDeliveryStatus status)
Marks a MessageDelivery as having been delivered, and unlocks it |
Methods inherited from class org.kuali.rice.kcb.quartz.ConcurrentJob |
---|
createNewTransaction, executeInTransaction, setExecutorService, setTransactionManager, unlockWorkItemAtomically |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String NAME
public static final String GROUP
Constructor Detail |
---|
public MessageProcessingJob(Long messageId, MessageProcessingJob.Mode mode, String user, String cause)
public MessageProcessingJob()
Method Detail |
---|
public void setGenericDao(GenericDao dao)
GenericDao
dao
- the GenericDao
public void setMessageDelivererRegistry(MessageDelivererRegistryService registry)
MessageDelivererRegistryService
registry
- the MessageDelivererRegistryService
public void setMessageDeliveryService(MessageDeliveryService messageDeliveryService)
MessageDeliveryService
messageDeliveryService
- the MessageDeliveryService
protected Collection<MessageDelivery> takeAvailableWorkItems()
ConcurrentJob
takeAvailableWorkItems
in class ConcurrentJob<MessageDelivery>
protected void unlockWorkItem(MessageDelivery item)
ConcurrentJob
unlockWorkItem
in class ConcurrentJob<MessageDelivery>
item
- the work item to unlockprotected Collection<Collection<MessageDelivery>> groupWorkItems(Collection<MessageDelivery> workItems, ProcessingResult<MessageDelivery> result)
groupWorkItems
in class ConcurrentJob<MessageDelivery>
workItems
- list of work items to break into groupsresult
- ProcessingResult to modify if there are any failures...this is sort of a hack because previously
failure to obtain a deliverer was considered a work item failure, and now this method has been factored out...
but the tests still want to see the failure
org.kuali.rice.ken.service.impl.ConcurrentJob#groupWorkItems(java.util.Collection)
protected Collection<MessageDelivery> processWorkItems(Collection<MessageDelivery> messageDeliveries)
ConcurrentJob
processWorkItems
in class ConcurrentJob<MessageDelivery>
protected Collection<MessageDelivery> process(MessageDeliverer messageDeliverer, MessageDelivery messageDelivery, MessageProcessingJob.Mode mode)
deliverer
- the deliverermessageDelivery
- the delivery
protected Collection<MessageDelivery> bulkProcess(BulkMessageDeliverer messageDeliverer, Collection<MessageDelivery> messageDeliveries, MessageProcessingJob.Mode mode)
MessageDelivery
s
deliverer
- the deliverermessageDeliveries
- the deliveries
protected void finishProcessing(ProcessingResult<MessageDelivery> result)
ConcurrentJob
finishProcessing
in class ConcurrentJob<MessageDelivery>
protected void updateStatusAndUnlock(MessageDelivery messageDelivery, MessageDeliveryStatus status)
messageDelivery
- the messageDelivery instance to markpublic ProcessingResult<MessageDelivery> run()
ConcurrentJob
run
in class ConcurrentJob<MessageDelivery>
public void execute(org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
execute
in interface org.quartz.Job
org.quartz.JobExecutionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |