Start & stop a Java server

Start & stop a Java server

Post by GArlingto » Sat, 06 Sep 2008 20:26:36

Implement start(), stop() and restart() methods...
Read a little about how httpd [for example] processes those...
Not sure how you want to use "ant" here, do you intend to write
separate classes and run them to start and stop Server class???
Maybe starting the Server and allowing it to read stdin (or other
input, maybe control file?) and process the commands read will be a
better option.

Start & stop a Java server

Post by Sabine Din » Sat, 06 Sep 2008 20:30:24

You can try to do it yourself [1] or use a premade solution [2]. We use
the latter and it works just fine.

[1] < ;
[2] < ;
< ;

Do a search for "java daemon"

Sabine Dinis Blochberger



Start & stop a Java server

Post by Roedy Gree » Mon, 08 Sep 2008 19:00:12

On Fri, 5 Sep 2008 04:01:42 -0700 (PDT), jonbbbb < XXXX@XXXXX.COM >
wrote, quoted or indirectly quoted someone who said :

If it has a GUI, an event can stop the program.

You can have the program look for a file sleep and look again. You
then use a little bat file to create the request to stop file.

You can send it a special "inquiry" that is a command to shut down. It
would need a password to prevent misuse.

If you are using a canned servlet womb, read the docs on how to do a
graceful shutdown.

Roedy Green Canadian Mind Products
The Java Glossary