public class MessageProcessingJob extends ConcurrentJob<MessageDelivery> implements org.quartz.StatefulJob
| Modifier and Type | Class and Description |
|---|---|
static class |
MessageProcessingJob.Mode |
| Modifier and Type | Field and Description |
|---|---|
static String |
GROUP |
static String |
NAME |
executor, txManager| Constructor and Description |
|---|
MessageProcessingJob() |
MessageProcessingJob(Long messageId,
MessageProcessingJob.Mode mode,
String user,
String cause) |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<MessageDelivery> |
bulkProcess(BulkMessageDeliverer messageDeliverer,
Collection<MessageDelivery> messageDeliveries,
MessageProcessingJob.Mode mode)
Implements bulk delivery of a collection of
MessageDeliverys |
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 |
setDataObjectService(DataObjectService dataObjectService)
Sets the
DataObjectService |
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
|
createNewTransaction, executeInTransaction, setExecutorService, setTransactionManager, unlockWorkItemAtomicallypublic static final String NAME
public static final String GROUP
public MessageProcessingJob(Long messageId, MessageProcessingJob.Mode mode, String user, String cause)
public MessageProcessingJob()
public void setDataObjectService(DataObjectService dataObjectService)
DataObjectServicedataObjectService - the DataObjectServicepublic void setMessageDelivererRegistry(MessageDelivererRegistryService registry)
MessageDelivererRegistryServiceregistry - the MessageDelivererRegistryServicepublic void setMessageDeliveryService(MessageDeliveryService messageDeliveryService)
MessageDeliveryServicemessageDeliveryService - the MessageDeliveryServiceprotected Collection<MessageDelivery> takeAvailableWorkItems()
ConcurrentJobtakeAvailableWorkItems in class ConcurrentJob<MessageDelivery>protected void unlockWorkItem(MessageDelivery item)
ConcurrentJobunlockWorkItem 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 failureorg.kuali.rice.ken.service.impl.ConcurrentJob#groupWorkItems(java.util.Collection)protected Collection<MessageDelivery> processWorkItems(Collection<MessageDelivery> messageDeliveries)
ConcurrentJobprocessWorkItems in class ConcurrentJob<MessageDelivery>protected Collection<MessageDelivery> process(MessageDeliverer messageDeliverer, MessageDelivery messageDelivery, MessageProcessingJob.Mode mode)
messageDeliverer - the deliverermessageDelivery - the deliveryprotected Collection<MessageDelivery> bulkProcess(BulkMessageDeliverer messageDeliverer, Collection<MessageDelivery> messageDeliveries, MessageProcessingJob.Mode mode)
MessageDeliverysmessageDeliverer - the deliverermessageDeliveries - the deliveriesprotected void finishProcessing(ProcessingResult<MessageDelivery> result)
ConcurrentJobfinishProcessing in class ConcurrentJob<MessageDelivery>protected void updateStatusAndUnlock(MessageDelivery messageDelivery, MessageDeliveryStatus status)
messageDelivery - the messageDelivery instance to markpublic ProcessingResult<MessageDelivery> run()
ConcurrentJobrun in class ConcurrentJob<MessageDelivery>public void execute(org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
execute in interface org.quartz.Joborg.quartz.JobExecutionExceptionCopyright © 2005–2016 The Kuali Foundation. All rights reserved.