org.alfresco.bm.process
Class ScheduleProcesses

java.lang.Object
  extended by org.alfresco.bm.event.AbstractEventProcessor
      extended by org.alfresco.bm.process.ScheduleProcesses
All Implemented Interfaces:
org.alfresco.bm.event.EventProcessor, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanNameAware

public class ScheduleProcesses
extends org.alfresco.bm.event.AbstractEventProcessor

Schedule processing events.

Input

No input requirements

Data

A MongoDB collection containing unprocessed data.

Actions

The MongoDB collection is examined to find (see unfinished processes. Unfinished processes are scheduled up to a batch size after which this processor reschedules itself.

Output

EVENT_NAME_PROCESS: The process name
EVENT_NAME_SCHEDULE_PROCESSES: No data

Since:
1.0
Author:
Derek Hulley

Field Summary
static int DEFAULT_BATCH_SIZE
           
static String EVENT_NAME_PROCESS
           
static String EVENT_NAME_SCHEDULE_PROCESSES
           
 
Fields inherited from class org.alfresco.bm.event.AbstractEventProcessor
DEFAULT_WARN_DELAY, logger
 
Constructor Summary
ScheduleProcesses(org.springframework.data.mongodb.core.MongoTemplate mongo, String processData, long timeBetweenProcesses)
           
 
Method Summary
 org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
           
 void setEventNameProcess(String eventNameProcess)
          Override the default event name to process an event
 
Methods inherited from class org.alfresco.bm.event.AbstractEventProcessor
getWarnDelay, register, setBeanName, setEventName, setEventNames, setRegistry, setWarnDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BATCH_SIZE

public static final int DEFAULT_BATCH_SIZE
See Also:
Constant Field Values

EVENT_NAME_PROCESS

public static final String EVENT_NAME_PROCESS
See Also:
Constant Field Values

EVENT_NAME_SCHEDULE_PROCESSES

public static final String EVENT_NAME_SCHEDULE_PROCESSES
See Also:
Constant Field Values
Constructor Detail

ScheduleProcesses

public ScheduleProcesses(org.springframework.data.mongodb.core.MongoTemplate mongo,
                         String processData,
                         long timeBetweenProcesses)
Parameters:
mongo - connection to MongoDB
processData - name of DB collection containing process details
processCount - total number of processes to schedule
timeBetweenProcesses - how long between each process
Method Detail

setEventNameProcess

public void setEventNameProcess(String eventNameProcess)
Override the default event name to process an event


processEvent

public org.alfresco.bm.event.EventResult processEvent(org.alfresco.bm.event.Event event)
                                               throws Exception
Throws:
Exception


Copyright © 2012. All Rights Reserved.