Class SchedulerServiceImpl
- java.lang.Object
-
- org.apache.unomi.services.impl.scheduler.SchedulerServiceImpl
-
- All Implemented Interfaces:
SchedulerService
public class SchedulerServiceImpl extends Object implements SchedulerService
- Author:
- dgaillard
-
-
Constructor Summary
Constructors Constructor Description SchedulerServiceImpl()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ScheduledExecutorService
getScheduleExecutorService()
Use this method to get aScheduledExecutorService
and execute your task with it instead of usingTimer
ScheduledExecutorService
getSharedScheduleExecutorService()
Same as getScheduleExecutorService but use a shared pool of ScheduledExecutor instead of single one.static long
getTimeDiffInSeconds(int hourInUtc, ZonedDateTime now)
void
postConstruct()
void
preDestroy()
void
setThreadPoolSize(int threadPoolSize)
-
-
-
Method Detail
-
postConstruct
public void postConstruct()
-
preDestroy
public void preDestroy()
-
setThreadPoolSize
public void setThreadPoolSize(int threadPoolSize)
-
getScheduleExecutorService
public ScheduledExecutorService getScheduleExecutorService()
Description copied from interface:SchedulerService
Use this method to get aScheduledExecutorService
and execute your task with it instead of usingTimer
- Specified by:
getScheduleExecutorService
in interfaceSchedulerService
- Returns:
ScheduledExecutorService
-
getSharedScheduleExecutorService
public ScheduledExecutorService getSharedScheduleExecutorService()
Description copied from interface:SchedulerService
Same as getScheduleExecutorService but use a shared pool of ScheduledExecutor instead of single one. Use this service is your tasks can be run in parallel of the others.- Specified by:
getSharedScheduleExecutorService
in interfaceSchedulerService
- Returns:
ScheduledExecutorService
-
getTimeDiffInSeconds
public static long getTimeDiffInSeconds(int hourInUtc, ZonedDateTime now)
-
-