This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Running J2EE code on timed event - how?

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the best mechanism to run a piece of code on a J2EE box at regular intervals?
Is this covered by the J2EE spec or would, for instance, a "scheduled servlet/EJB" be vendor specific functionality?
For background info:
I am trying to develop an FTP feed that will run every 30 mins (probably no an IBM WS4 box), pull in XML docs via FTP and inset data into an RDBMS.
I have the FTP->XML->JDBC code sorted - I just need to put it into something that will run on a schedule.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This will be explicitly covered in EJB 2.1. For now we accomplish this using JMX with Timer MBeans, it is pretty powerful. You could also use a product such as Quartz or Flux.
 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For EJB 1.1 based servers one plausible solution
is to Timer class in one of your helper classes ...
PJ
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!