• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Spring Quartz application in JBoss

 
Ranch Hand
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 859
IBM DB2 Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 209
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks WP, any and all advice would be great,

Cheers,

Niall
 
author
Posts: 63
Mac OS X Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic