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 TypeMethodDescriptionboolean
int
Get the value of dayOfMonth.int
getHour()
Get the value of hour.int
getJobId()
Get the value of jobId.int
Get the value of minute.int
Get the value of second.getTask()
Get the value of task.int
Get the value of weekDay.int
hashCode()
boolean
isNew()
Return true, if the entry is not yet persistedvoid
setDayOfMonth
(int v) Set the value of dayOfMonth.void
setHour
(int v) Set the value of hour.void
setJobId
(int v) Set the value of jobId.void
setMinute
(int v) Set the value of minute.void
setSecond
(int v) Set the value of second.void
Set the value of task.void
setWeekDay
(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:
getJobId
in interfaceJobEntry
- Specified by:
getJobId
in classAbstractJobEntry
- Returns:
- int
-
setJobId
Set the value of jobId.- Specified by:
setJobId
in interfaceJobEntry
- Specified by:
setJobId
in classAbstractJobEntry
- Parameters:
v
- new value
-
getSecond
Get the value of second.- Specified by:
getSecond
in classAbstractJobEntry
- Returns:
- int
-
setSecond
Set the value of second.- Specified by:
setSecond
in classAbstractJobEntry
- Parameters:
v
- new value
-
getMinute
Get the value of minute.- Specified by:
getMinute
in classAbstractJobEntry
- Returns:
- int
-
setMinute
Set the value of minute.- Specified by:
setMinute
in classAbstractJobEntry
- Parameters:
v
- new value
-
getHour
Get the value of hour.- Specified by:
getHour
in classAbstractJobEntry
- Returns:
- int
-
setHour
Set the value of hour.- Specified by:
setHour
in classAbstractJobEntry
- Parameters:
v
- new value
-
getWeekDay
Get the value of weekDay.- Specified by:
getWeekDay
in classAbstractJobEntry
- Returns:
- int
-
setWeekDay
Set the value of weekDay.- Specified by:
setWeekDay
in classAbstractJobEntry
- Parameters:
v
- new value
-
getDayOfMonth
Get the value of dayOfMonth.- Specified by:
getDayOfMonth
in classAbstractJobEntry
- Returns:
- int
-
setDayOfMonth
Set the value of dayOfMonth.- Specified by:
setDayOfMonth
in classAbstractJobEntry
- Parameters:
v
- new value
-
getTask
Get the value of task.- Specified by:
getTask
in interfaceJobEntry
- Specified by:
getTask
in classAbstractJobEntry
- Returns:
- String
-
setTask
Set the value of task.- Specified by:
setTask
in interfaceJobEntry
- Specified by:
setTask
in classAbstractJobEntry
- Parameters:
v
- new value
-