File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes Spring Quartz application in JBoss Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Spring Quartz application in JBoss" Watch "Spring Quartz application in JBoss" New topic
Author

Spring Quartz application in JBoss

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Hi,

I have a Quartz application that is deployed to a JBoss server as a high standalone application,

The Quartz application is deployed to JBoss as a Message Driven EJB through declared in ejb-jar.xml,

But I would like to remove the EJB concept within the application and use Spring Quartz,

But any ideas or information on how to deploy a Spring Quartz application to JBoss as a high standalone application?

Thanks in Advance,

Niall
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Spring has Quartz support.

I don't have my regular Eclipse running now, but later I can share an example.

WP
Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 208
Thanks WP, any and all advice would be great,

Cheers,

Niall
Ken Rimple
author
Ranch Hand

Joined: Jul 20, 2010
Posts: 63

Spring now has a scheduling annotation feature. You can either use Quartz or use Spring Scheduling.

You'd have to set up a Spring context - look into the ContextLoaderListener (google it, for an example) - you mount it in your web.xml, and it will load a Spring configuration that you point to.

For example, you could use this setup:

/ (web root)

-- WEB-INF
-- spring
--- applicationContext.xml

Then use the path:
/WEB-INF/spring/applicationContext.xml when configuring the ContextLoaderListener parameters.

Ok, once that is done (again, plenty on setting up this in web.xml on Google) you can set up beans to fire via Quartz or by Spring's scheduler options. See this page for details:

http://static.springsource.org/spring/docs/3.0.5.RELEASE/reference/scheduling.html

See 25.6 for all the details you need to use quartz. You'll need to import the Quartz jars, but beyond that, this may really do it for you:

25.6.3: here are two types of quartz jobs you can schedule - direct from the documentation above.



SO access to simple repeating jobs, CRON syntax support, using Quartz jobs.

It really is a nice feature of the framework.

You should also check out @Scheduled and @Async - you can annotate a method async and have it run outside of your thread. Pretty nifty for certain 'fire and forget' operations where normally you needed to set up JMS and a queue in the past.


Ken Rimple
ken.rimple@gmail.com
Co-author, Manning Spring Roo in Action
I teach for Chariot Solutions (Spring, Maven, Hibernate, other courses). Schedule here
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spring Quartz application in JBoss