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:
DelayedMessageScheduler
,ProcessingMessageScheduler
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 RqueueSchedulerConfig
rqueueSchedulerConfig
-
Constructor Summary
Constructors Constructor Description MessageScheduler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
destroy()
protected abstract java.lang.String
getChannelName(java.lang.String queueName)
protected abstract org.slf4j.Logger
getLogger()
protected abstract long
getNextScheduleTime(java.lang.String queueName, java.lang.Long value)
protected abstract java.lang.String
getThreadNamePrefix()
protected abstract int
getThreadPoolSize()
protected abstract java.lang.String
getZsetName(java.lang.String queueName)
protected void
initialize()
protected abstract boolean
isProcessingQueue(java.lang.String queueName)
void
onApplicationEvent(RqueueBootstrapEvent event)
protected void
schedule(java.lang.String queueName, java.lang.Long startTime, boolean forceSchedule)
-
-
-
Field Detail
-
rqueueSchedulerConfig
@Autowired protected RqueueSchedulerConfig rqueueSchedulerConfig
-
-
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)
-
destroy
public void destroy() throws java.lang.Exception
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
- Throws:
java.lang.Exception
-
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:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<RqueueBootstrapEvent>
-
-