Package org.apache.camel.spi
Interface ScheduledPollConsumerScheduler
-
- All Superinterfaces:
AutoCloseable
,CamelContextAware
,Service
,ShutdownableService
public interface ScheduledPollConsumerScheduler extends ShutdownableService, CamelContextAware
A pluggable scheduler fororg.apache.camel.support.ScheduledPollConsumer
consumers. The default implementationorg.apache.camel.support.DefaultScheduledPollConsumerScheduler
is using theScheduledExecutorService
from the JDK to schedule and run the poll task. An alternative implementation is in camel-quartz component that allows to use CRON expression to define when the scheduler should run.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
isSchedulerStarted()
Whether the scheduler has been started.void
onInit(Consumer consumer)
Initializes thisScheduledPollConsumerScheduler
with the associatedConsumer
.void
scheduleTask(Runnable task)
Schedules the task to run.void
startScheduler()
Starts the scheduler.void
unscheduleTask()
Attempts to unschedules the last task which was scheduled.-
Methods inherited from interface org.apache.camel.CamelContextAware
getCamelContext, setCamelContext
-
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
-
-
-
-
Method Detail
-
onInit
void onInit(Consumer consumer)
Initializes thisScheduledPollConsumerScheduler
with the associatedConsumer
.- Parameters:
consumer
- the consumer.
-
scheduleTask
void scheduleTask(Runnable task)
Schedules the task to run.- Parameters:
task
- the task to run.
-
unscheduleTask
void unscheduleTask()
Attempts to unschedules the last task which was scheduled. An implementation may not implement this method.
-
startScheduler
void startScheduler()
Starts the scheduler. If the scheduler is already started, then this is a noop method call.
-
isSchedulerStarted
boolean isSchedulerStarted()
Whether the scheduler has been started.- Returns:
- true if started, false otherwise.
-
-