org.apache.camel.component.quartz2
Class QuartzComponent

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultComponent
          extended by org.apache.camel.component.quartz2.QuartzComponent
All Implemented Interfaces:
org.apache.camel.CamelContextAware, org.apache.camel.Component, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.StartupListener, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class QuartzComponent
extends org.apache.camel.impl.DefaultComponent
implements org.apache.camel.StartupListener

A factory for QuartzEndpoint. This component will hold a Quartz Scheduler that will provide scheduled timer based endpoint that generate a QuartzMessage to a route. Currently it support Cron and Simple trigger scheduling type.

This component uses Quartz 2.x API and provide all the features from "camel-quartz". It has reused some of the code, but mostly has been re-written in attempt to be more easier to maintain, and use Quartz more fully.


Field Summary
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
QuartzComponent()
           
QuartzComponent(org.apache.camel.CamelContext camelContext)
           
 
Method Summary
protected  org.apache.camel.Endpoint createEndpoint(String uri, String remaining, Map<String,Object> parameters)
           
protected  String createInstanceName(Properties prop)
           
protected  void doStart()
           
protected  void doStop()
           
 Properties getProperties()
           
 String getPropertiesFile()
           
 org.quartz.Scheduler getScheduler()
           
 org.quartz.SchedulerFactory getSchedulerFactory()
           
 int getStartDelayedSeconds()
           
 boolean isAutoStartScheduler()
           
 boolean isClustered()
          Is the quartz scheduler clustered?
 boolean isEnableJmx()
           
 boolean isPrefixJobNameWithEndpointId()
           
 void onCamelContextStarted(org.apache.camel.CamelContext context, boolean alreadyStarted)
           
 void setAutoStartScheduler(boolean autoStartScheduler)
           
 void setEnableJmx(boolean enableJmx)
           
 void setPrefixJobNameWithEndpointId(boolean prefixJobNameWithEndpointId)
           
 void setProperties(Properties properties)
           
 void setPropertiesFile(String propertiesFile)
           
 void setScheduler(org.quartz.Scheduler scheduler)
           
 void setSchedulerFactory(org.quartz.SchedulerFactory schedulerFactory)
           
 void setStartDelayedSeconds(int startDelayedSeconds)
           
 
Methods inherited from class org.apache.camel.impl.DefaultComponent
afterConfiguration, createComponentConfiguration, createConfiguration, createEndpoint, getAndRemoveOrResolveReferenceParameter, getAndRemoveOrResolveReferenceParameter, getAndRemoveParameter, getAndRemoveParameter, getCamelContext, ifStartsWithReturnRemainder, preProcessUri, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceListParameter, resolveAndRemoveReferenceParameter, resolveAndRemoveReferenceParameter, setCamelContext, setProperties, useIntrospectionOnEndpoint, useRawUri, validateParameters, validateURI
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, 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
 

Constructor Detail

QuartzComponent

public QuartzComponent()

QuartzComponent

public QuartzComponent(org.apache.camel.CamelContext camelContext)
Method Detail

getStartDelayedSeconds

public int getStartDelayedSeconds()

isAutoStartScheduler

public boolean isAutoStartScheduler()

setStartDelayedSeconds

public void setStartDelayedSeconds(int startDelayedSeconds)

setAutoStartScheduler

public void setAutoStartScheduler(boolean autoStartScheduler)

isPrefixJobNameWithEndpointId

public boolean isPrefixJobNameWithEndpointId()

setPrefixJobNameWithEndpointId

public void setPrefixJobNameWithEndpointId(boolean prefixJobNameWithEndpointId)

isEnableJmx

public boolean isEnableJmx()

setEnableJmx

public void setEnableJmx(boolean enableJmx)

getProperties

public Properties getProperties()

getPropertiesFile

public String getPropertiesFile()

setProperties

public void setProperties(Properties properties)

setPropertiesFile

public void setPropertiesFile(String propertiesFile)

getSchedulerFactory

public org.quartz.SchedulerFactory getSchedulerFactory()
                                                throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

createInstanceName

protected String createInstanceName(Properties prop)

isClustered

public boolean isClustered()
                    throws org.quartz.SchedulerException
Is the quartz scheduler clustered?

Throws:
org.quartz.SchedulerException

setSchedulerFactory

public void setSchedulerFactory(org.quartz.SchedulerFactory schedulerFactory)

getScheduler

public org.quartz.Scheduler getScheduler()

setScheduler

public void setScheduler(org.quartz.Scheduler scheduler)

createEndpoint

protected org.apache.camel.Endpoint createEndpoint(String uri,
                                                   String remaining,
                                                   Map<String,Object> parameters)
                                            throws Exception
Specified by:
createEndpoint in class org.apache.camel.impl.DefaultComponent
Throws:
Exception

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class org.apache.camel.impl.DefaultComponent
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class org.apache.camel.impl.DefaultComponent
Throws:
Exception

onCamelContextStarted

public void onCamelContextStarted(org.apache.camel.CamelContext context,
                                  boolean alreadyStarted)
                           throws Exception
Specified by:
onCamelContextStarted in interface org.apache.camel.StartupListener
Throws:
Exception


Apache Camel