Stopping Java Application - Urgent please

I am writing a Java application which will run in the background continuosly with some time interval .

My code goes like this

public class Task1 extends TimerTask {

run(){

// Code to be repeated will be placed here

}

If I want to stop the program , what is the way ? (Except Ctrl+C). I want to have a program like "tomcat start" and "tomcat stop" .How to write such program . Please give hints .

Thanks in advance...

Regards,

Ravi

[519 byte] By [ravish.k] at [2007-9-26 3:01:42]
# 1

this program could be a daeamon. For instance you create a thread that read the command line. If you write "stop" then it stops the current TimerTask and makes a System.exit()

If you want a sample of such a program, contact me if you want (stephane.nicoll@mail.be)

You have to be aware that this program must run while your application is running. In fact the daemon pilots timertask. It's simple!

Hope it helps,

Stephane

-DarkLord- at 2007-6-29 11:00:01 > top of Java-index,Archived Forums,Java Programming...