[jboss-user] [JBoss Seam] - Re: Quartz TimerService
msduk
do-not-reply at jboss.com
Sat Dec 16 08:20:36 EST 2006
This worked fine for me. I have the quartz jar in the lib folder and I believe that was it. This is on 4.0.5 GA.
I noticed that I have jobs.xml, .properties and the xsd in my WEB-INF from an earlier attempt to run it the non-ejb way. Maybe it requires this?
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "cronTrigger", propertyValue = "0/15 * * * * ?") })
| @ResourceAdapter("quartz-ra.rar")
|
| public class TestQuartzTarget implements Job {
|
| @PersistenceContext
| EntityManager em;
|
| private static final Logger log = Logger
| .getLogger(TestQuartzTarget.class);
|
| public PendingOrderQuartzTarget() {
| super();
| System.out.println("Quartz-bean is constructed()");
| }
|
| public void execute(JobExecutionContext jobExecutionContext)
| throws JobExecutionException {
|
| long start = System.currentTimeMillis();
|
| log.debug(this.getClass().getName() + " STARTING RUN");
| log.debug(em);
|
| //Do your work here
|
| log.debug(this.getClass().getName() + " FINISHING RUN");
| log.debug("RUNTIME: " + (System.currentTimeMillis() - start) + " ms");
| }
|
| }
>From web.xml
<servlet>
| <servlet-name>QuartzInitializer</servlet-name>
| <servlet-class>org.quartz.ee.servlet.QuartzInitializerServlet</servlet-class>
|
| <init-param>
| <param-name>config-file</param-name>
| <param-value>quartz-nrg2.properties</param-value>
| </init-param>
|
| <init-param>
| <param-name>shutdown-on-unload</param-name>
| <param-value>true</param-value>
| </init-param>
|
| <init-param>
| <param-name>start-scheduler-on-load</param-name>
| <param-value>true</param-value>
| </init-param>
| <load-on-startup>1</load-on-startup>
| </servlet>
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3994405#3994405
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3994405
More information about the jboss-user
mailing list