com.emarsys.ecommon.time.schedule.mock
Class MockSchedulingStrategy<T>

java.lang.Object
  extended by com.emarsys.ecommon.time.schedule.mock.MockSchedulingStrategy<T>
All Implemented Interfaces:
QueueSchedulingStrategy<T>

public class MockSchedulingStrategy<T>
extends java.lang.Object
implements QueueSchedulingStrategy<T>

A mock implementation of a QueueSchedulingStrategy for Ts.

Author:
Michael "kULO" Kulovits

Field Summary
protected  java.util.Calendar nextProcessing
           
 
Constructor Summary
MockSchedulingStrategy()
           
 
Method Summary
 java.util.Calendar calculateNextProcessing(QueueScheduler<T> scheduler, SchedulableQueueElement<T> schedulable)
           Performs the concrete scheduling algorithm defined by this QueueSchedulingStrategy on the passed SchedulableQueueElement.
 void setNextProcessing(java.util.Calendar nextProcessing)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nextProcessing

protected java.util.Calendar nextProcessing
Constructor Detail

MockSchedulingStrategy

public MockSchedulingStrategy()
Method Detail

setNextProcessing

public void setNextProcessing(java.util.Calendar nextProcessing)
Parameters:
nextProcessing -

calculateNextProcessing

public java.util.Calendar calculateNextProcessing(QueueScheduler<T> scheduler,
                                                  SchedulableQueueElement<T> schedulable)
Description copied from interface: QueueSchedulingStrategy

Performs the concrete scheduling algorithm defined by this QueueSchedulingStrategy on the passed SchedulableQueueElement.

All information needed by the algorithm should be retrieved from the passed schedulable and scheduler instances.

The passed schedulable should not be altered by this algorithm. In order to decouple the scheduling algorithm as much as possible and to preserve flexibility and reusabiltiy the schedulable should itself be responsible for changing its internal state in its SchedulableQueueElement.getScheduled(QueueScheduler) method.

Specified by:
calculateNextProcessing in interface QueueSchedulingStrategy<T>
Parameters:
scheduler - - the QueueScheduler that is associated with this strategy instance
schedulable - - the SchedulableQueueElement that will be (re)scheduled
Returns:
the next scheduled date for the passed SchedulableQueueElement

See Also:
QueueSchedulingStrategy.calculateNextProcessing(com.emarsys.ecommon.time.schedule.QueueScheduler, com.emarsys.ecommon.time.schedule.SchedulableQueueElement)


Copyright © 2010 emarsys AG. All Rights Reserved.