Class JobEntryNonPersistent
java.lang.Object
org.apache.turbine.services.schedule.AbstractJobEntry
org.apache.turbine.services.schedule.JobEntryNonPersistent
- All Implemented Interfaces:
Comparable<JobEntry>,JobEntry
This is an implementation of a JobEntry with no persistence. It is used by the
TurbineNonPersistentSchedulerService-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.turbine.services.schedule.AbstractJobEntry
AbstractJobEntry.ScheduleType -
Field Summary
Fields inherited from class org.apache.turbine.services.schedule.AbstractJobEntry
log -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorJobEntryNonPersistent(int sec, int min, int hour, int wd, int day_mo, String task) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanintGet the value of dayOfMonth.intgetHour()Get the value of hour.intgetJobId()Get the value of jobId.intGet the value of minute.intGet the value of second.getTask()Get the value of task.intGet the value of weekDay.inthashCode()booleanisNew()Return true, if the entry is not yet persistedvoidsetDayOfMonth(int v) Set the value of dayOfMonth.voidsetHour(int v) Set the value of hour.voidsetJobId(int v) Set the value of jobId.voidsetMinute(int v) Set the value of minute.voidsetSecond(int v) Set the value of second.voidSet the value of task.voidsetWeekDay(int v) Set the value of weekDay.Methods inherited from class org.apache.turbine.services.schedule.AbstractJobEntry
calcRunTime, compareTo, getNextRunAsString, getNextRunDate, getNextRuntime, isActive, setActive
-
Constructor Details
-
JobEntryNonPersistent
public JobEntryNonPersistent()Default constructor -
JobEntryNonPersistent
public JobEntryNonPersistent(int sec, int min, int hour, int wd, int day_mo, String task) throws TurbineException Constructor. Schedule a job to run on a certain point of time.
Example 1: Run the DefaultScheduledJob at 8:00am every 15th of the month -
JobEntry je = new JobEntry(0,0,8,15,"DefaultScheduledJob");
Example 2: Run the DefaultScheduledJob at 8:00am every day -
JobEntry je = new JobEntry(0,0,8,-1,"DefaultScheduledJob");
Example 3: Run the DefaultScheduledJob every 2 hours. -
JobEntry je = new JobEntry(0,120,-1,-1,"DefaultScheduledJob");
Example 4: Run the DefaultScheduledJob every 30 seconds. -
JobEntry je = new JobEntry(30,-1,-1,-1,"DefaultScheduledJob");- Parameters:
sec- Value for entry "seconds".min- Value for entry "minutes".hour- Value for entry "hours".wd- Value for entry "week days".day_mo- Value for entry "month days".task- Task to execute.- Throws:
TurbineException- a generic exception.
-
-
Method Details
-
hashCode
-
equals
-
isNew
Return true, if the entry is not yet persisted- Returns:
- true if job is not yet saved, otherwise false
-
getJobId
Get the value of jobId.- Specified by:
getJobIdin interfaceJobEntry- Specified by:
getJobIdin classAbstractJobEntry- Returns:
- int
-
setJobId
Set the value of jobId.- Specified by:
setJobIdin interfaceJobEntry- Specified by:
setJobIdin classAbstractJobEntry- Parameters:
v- new value
-
getSecond
Get the value of second.- Specified by:
getSecondin classAbstractJobEntry- Returns:
- int
-
setSecond
Set the value of second.- Specified by:
setSecondin classAbstractJobEntry- Parameters:
v- new value
-
getMinute
Get the value of minute.- Specified by:
getMinutein classAbstractJobEntry- Returns:
- int
-
setMinute
Set the value of minute.- Specified by:
setMinutein classAbstractJobEntry- Parameters:
v- new value
-
getHour
Get the value of hour.- Specified by:
getHourin classAbstractJobEntry- Returns:
- int
-
setHour
Set the value of hour.- Specified by:
setHourin classAbstractJobEntry- Parameters:
v- new value
-
getWeekDay
Get the value of weekDay.- Specified by:
getWeekDayin classAbstractJobEntry- Returns:
- int
-
setWeekDay
Set the value of weekDay.- Specified by:
setWeekDayin classAbstractJobEntry- Parameters:
v- new value
-
getDayOfMonth
Get the value of dayOfMonth.- Specified by:
getDayOfMonthin classAbstractJobEntry- Returns:
- int
-
setDayOfMonth
Set the value of dayOfMonth.- Specified by:
setDayOfMonthin classAbstractJobEntry- Parameters:
v- new value
-
getTask
Get the value of task.- Specified by:
getTaskin interfaceJobEntry- Specified by:
getTaskin classAbstractJobEntry- Returns:
- String
-
setTask
Set the value of task.- Specified by:
setTaskin interfaceJobEntry- Specified by:
setTaskin classAbstractJobEntry- Parameters:
v- new value
-