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 Servlets and the fly likes need some ideas 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 » Servlets
Bookmark "need some ideas" Watch "need some ideas" New topic
Author

need some ideas

Hongli Li
Ranch Hand

Joined: Oct 29, 2006
Posts: 124
Hi,
I'm running a standalone Java application to send tons of emails. The client wants to have a GUI tool for "easier" control and friendly interface. The process sometimes takes up to 24 hours to complete since there are hundreds and thousands of emails need to be sent. I want to develop some jsp page with servlets for this. When user clicks on some button or link then the mailing process will kick off, my question is how to interrupt the process
when client wants to stop the process in case they make some mistakes? Is it a good idea to convert those command line tool to a Web-based application?

thanks

Hongli


Do you know why this cup is useful? Because it is empty.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

Whenever I've done something like this, I do not do the real work in the web application. Rather, the web app only serves as a control panel, and the real work is done by a daemon process running somewhere on the server (or even another server).

I usually use a DB as the communication tool between the two parts, but other means can be used.

The two processes are uncoupled and know nothing about each other. Each just uses the DB to set up and control the jobs.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Hongli Li
Ranch Hand

Joined: Oct 29, 2006
Posts: 124
thanks Bear, I will do it the DB way, what I planed before was I create some dummy file in tmp folder in case of interruption, then my mail daemon will constantly check the file existence, if it exits, then I will stop otherwise resume.

Regards
Hongli
[ January 07, 2008: Message edited by: Hongli Li ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60764
    
  65

I like the DB approach because it provides automatic transaction locking.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: need some ideas
 
Similar Threads
In there any install tool for installing ear file?????
General design questions reading emails
need help regd config.xml
jre when accessing java war application
Generating "BIG" email using Javascript