Package job
Class JobScheduler
java.lang.Object
job.JobScheduler
Schedules and executes background jobs using thread pool.
- Author:
- TAMIL MUGHILAN
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Logger
private final ScheduledExecutorService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
scheduleJob
(BankingJob job, long initialDelay, long period, TimeUnit timeUnit) Schedules a job to run repeatedly at fixed intervals.void
shutdown()
Shuts down the job scheduler only if no jobs are running.
-
Field Details
-
logger
-
scheduler
-
-
Constructor Details
-
JobScheduler
public JobScheduler()
-
-
Method Details
-
scheduleJob
Schedules a job to run repeatedly at fixed intervals.- Parameters:
job
- the banking job to scheduleinitialDelay
- delay before first executionperiod
- time between executionstimeUnit
- unit for delay and period (SECONDS, MINUTES, etc.)
-
shutdown
public void shutdown()Shuts down the job scheduler only if no jobs are running.
-