Package com.github.sonus21.rqueue.core
Class MessageScheduler
- java.lang.Object
-
- com.github.sonus21.rqueue.core.MessageScheduler
-
- All Implemented Interfaces:
java.util.EventListener,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationListener<RqueueBootstrapEvent>
- Direct Known Subclasses:
ProcessingQueueMessageScheduler,ScheduledQueueMessageScheduler
public abstract class MessageScheduler extends java.lang.Object implements org.springframework.beans.factory.DisposableBean, org.springframework.context.ApplicationListener<RqueueBootstrapEvent>
-
-
Field Summary
Fields Modifier and Type Field Description protected RqueueConfigrqueueConfigprotected RqueueSchedulerConfigrqueueSchedulerConfig
-
Constructor Summary
Constructors Constructor Description MessageScheduler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected abstract java.lang.StringgetChannelName(java.lang.String queueName)protected abstract org.slf4j.LoggergetLogger()protected longgetMinDelay()protected abstract longgetNextScheduleTime(java.lang.String queueName, java.lang.Long value)protected longgetQueueStartTime()protected com.github.sonus21.rqueue.core.ScheduledTaskDetailgetScheduledTask(java.lang.String queueName)protected abstract java.lang.StringgetThreadNamePrefix()protected abstract intgetThreadPoolSize()protected abstract java.lang.StringgetZsetName(java.lang.String queueName)protected voidinitialize()protected abstract booleanisProcessingQueue(java.lang.String queueName)voidonApplicationEvent(RqueueBootstrapEvent event)protected voidschedule(java.lang.String queueName, java.lang.Long startTime, boolean forceSchedule)
-
-
-
Field Detail
-
rqueueSchedulerConfig
@Autowired protected RqueueSchedulerConfig rqueueSchedulerConfig
-
rqueueConfig
@Autowired protected RqueueConfig rqueueConfig
-
-
Method Detail
-
getLogger
protected abstract org.slf4j.Logger getLogger()
-
getNextScheduleTime
protected abstract long getNextScheduleTime(java.lang.String queueName, java.lang.Long value)
-
getChannelName
protected abstract java.lang.String getChannelName(java.lang.String queueName)
-
getZsetName
protected abstract java.lang.String getZsetName(java.lang.String queueName)
-
getThreadNamePrefix
protected abstract java.lang.String getThreadNamePrefix()
-
getThreadPoolSize
protected abstract int getThreadPoolSize()
-
isProcessingQueue
protected abstract boolean isProcessingQueue(java.lang.String queueName)
-
getQueueStartTime
protected long getQueueStartTime()
-
destroy
public void destroy() throws java.lang.Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
java.lang.Exception
-
getScheduledTask
protected com.github.sonus21.rqueue.core.ScheduledTaskDetail getScheduledTask(java.lang.String queueName)
-
schedule
protected void schedule(java.lang.String queueName, java.lang.Long startTime, boolean forceSchedule)
-
initialize
protected void initialize()
-
onApplicationEvent
@Async public void onApplicationEvent(RqueueBootstrapEvent event)
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<RqueueBootstrapEvent>
-
getMinDelay
protected long getMinDelay()
-
-