This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Guys , i am writing some Java program that requires to run for ever unless the user wants to stop it. How can i stop java VM from terminating ??? Can u people give me some idea of Keep-Alive Mechanism or something ??
I'm not sure what ServiceHost or UserService mean to you. "server" is nicely defined as a process that waits for connections and/or requests from clients. A server usually runs in some kind of loop. Does your server look something like:
If so, it should loop until you set the "running flag" to false somehow. Does that sound like it meets your needs? [ April 05, 2006: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Jul 04, 2005
Not exactly... It's a kind of Service host where u can host defferent Services like - say one Mailing Service , Data gathering Service etc.
but if i want to stop the Host i would say [ctrl+c] AS I STOP Jboss app-server . The catch is how can i sense that the user has pressed in the Java code.
The Service Host wil run from the DOS command prompt.
Joined: Jan 29, 2003
I'm not answering the Ctrl-C question partly because I don't know but mostly because I wouldn't encourage users to do that if I could help it, which explains why I never bothered to figure it out.