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 ScheduledExecutorServicegetScheduleExecutorService()Use this method to get aScheduledExecutorServiceand execute your task with it instead of usingTimerScheduledExecutorServicegetSharedScheduleExecutorService()Same as getScheduleExecutorService but use a shared pool of ScheduledExecutor instead of single one.static longgetTimeDiffInSeconds(int hourInUtc, ZonedDateTime now)voidpostConstruct()voidpreDestroy()voidsetThreadPoolSize(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:SchedulerServiceUse this method to get aScheduledExecutorServiceand execute your task with it instead of usingTimer- Specified by:
getScheduleExecutorServicein interfaceSchedulerService- Returns:
ScheduledExecutorService
-
getSharedScheduleExecutorService
public ScheduledExecutorService getSharedScheduleExecutorService()
Description copied from interface:SchedulerServiceSame 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:
getSharedScheduleExecutorServicein interfaceSchedulerService- Returns:
ScheduledExecutorService
-
getTimeDiffInSeconds
public static long getTimeDiffInSeconds(int hourInUtc, ZonedDateTime now)
-
-