T
- is the type of the scheduler job (what is the scheduler going to execute)public abstract class SchedulerFactory<T extends Runnable> extends Object implements MuleContextAware
Factory of schedulers. Every Scheduler should be created by a SchedulerFactory if the creation process allows post creation hooking.
Once the Factory creates a scheduler it calls a set of SchedulerFactoryPostProcessor
that might affect the
instance of the scheduler.
The SchedulerFactory
also registers the Scheduler
into the mule registry.
Modifier and Type | Field and Description |
---|---|
protected MuleContext |
context
Mule context.
|
protected Log |
logger |
Constructor and Description |
---|
SchedulerFactory() |
Modifier and Type | Method and Description |
---|---|
Scheduler |
create(String name,
T job)
Creates a scheduler for a job and runs all the registered post processors.
|
protected abstract Scheduler |
doCreate(String name,
T job)
Template method to delegate the creation of the
Scheduler . |
void |
setMuleContext(MuleContext context) |
protected transient Log logger
protected MuleContext context
Mule context. Should never be null. In case of being null then the post processing is discarded
public final Scheduler create(String name, T job) throws SchedulerCreationException
Creates a scheduler for a job and runs all the registered post processors.
job
- The Scheduler
job that has to be executed.name
- The Scheduler
name. This name is the one that is going to be use to register the Scheduler
in the MuleRegistry
Scheduler
. It must never be null.SchedulerCreationException
- In case after creating and post processing the Scheduler
it is null or
in case a SchedulerFactoryPostProcessor
fails.public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.