public class CronScheduler extends PollScheduler<PollingReceiverWorker> implements MuleContextAware
Cron Scheduler
implemented with Quartz.
Modifier and Type | Field and Description |
---|---|
protected Log |
logger |
static String |
POLL_CRON_SCHEDULER_JOB |
static String |
THREAD_POLL_CLASS |
static String |
THREAD_POLL_CLASS_PROPERTY |
static String |
THREAD_POOL_COUNT_PROPERTY |
job, name
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
CronScheduler(String name,
PollingReceiverWorker job,
String cronExpression) |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
String |
getCronExpression() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
schedule()
Launches the action asynchronously.
|
void |
setMuleContext(MuleContext context) |
void |
start() |
void |
stop() |
getName, setName
protected transient Log logger
public static final String THREAD_POLL_CLASS_PROPERTY
public static final String THREAD_POLL_CLASS
public static final String THREAD_POOL_COUNT_PROPERTY
public static final String POLL_CRON_SCHEDULER_JOB
public CronScheduler(String name, PollingReceiverWorker job, String cronExpression)
public void schedule() throws Exception
Scheduler
Launches the action asynchronously. The time can or can't be immediate depending on the Scheduler implementation.
By default, schedulers users can use a scheduler not matter if it is started or stopped. By default the Scheduler implementation should schedule a job regardless of it lifecycle state. If this is not accepted then check Scheduler state and throw exception.
public void dispose()
Disposable
dispose
in interface Disposable
public void initialise() throws InitialisationException
Initialisable
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
InitialisationException
- if a fatal error occurs causing the Mule instance to shutdownRecoverableException
- if an error occurs that can be recovered frompublic void start() throws MuleException
start
in interface Startable
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
public String getCronExpression()
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.