Package overit.geocall.scheduler
Class JobQueue
java.lang.Object
overit.geocall.scheduler.JobQueue
- All Implemented Interfaces:
overit.geocall.marks.FieldExposer
- Direct Known Subclasses:
JobQueueFixedDelay,JobQueueFixedRate,JobQueueFixedTime
This class implements the queue of
Job-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Dateprotected Setprotected Stringprotected Setprotected static HashMapprotected ArrayListprotected Setprotected Stringprotected intprotected JobQueue.QueueRunnerprotected intprotected Stringprotected Dateprotected intprotected Timerprotected static intprotected Setstatic final intstatic final intstatic final intstatic final LogChannelstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Jobvoidcancel()Cancel the timerbooleanReturnstrueif the JobQueue can run the job,falseotherwisegetAt()Returns the atReturns the Set of day hoursReturns the description of the JobQueueReturns the Set of hour minutesstatic JobQueuegetJobQueue(String name) Returns theJobQueuewith a given namegetJobs()Returns the ArrayList with jobsabstract intgetMode()Returns the modeReturns the Set of month daysgetName()Returns the name of the JobQueueintReturns the periodReturns the running jobReturns the scheduling date of the JobQueueintgetState()Returns the stateReturns the Set of week daysReturns the Iterator of jobsvoidkill(boolean force) Does nothingprotected booleanprotected static SDatenextExecution(Date at, int period) static IteratorReturns the Iterator for theJobQueuestatic voidRemoves theJobQueueprotected voidrunQueue()protected voidvoidschedule(Date at, int period, int random, Set hourMinutes, Set dayHours, Set weekDays, Set monthDays) Schedule a JobQUeuevoidstart()Start a JobQueuestatic intReturns the static intvoidstop()Stop a JobQueue
-
Field Details
-
LOG
-
_jobQueues
-
FIXED_RATE
public static final int FIXED_RATE- See Also:
-
FIXED_DELAY
public static final int FIXED_DELAY- See Also:
-
FIXED_TIME
public static final int FIXED_TIME- See Also:
-
STATE_STOPPED
public static final int STATE_STOPPED- See Also:
-
STATE_RUNNING
public static final int STATE_RUNNING- See Also:
-
_TIMEUNIT
protected static int _TIMEUNIT -
_qr
-
_weekDays
-
_monthDays
-
_dayHours
-
_hourMinutes
-
_runningJob
-
_t
-
_name
-
_description
-
_schedulingDate
-
_state
protected int _state -
_at
-
_period
protected int _period -
_random
protected int _random -
_jobs
-
-
Constructor Details
-
JobQueue
protected JobQueue() -
JobQueue
Creates a new JobQueue- Parameters:
name- The name of the JobQueuedescription- The description of the JobQueuestate- The state of the JobQueue
-
-
Method Details
-
getJobQueue
Returns theJobQueuewith a given name- Parameters:
name- The name to search- Returns:
- The
JobQueue
-
removeJobQueue
Removes theJobQueue- Parameters:
jq- TheJobQueue
-
queueIterator
Returns the Iterator for theJobQueue- Returns:
- The Iterator for the
JobQueue
-
getWeekDays
Returns the Set of week days- Returns:
- The Set of week days
-
getMonthDays
Returns the Set of month days- Returns:
- The Set of month days
-
getDayHours
Returns the Set of day hours- Returns:
- The Set of day hours
-
getHourMinutes
Returns the Set of hour minutes- Returns:
- The Set of hour minutes
-
staticInt
Returns the static int- Parameters:
name- The name of the fielddef- The default value- Returns:
- The static int of the class with the corrisponding name, if not found returns def
-
schedule
public void schedule(Date at, int period, int random, Set hourMinutes, Set dayHours, Set weekDays, Set monthDays) Schedule a JobQUeue- Parameters:
at- The Dateperiod- The periodrandom- The randomhourMinutes- The set with hour minutesdayHours- The set with day hoursweekDays- The set with week daysmonthDays- The set with month days
-
getJobs
Returns the ArrayList with jobs- Returns:
- The ArryList with jobs
-
cancel
public void cancel()Cancel the timer -
jobIterator
Returns the Iterator of jobs- Returns:
- The Iterator of jobs
-
getName
Returns the name of the JobQueue- Returns:
- The name of the JobQueue
-
getDescription
Returns the description of the JobQueue- Returns:
- The description of the JobQueue
-
getSchedulingDate
Returns the scheduling date of the JobQueue- Returns:
- The scheduling date of the JobQueue
-
getAt
Returns the at- Returns:
- The at
-
getPeriod
public int getPeriod()Returns the period- Returns:
- The period
-
getState
public int getState()Returns the state- Returns:
- The state
-
start
public void start()Start a JobQueue -
stop
public void stop()Stop a JobQueue -
canRunJob
public boolean canRunJob()Returnstrueif the JobQueue can run the job,falseotherwise- Returns:
trueif the JobQueue can run the job,falseotherwise
-
_getAnotherJob
-
matches
-
runQueue
protected void runQueue() -
runQueueNow
protected void runQueueNow() -
kill
public void kill(boolean force) Does nothing- Parameters:
force- Not used
-
getRunningJob
Returns the running job- Returns:
- The running job
-
getMode
public abstract int getMode()Returns the mode- Returns:
- The mode
-
nextExecution
-