org.mule.transport.polling.schedule
Class FixedFrequencyScheduler<T extends Runnable>

java.lang.Object
  extended by org.mule.transport.polling.schedule.PollScheduler<T>
      extended by org.mule.transport.polling.schedule.FixedFrequencyScheduler<T>
All Implemented Interfaces:
Disposable, Initialisable, Lifecycle, Startable, Stoppable, NameableObject, NamedObject, Scheduler

public class FixedFrequencyScheduler<T extends Runnable>
extends PollScheduler<T>

Scheduler that runs a task giving a fixed period of time.

Since:
3.5.0

Field Summary
protected  Log logger
           
 
Fields inherited from class org.mule.transport.polling.schedule.PollScheduler
job, name
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Constructor Summary
FixedFrequencyScheduler(String name, long frequency, long startDelay, T job, TimeUnit timeUnit)
           
 
Method Summary
 void dispose()
           Checks that the executor is terminated and, if not, it terminates the scheduling abruptly
 long getFrequency()
           
 TimeUnit getTimeUnit()
           
 void initialise()
           Creates the executor that is going to be used to launch schedules
 void schedule()
           Executes the the Scheduler task
 void start()
           Starts the Scheduling of a Task.
 void stop()
           Stops the Scheduling of a Task.
 
Methods inherited from class org.mule.transport.polling.schedule.PollScheduler
getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected transient Log logger
Constructor Detail

FixedFrequencyScheduler

public FixedFrequencyScheduler(String name,
                               long frequency,
                               long startDelay,
                               T job,
                               TimeUnit timeUnit)
Method Detail

initialise

public void initialise()
                throws InitialisationException

Creates the executor that is going to be used to launch schedules

Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

start

public void start()
           throws MuleException

Starts the Scheduling of a Task. Can be called several times, if the Scheduler is already started or if it is starting then the start request is omitted

Throws:
MuleException

stop

public void stop()
          throws MuleException

Stops the Scheduling of a Task. Can be called several times, if the Scheduler is already stopped or if it is stopping then the stop request is omitted

Throws:
MuleException

schedule

public void schedule()
              throws MuleException

Executes the the Scheduler task

Throws:
MuleException

dispose

public void dispose()

Checks that the executor is terminated and, if not, it terminates the scheduling abruptly


getFrequency

public long getFrequency()

getTimeUnit

public TimeUnit getTimeUnit()


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.