wood burning stoves
The moose likes Other Application Frameworks and the fly likes Using Spring and Quartz Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "Using Spring and Quartz" Watch "Using Spring and Quartz" New topic

Using Spring and Quartz

Paola Orsini

Joined: Sep 21, 2007
Posts: 2
Hi I am new in Spring and a little bit in quartz, I am trying to do a hello world but nothing happens, I greate a web proyect with spring and struts and I want too use quartz


package example;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class ExampleJob extends QuartzJobBean {

private int timeout;

* Setter called after the ExampleJob is instantiated
* with the value from the JobDetailBean (5)
public void setTimeout(int timeout) {
this.timeout = timeout;

protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {


<bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="example.ExampleJob" />
<property name="jobDataAsMap">
<entry key="timeout" value="5" />
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<!-- see the example of method invoking job above -->
<property name="jobDetail" ref="exampleJob" />
<!-- 10 seconds -->
<property name="startDelay" value="0" />
<!-- repeat every 50 seconds -->
<property name="repeatInterval" value="5000" />
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<ref bean="simpleTrigger" />

But nothing happens when I start the proyect(I mean the proyects starts correctly but I dont see the message), it suppones to see in console the message???
I star
I agree. Here's the link: http://aspose.com/file-tools
subject: Using Spring and Quartz
jQuery in Action, 3rd edition