Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Scheduler application architecture  RSS feed

 
Qand Davaatsedev
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:
I need to create J2EE application that should every day grab some information from the database, write it in a file and send this file to the ftp server.
Could you recommend me better solution?
Is it possible no window exists while application is running in order nobody could close window accidentaly?
Thank you.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question is how to trigger the action, right?
1) You could use a sleeping thread, which would do the trick and then go to sleep for 24 hours.
2) You could use an OS specific scheduling service, like "cron" for UNIX, which would launch the application at a certain time of day/week/whatever.
3) You could use messaging (e.g. JMS capable application server with a Message Driven Bean initiating the activity)
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible no window exists while application is running in order nobody could close window accidentaly?
I think you'll need to tell us a bit more about what systems you are considering for running this. Not all operating systems open a "window" for every process.
Is there any particular reason why this has to be a J2EE application (other than you wanted to say something in this forum, of course )? On a Linux/Unix system this could be done in a simple shell script. If you want a aolution which runs on lots of different platforms, you could pretty easily write an Ant script to do it.
Please let us know a bit more about how you are thinking of deploying and using this process.
 
JeanLouis Marechaux
Ranch Hand
Posts: 906
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Lasse Koskela:
The question is how to trigger the action, right?
1) You could use a sleeping thread, which would do the trick and then go to sleep for 24 hours.
2) You could use an OS specific scheduling service, like "cron" for UNIX, which would launch the application at a certain time of day/week/whatever.
3) You could use messaging (e.g. JMS capable application server with a Message Driven Bean initiating the activity)

Or you can wait for EJB 2.1 container.
My understanding is that the timer service of the TimedObject could help you
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"qand",
Thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile accordingly.
Thanks!
Simon
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!