|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface QueueSchedulingStrategy<T>
A QueueSchedulingStrategy
encapsulates a concrete
policy on when to process a SchedulableQueueElement
.
Thus it represents a time based, stateless scheduling
algorithm.
A concrete Class
implementing this interface specifies
the generic scheduling algorithm and a concrete instance
applies fixed configuration values to the algorithm.
So two instances of the same class implementing
QueueSchedulingStrategy
could nevertheless represent
different scheduling mechanisms due to their configuration,
specified by constructor parameters.
Note that the configuration of the strategy is frozen with its instantiation; possible corresponding getter methods must not return different values during the lifetime of the strategy. Iff there's a change needed in the algorithms initial parameters then a new instance with changed settings has to be created and used for the actual scheduling.
QueueScheduler
,
SchedulableQueueElement
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 . |
Method Detail |
---|
java.util.Calendar calculateNextProcessing(QueueScheduler<T> scheduler, SchedulableQueueElement<T> schedulable)
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.
scheduler
- - the QueueScheduler
that is associated
with this strategy instanceschedulable
- - the SchedulableQueueElement
that
will be (re)scheduled
SchedulableQueueElement
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |