org.apache.camel.component.quartz
Class QuartzEndpoint

java.lang.Object
  extended by org.apache.camel.impl.DefaultEndpoint
      extended by org.apache.camel.component.quartz.QuartzEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, HasId

public class QuartzEndpoint
extends DefaultEndpoint
implements Service

A Quartz Endpoint

Version:
$Revision:520964 $

Constructor Summary
QuartzEndpoint(String endpointUri, QuartzComponent component)
           
 
Method Summary
 void addTrigger(org.quartz.Trigger trigger, org.quartz.JobDetail detail)
           
 void consumerStarted(QuartzConsumer consumer)
           
 void consumerStopped(QuartzConsumer consumer)
           
 QuartzConsumer createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
protected  String createEndpointUri()
          A factory method to lazily create the endpointUri if none is specified
 Exchange createExchange(org.quartz.JobExecutionContext jobExecutionContext)
           
protected  org.quartz.JobDetail createJobDetail()
           
protected  LoadBalancer createLoadBalancer()
           
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 QuartzComponent getComponent()
           
 org.quartz.JobDetail getJobDetail()
           
protected  String getJobName()
           
 LoadBalancer getLoadBalancer()
           
 org.quartz.Trigger getTrigger()
           
 boolean isSingleton()
          Whether this class supports being singleton or not.
 boolean isStateful()
           
 void onJobExecute(org.quartz.JobExecutionContext jobExecutionContext)
          This method is invoked when a Quartz job is fired.
 void removeTrigger(org.quartz.Trigger trigger, org.quartz.JobDetail detail)
           
 void setJobDetail(org.quartz.JobDetail jobDetail)
           
 void setLoadBalancer(LoadBalancer loadBalancer)
           
 void setStateful(boolean stateful)
           
 void setTrigger(org.quartz.Trigger trigger)
           
 void start()
          Starts the service
 void stop()
          Stops the service
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureProperties, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, getId, hashCode, isLenientProperties, isSynchronous, sanitizeUri, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QuartzEndpoint

public QuartzEndpoint(String endpointUri,
                      QuartzComponent component)
Method Detail

addTrigger

public void addTrigger(org.quartz.Trigger trigger,
                       org.quartz.JobDetail detail)
                throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

removeTrigger

public void removeTrigger(org.quartz.Trigger trigger,
                          org.quartz.JobDetail detail)
                   throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

onJobExecute

public void onJobExecute(org.quartz.JobExecutionContext jobExecutionContext)
                  throws org.quartz.JobExecutionException
This method is invoked when a Quartz job is fired.

Parameters:
jobExecutionContext - the Quartz Job context
Throws:
org.quartz.JobExecutionException

createExchange

public Exchange createExchange(org.quartz.JobExecutionContext jobExecutionContext)

createProducer

public Producer createProducer()
                        throws Exception
Description copied from interface: Endpoint
Creates a new producer which is used send messages into the endpoint

Specified by:
createProducer in interface Endpoint
Returns:
a newly created producer
Throws:
Exception - can be thrown

createConsumer

public QuartzConsumer createConsumer(Processor processor)
                              throws Exception
Description copied from interface: Endpoint
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor

Specified by:
createConsumer in interface Endpoint
Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

createEndpointUri

protected String createEndpointUri()
Description copied from class: DefaultEndpoint
A factory method to lazily create the endpointUri if none is specified

Overrides:
createEndpointUri in class DefaultEndpoint

getJobName

protected String getJobName()

getComponent

public QuartzComponent getComponent()
Overrides:
getComponent in class DefaultEndpoint

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Specified by:
isSingleton in interface IsSingleton
Returns:
true to be a single shared instance, false to create new instances.

getLoadBalancer

public LoadBalancer getLoadBalancer()

setLoadBalancer

public void setLoadBalancer(LoadBalancer loadBalancer)

getJobDetail

public org.quartz.JobDetail getJobDetail()

setJobDetail

public void setJobDetail(org.quartz.JobDetail jobDetail)

getTrigger

public org.quartz.Trigger getTrigger()

setTrigger

public void setTrigger(org.quartz.Trigger trigger)

isStateful

public boolean isStateful()

setStateful

public void setStateful(boolean stateful)

consumerStarted

public void consumerStarted(QuartzConsumer consumer)
                     throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

consumerStopped

public void consumerStopped(QuartzConsumer consumer)
                     throws org.quartz.SchedulerException
Throws:
org.quartz.SchedulerException

createLoadBalancer

protected LoadBalancer createLoadBalancer()

createJobDetail

protected org.quartz.JobDetail createJobDetail()

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Overrides:
start in class DefaultEndpoint
Throws:
Exception - is thrown if starting failed

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Overrides:
stop in class DefaultEndpoint
Throws:
Exception - is thrown if stopping failed


Apache CAMEL