|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jfw.scheduler.ScheduleTypes
public abstract class ScheduleTypes
Must be extend by the classes implement a particular type of scheduling.
Field Summary | |
---|---|
protected java.lang.String |
className
Used for logging. |
static java.lang.String |
EXECUTE_NOW_KEY
Key used in status properties file. |
protected java.lang.String |
frequence
Execution frequence. |
protected java.lang.String |
id
Scduled bean unique id. |
static java.lang.String |
NEXT_EXECUTION_DATE_KEY
Key used in status properties file. |
static java.lang.String |
NEXT_EXECUTION_TIME_KEY
Key used in status properties file. |
static java.lang.String |
PREVIOUS_EXECUTION_DATE_KEY
Key used in status properties file. |
static java.lang.String |
PREVIOUS_EXECUTION_TIME_KEY
Key used in status properties file. |
protected java.lang.String |
scheduleBean
The class name of the scheduled bean. |
protected ScheduleThread |
scheduleThread
The thread who execute the scheduled bean. |
protected java.util.Properties |
statusProperties
Contains execution info relative of the scheduled bean. |
Constructor Summary | |
---|---|
ScheduleTypes()
|
Method Summary | |
---|---|
protected void |
addError(java.lang.String message)
Add an error message in ScheduleThread.errors . |
protected void |
commonSleep()
Implement the logic of common sleep before the schedule bean is execute. |
boolean |
existStatusProperties()
Check if the properties file, relative of the execution of a scheduled bean, exist. |
protected java.lang.String |
getFileName()
Return the file name of the properties file. |
protected abstract java.util.Date |
getNextExecutionDate()
Return the next execution day. |
protected java.lang.String |
getScheduleObjectsPath()
Get the path where the scheduling execution can be saved. |
protected void |
readStatus()
Read file saved in saveStatus() . |
protected void |
saveStatus()
Save attribute statusProperties as a file in disk. |
protected abstract void |
setParams()
Set init parameters for the specific type of scheduling. |
protected abstract void |
sleep()
Implement the logic of sleep before the schedule bean is execute. |
protected void |
updateProperties(long nextExecutionTime)
Update attribute statusProperties with the status of execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String className
protected java.lang.String frequence
protected java.lang.String id
protected ScheduleThread scheduleThread
protected java.lang.String scheduleBean
protected java.util.Properties statusProperties
public static final java.lang.String NEXT_EXECUTION_TIME_KEY
public static final java.lang.String NEXT_EXECUTION_DATE_KEY
public static final java.lang.String PREVIOUS_EXECUTION_TIME_KEY
public static final java.lang.String PREVIOUS_EXECUTION_DATE_KEY
public static final java.lang.String EXECUTE_NOW_KEY
Constructor Detail |
---|
public ScheduleTypes()
Method Detail |
---|
protected void readStatus() throws java.lang.Exception
saveStatus()
. This file contains execution info
for the scheduled bean.
java.lang.Exception
protected void saveStatus() throws java.lang.Exception
statusProperties
as a file in disk. The path to
save the file is returned by getScheduleObjectsPath()
.
for example CleanLogFiles1.properties.
java.lang.Exception
protected void updateProperties(long nextExecutionTime) throws java.lang.Exception
statusProperties
with the status of execution.
java.lang.Exception
public boolean existStatusProperties()
getScheduleObjectsPath()
. The name of the properties file is
the name of the class of the scheduled bean, plus properties.
protected void addError(java.lang.String message)
ScheduleThread.errors
.
message
- error message to add.protected java.lang.String getScheduleObjectsPath()
protected java.lang.String getFileName()
scheduleBean
+ - + id
+ .properties
protected abstract java.util.Date getNextExecutionDate() throws java.lang.Exception
java.lang.Exception
protected abstract void sleep() throws java.lang.Exception
java.lang.Exception
protected abstract void setParams()
protected void commonSleep() throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |