This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes Running J2EE code on timed event - how? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Running J2EE code on timed event - how?" Watch "Running J2EE code on timed event - how?" New topic
Author

Running J2EE code on timed event - how?

Daniel Bovenzi
Greenhorn

Joined: Sep 18, 2002
Posts: 1
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.


...etc etc etc...
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
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.
pjoisha
Ranch Hand

Joined: Mar 06, 2001
Posts: 123
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.
 
subject: Running J2EE code on timed event - how?
 
Similar Threads
unable to create directory using ftp task
problem in deplying the file on server
FTP USING RUNTIME CLASS
FTP Request through url.
How to copy a file from linux to windows and vise versa using java swing