|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.emarsys.ecommon.time.schedule.SchedulableQueueElementProxy<T>
public class SchedulableQueueElementProxy<T>
A proxy for SchedulableQueueElement
s that allows
for some manipulations.
Field Summary | |
---|---|
protected SchedulableQueueElement<T> |
schedulable
|
protected int |
scheduledCountOffset
|
Constructor Summary | |
---|---|
SchedulableQueueElementProxy(SchedulableQueueElement<T> schedulable)
|
Method Summary | ||
---|---|---|
T |
getConcreteInstance()
|
|
java.util.Calendar |
getLastProcessing()
Returns the schedulable's last processing date. |
|
java.util.Calendar |
getMaxScheduleDate()
Returns the maximum schedule date which defines a date in the future and must not be exceeded on reschedulings. |
|
int |
getMinSchedulingInterval()
Returns the minimal scheduling interval in milliseconds that is compulsory for this SchedulableQueueElement . |
|
java.util.Calendar |
getNextProcessing()
Returns the next scheduled date which a priori is null . |
|
static
|
getProxy(SchedulableQueueElement<T> schedulable)
Factory method. |
|
java.util.Calendar |
getQueueingDate()
Returns the schedulable's queueing date. |
|
java.util.Calendar |
getScheduled(QueueScheduler<T> scheduler)
(Re)schedules this queue element using the passed QueueScheduler . |
|
int |
getScheduledCount()
Will add the scheduledCountOffset to
#schedulable#getScheduledCount() (or subtract if the
prior is negative), but the value won't be < 0. |
|
int |
getScheduledCountOffset()
|
|
java.util.Calendar |
now()
Returns the schedulables notion of the current time. |
|
void |
setScheduledCountOffset(int scheduledCountOffset)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected SchedulableQueueElement<T> schedulable
protected int scheduledCountOffset
Constructor Detail |
---|
public SchedulableQueueElementProxy(SchedulableQueueElement<T> schedulable)
schedulable
- Method Detail |
---|
public static final <T> SchedulableQueueElementProxy<T> getProxy(SchedulableQueueElement<T> schedulable)
T
- schedulable
-
public int getScheduledCountOffset()
public void setScheduledCountOffset(int scheduledCountOffset)
scheduledCountOffset
- the scheduledCountOffset to setpublic T getConcreteInstance()
getConcreteInstance
in interface GenericAdapter<T>
GenericAdapter.getConcreteInstance()
public java.util.Calendar getLastProcessing()
SchedulableQueueElement
Returns the schedulable's last processing date.
The last scheduled date refers to the time of the
last rescheduling, i.e. on the last call to
SchedulableQueueElement.getScheduled(QueueScheduler)
this value should
have been set to SchedulableQueueElement.now()
.
A priori the last scheduled date is null
.
getLastProcessing
in interface SchedulableQueueElement<T>
SchedulableQueueElement.getLastProcessing()
public java.util.Calendar getMaxScheduleDate()
SchedulableQueueElement
Returns the maximum schedule date which defines a date in the future and must not be exceeded on reschedulings.
getMaxScheduleDate
in interface SchedulableQueueElement<T>
SchedulableQueueElement.getMaxScheduleDate()
public int getMinSchedulingInterval()
SchedulableQueueElement
Returns the minimal scheduling interval in milliseconds
that is compulsory for this SchedulableQueueElement
.
On getting scheduled (see SchedulableQueueElement.getScheduled(QueueScheduler)
)
this schedulable must not set its next processing date
either to a value >= (SchedulableQueueElement.now()
+ minSchedulingInterval)
or to null
(which is actually the dequeueing of
the schedulable queue element).
getMinSchedulingInterval
in interface SchedulableQueueElement<T>
SchedulableQueueElement.getMinSchedulingInterval()
public java.util.Calendar getNextProcessing()
SchedulableQueueElement
Returns the next scheduled date which a priori is null
.
getNextProcessing
in interface SchedulableQueueElement<T>
SchedulableQueueElement.getNextProcessing()
public java.util.Calendar getQueueingDate()
SchedulableQueueElement
Returns the schedulable's queueing date.
The queueing date represents the timestamp when this
SchedulableQueueElement
has been added to the
queuing mechanism.
getQueueingDate
in interface SchedulableQueueElement<T>
SchedulableQueueElement.getQueueingDate()
public java.util.Calendar getScheduled(QueueScheduler<T> scheduler)
SchedulableQueueElement
(Re)schedules this queue element using the passed
QueueScheduler
.
The passed QueueScheduler
will be used to retrieve
a QueueSchedulingStrategy
for this
SchedulableQueueElement
that will be used to
calculate the date of the next processing
which will be set to the new value, see SchedulableQueueElement.getNextProcessing()
.
Futhermore the last processing date will be set to the current
time.
The SchedulableQueueElement
must not set its next
processing date to a value that's not at least
SchedulableQueueElement.getMinSchedulingInterval()
millis after the
last processing date
(which is SchedulableQueueElement.now()
during
SchedulableQueueElement.getScheduled(QueueScheduler)
).
getScheduled
in interface SchedulableQueueElement<T>
scheduler
-
SchedulableQueueElement.getScheduled(com.emarsys.ecommon.time.schedule.QueueScheduler)
public int getScheduledCount()
scheduledCountOffset
to
#schedulable#getScheduledCount()
(or subtract if the
prior is negative), but the value won't be < 0.
getScheduledCount
in interface SchedulableQueueElement<T>
SchedulableQueueElement
has been (re-)scheduled.SchedulableQueueElement.getScheduledCount()
public java.util.Calendar now()
SchedulableQueueElement
Returns the schedulables notion of the current time.
Might be a clone of the queueing date.
now
in interface SchedulableQueueElement<T>
SchedulableQueueElement.now()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |