public class DefaultScheduledPollConsumerScheduler extends ServiceSupport implements ScheduledPollConsumerScheduler
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending| Constructor and Description |
|---|
DefaultScheduledPollConsumerScheduler() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doShutdown()
Implementations override this method to perform customized shutdown.
|
protected void |
doStart()
Implementations override this method to support customized start/stop.
|
protected void |
doStop()
Implementations override this method to support customized start/stop.
|
CamelContext |
getCamelContext()
Get the
CamelContext |
long |
getDelay() |
long |
getInitialDelay() |
ScheduledExecutorService |
getScheduledExecutorService() |
TimeUnit |
getTimeUnit() |
boolean |
isSchedulerStarted()
Whether the scheduler has been started.
|
boolean |
isUseFixedDelay() |
void |
onInit(Consumer consumer)
Initializes this
ScheduledPollConsumerScheduler with the associated Consumer. |
void |
scheduleTask(Runnable task)
Schedules the task to run.
|
void |
setCamelContext(CamelContext camelContext)
Injects the
CamelContext |
void |
setDelay(long delay) |
void |
setInitialDelay(long initialDelay) |
void |
setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService) |
void |
setTimeUnit(TimeUnit timeUnit) |
void |
setUseFixedDelay(boolean useFixedDelay) |
void |
startScheduler()
Starts the scheduler.
|
void |
unscheduleTask()
Attempts to unschedules the last task which was scheduled.
|
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitshutdownpublic DefaultScheduledPollConsumerScheduler()
public CamelContext getCamelContext()
CamelContextAwareCamelContextgetCamelContext in interface CamelContextAwarepublic void setCamelContext(CamelContext camelContext)
CamelContextAwareCamelContextsetCamelContext in interface CamelContextAwarecamelContext - the Camel contextpublic long getInitialDelay()
public void setInitialDelay(long initialDelay)
public long getDelay()
public void setDelay(long delay)
public TimeUnit getTimeUnit()
public void setTimeUnit(TimeUnit timeUnit)
public boolean isUseFixedDelay()
public void setUseFixedDelay(boolean useFixedDelay)
public ScheduledExecutorService getScheduledExecutorService()
public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
public void onInit(Consumer consumer)
ScheduledPollConsumerSchedulerScheduledPollConsumerScheduler with the associated Consumer.onInit in interface ScheduledPollConsumerSchedulerconsumer - the consumer.public void scheduleTask(Runnable task)
ScheduledPollConsumerSchedulerscheduleTask in interface ScheduledPollConsumerSchedulertask - the task to run.public void unscheduleTask()
ScheduledPollConsumerSchedulerunscheduleTask in interface ScheduledPollConsumerSchedulerpublic void startScheduler()
ScheduledPollConsumerSchedulerstartScheduler in interface ScheduledPollConsumerSchedulerpublic boolean isSchedulerStarted()
ScheduledPollConsumerSchedulerisSchedulerStarted in interface ScheduledPollConsumerSchedulerprotected void doStart() throws Exception
ServiceSupportServiceSupport.doStop() for more details.doStart in class ServiceSupportExceptionServiceSupport.doStop()protected void doStop() throws Exception
ServiceSupportServiceSupport.doStop() method when
the service is being stopped. This method will also be invoked
if the service is still in uninitialized state (eg has not
been started). The method is always called to allow the service
to do custom logic when the service is being stopped, such as when
CamelContext is shutting down.doStop in class ServiceSupportExceptionServiceSupport.doStart()protected void doShutdown() throws Exception
ServiceSupportdoShutdown in class ServiceSupportExceptionApache Camel