File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes creating periodic processes in WebSphere Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "creating periodic processes in WebSphere" Watch "creating periodic processes in WebSphere" New topic
Author

creating periodic processes in WebSphere

Ted J Schrader
Greenhorn

Joined: Oct 10, 2001
Posts: 28
I have been wondering if creating periodic processes in WebSphere is possible. For instance, suppose that every 3rd business day of each month I would like the system to create a flat file which is then used by an external system.
I am having a bit of trouble finding options in books and documentation. Any ideas or suggestions to reference material will be greatly appreciated.
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
There is nothing in Websphere to help you here. Your best bet is to write a Java client to invoke a WebSphere object (a servlet or (more likely) an EJB and then start the Java client off with a cron job on a schedule.
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
Ted J Schrader
Greenhorn

Joined: Oct 10, 2001
Posts: 28
Thanks for your advice, Kyle.
Could you provide an argument against doing the following:
Referring to Startup Sequence, page 472 in "Enterprise Java Programming with IBM WebSphere," which describes the use of the StartupCapable interface -
I create a class that will implement the StartupCapable interface to perform application startup tasks. In this StartupCapable Impl class, I instantiate another class that will start a continuously-running thread to determine if today is the 3rd business day to start the file creation process.
It would seem like this periodic thread would be automatically started anytime the web application is started.
I would appreciate any thoughts on this scenario.
Ted
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3878
Sigh... My own words come back to haunt me...
The reason I wouldn't recommend this is that you're reinventing the wheel. Why recreate cron when cron exists and has been debugged perfectly well over the past 30 years?
It might be tough to come up with a class that can kick off your processing exactly when you want if you consider that you'll have to deal with:
(a) multiple possible jobs being kicked off
(b) the possibility of webapp restart
(c) the possibility of clones (>1 servers running identical code).
StartupCapable is meant to do things internal to the server like setting up caches, not act as a replacement for Cron....
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
Ted J Schrader
Greenhorn

Joined: Oct 10, 2001
Posts: 28
Thanks again for your thoughts, Kyle.
I must confess my ignorance of the reference to Cron. My assumption right now is that I would work with the server OS (in this case, Windows NT) to schedule the flat-file generation process kick-offs.
Could you point out any reference material about the Cron topic?
With much gratitude,
Ted
James Swan
Ranch Hand

Joined: Jun 26, 2001
Posts: 403
"at" is an NT equivalent of cron to allow scheduling of jobs.
From the NT cmd line try:
at /help
 
 
subject: creating periodic processes in WebSphere
 
Threads others viewed
IBM Websphere 4.0, JNDI, server groups
Invalidate session when browser is closed
Why iPod requires internet access ?
Get a list of Processes
Why threads are light weight
developer file tools