|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.time.schedule.LinearQueueSchedulingStrategy<T>
T
- public class LinearQueueSchedulingStrategy<T>
LinearQueueSchedulingStrategy
will compute the
next processing date by linearly scaling its
intervalMillis
with the number of already happend
reschedulings thus resulting in a linear increase of
the intervals.
The linear scaling behavior on reschedulings can be delayed by
setting delayCount
which is 0 if not done so. See
calculateScalingFactor(SchedulableQueueElement)
for further details on the scaling behavior.
Field Summary | |
---|---|
protected int |
delayCount
|
protected int |
intervalMillis
|
Constructor Summary | |
---|---|
LinearQueueSchedulingStrategy(int intervalMillis)
Creates a new LinearQueueSchedulingStrategy instance with
the passed intervalMillis and no delayCount . |
|
LinearQueueSchedulingStrategy(int intervalMillis,
int delayCount)
Creates a new LinearQueueSchedulingStrategy instance
with the passed intervalMillis and delayCount . |
Method Summary | |
---|---|
java.util.Calendar |
calculateNextProcessing(QueueScheduler<T> scheduler,
SchedulableQueueElement<T> schedulable)
Calculates the next processing date by adding the intervalMillis multiplied with a scaling factor
(see calculateScalingFactor(SchedulableQueueElement) )
to the current time. |
protected int |
calculateScalingFactor(SchedulableQueueElement<T> schedulable)
Calculates the factor the intervalMillis should be
scalied with linearly as the maximum of 1 and
(
The delayCount , nomen es omen, thus is used to specify
the number of times the LinearQueueSchedulingStrategy
should do a constant rescheduling just like the
ConstantQueueSchedulingStrategy before proceeding
with the linear scaling. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final int intervalMillis
protected final int delayCount
Constructor Detail |
---|
public LinearQueueSchedulingStrategy(int intervalMillis)
LinearQueueSchedulingStrategy
instance with
the passed intervalMillis
and no delayCount
.
intervalMillis
- public LinearQueueSchedulingStrategy(int intervalMillis, int delayCount)
LinearQueueSchedulingStrategy
instance
with the passed intervalMillis
and delayCount
.
intervalMillis
- delayCount
- Method Detail |
---|
protected int calculateScalingFactor(SchedulableQueueElement<T> schedulable)
intervalMillis
should be
scalied with linearly as the maximum of 1 and
(SchedulableQueueElement.getScheduledCount()
+
1 - delayCount
)
delayCount
, nomen es omen, thus is used to specify
the number of times the LinearQueueSchedulingStrategy
should do a constant rescheduling just like the
ConstantQueueSchedulingStrategy
before proceeding
with the linear scaling.
SchedulableQueueElement.getScheduledCount()
specifies
the number prior scheduling, exclusive the current one.
schedulable
-
public java.util.Calendar calculateNextProcessing(QueueScheduler<T> scheduler, SchedulableQueueElement<T> schedulable)
intervalMillis
multiplied with a scaling factor
(see calculateScalingFactor(SchedulableQueueElement)
)
to the current time.
calculateNextProcessing
in interface QueueSchedulingStrategy<T>
scheduler
- - the QueueScheduler
that is associated
with this strategy instanceschedulable
- - the SchedulableQueueElement
that
will be (re)scheduled
SchedulableQueueElement
QueueSchedulingStrategy.calculateNextProcessing(com.emarsys.ecommon.time.schedule.QueueScheduler, com.emarsys.ecommon.time.schedule.SchedulableQueueElement)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |