org.apache.camel.impl
Class DefaultScheduledPollConsumerScheduler

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultScheduledPollConsumerScheduler
All Implemented Interfaces:
CamelContextAware, Service, ShutdownableService, ScheduledPollConsumerScheduler, StatefulService, SuspendableService

public class DefaultScheduledPollConsumerScheduler
extends ServiceSupport
implements ScheduledPollConsumerScheduler


Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
DefaultScheduledPollConsumerScheduler()
           
 
Method Summary
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.
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.camel.ShutdownableService
shutdown
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

DefaultScheduledPollConsumerScheduler

public DefaultScheduledPollConsumerScheduler()
Method Detail

getCamelContext

public CamelContext getCamelContext()
Description copied from interface: CamelContextAware
Get the CamelContext

Specified by:
getCamelContext in interface CamelContextAware
Returns:
camelContext the Camel context

setCamelContext

public void setCamelContext(CamelContext camelContext)
Description copied from interface: CamelContextAware
Injects the CamelContext

Specified by:
setCamelContext in interface CamelContextAware
Parameters:
camelContext - the Camel context

getInitialDelay

public long getInitialDelay()

setInitialDelay

public void setInitialDelay(long initialDelay)

getDelay

public long getDelay()

setDelay

public void setDelay(long delay)

getTimeUnit

public TimeUnit getTimeUnit()

setTimeUnit

public void setTimeUnit(TimeUnit timeUnit)

isUseFixedDelay

public boolean isUseFixedDelay()

setUseFixedDelay

public void setUseFixedDelay(boolean useFixedDelay)

getScheduledExecutorService

public ScheduledExecutorService getScheduledExecutorService()

setScheduledExecutorService

public void setScheduledExecutorService(ScheduledExecutorService scheduledExecutorService)

onInit

public void onInit(Consumer consumer)
Description copied from interface: ScheduledPollConsumerScheduler
Initializes this ScheduledPollConsumerScheduler with the associated Consumer.

Specified by:
onInit in interface ScheduledPollConsumerScheduler
Parameters:
consumer - the consumer.

scheduleTask

public void scheduleTask(Runnable task)
Description copied from interface: ScheduledPollConsumerScheduler
Schedules the task to run.

Specified by:
scheduleTask in interface ScheduledPollConsumerScheduler
Parameters:
task - the task to run.

unscheduleTask

public void unscheduleTask()
Description copied from interface: ScheduledPollConsumerScheduler
Attempts to unschedules the last task which was scheduled.

An implementation may not implement this method.

Specified by:
unscheduleTask in interface ScheduledPollConsumerScheduler

startScheduler

public void startScheduler()
Description copied from interface: ScheduledPollConsumerScheduler
Starts the scheduler.

If the scheduler is already started, then this is a noop method call.

Specified by:
startScheduler in interface ScheduledPollConsumerScheduler

isSchedulerStarted

public boolean isSchedulerStarted()
Description copied from interface: ScheduledPollConsumerScheduler
Whether the scheduler has been started.

Specified by:
isSchedulerStarted in interface ScheduledPollConsumerScheduler
Returns:
true if started, false otherwise.

doStart

protected void doStart()
                throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: See ServiceSupport.doStop() for more details.

Specified by:
doStart in class ServiceSupport
Throws:
Exception
See Also:
ServiceSupport.doStop()

doStop

protected void doStop()
               throws Exception
Description copied from class: ServiceSupport
Implementations override this method to support customized start/stop.

Important: Camel will invoke this ServiceSupport.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.

Specified by:
doStop in class ServiceSupport
Throws:
Exception
See Also:
ServiceSupport.doStart()

doShutdown

protected void doShutdown()
                   throws Exception
Description copied from class: ServiceSupport
Implementations override this method to perform customized shutdown.

Overrides:
doShutdown in class ServiceSupport
Throws:
Exception


Apache Camel