• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

need some ideas

 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Hongli Li
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64721
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like the DB approach because it provides automatic transaction locking.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic