简体   繁体   中英

Java Daemon step by step

Almost finished my java web app. All working fine. Whats next. I need now to write some kind of process that runs in back ground to take care of some regular manteinance and send some tweets in a regular basis. From google you can find out that Daemon is the right way.

Can anyone guide me step by step how to accomplish this? 1- Writing the program. 2- And then put it into run in a linux enviroment. (Keeping it runing if i logoff as user. As Tomcat does). 3- If possible start it at linux starts regardless i logon or not. A URL to a good tutorial will help a lot.

Bad news is that my development enviroment is my windows notebook and my production enviroment is Ubunto (Not sure if i can test daemon threads in windows).

Good news is that have the production server in my house at 4 meters from where i am writing this:)

Thank you very much in advance.

It's probably easier - and cross platform - to just put that stuff inside your Tomcat server. Check out the Quartz scheduler , it does what cron does and more, is easily integrated in a web app and allows you to call jobs written in Java without any complicated plumbing. As an added advantage, these jobs are deployable just like any other web app in Tomcat.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM