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
posted
0
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.
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
posted
0
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
posted
0
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
posted
0
"at" is an NT equivalent of cron to allow scheduling of jobs. From the NT cmd line try: at /help