🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #1900

Re: How to close one java console from other?

#1900
From: Enrique Rodríguez
Date: Tue, 07 Aug 2001 03:50
85 lines
3259 bytes
It's nice to have comments from others. I learned A LOT reading coments!

I admit that the method that I proposed it's somewhat drastic, but very 
simple to implements!

If I must decide which method to use, I'll choose sockets. It's reliabe and 
doesn't require the rmiregistry running.

Of course, comments are wellcome! :)

Quique.-

C. Lamont Gilbert wrote:

> I assumed he meant politely,  not Rudely!  :-)
> 
> seriously though, i though he meant programatically, non run away/lock up
> type of thing.
> 
> 
> 
> "Enrique Rodr�guez" <anakin@conectate.com.uy> wrote in message
> news:3b6f1dac_2@dnews...
>> Another aproach is to send a KILL signal to the JVM and catch it with a
>> shutdown hook.
>>
>> // somewhere in the daemon (server) initilizing code.
>> Runtime.getRuntime().addShutdownHook(new Thread() {
>>         public void run() {
>>                 // here goes the cleanup code.
>>         }
>> });
>>
>> I have using this aproach for a while and it worked ok.
>>
>> To send a SIGKILL form an UNIX like OS, just type kill <pid> where pid is
>> the process id of the JVM. To get the pid use the ps command.
>>
>> I've created one shell script wich takes the start and the stop
>> parameter.
>>
>> Some times, for some reason, the JVM doesn't get killed and i must kill
>> it with kill -9. If some one knows... I think this is a Blackdown's port
>> "feature" :)
>>
>> I'm using JDK 1.3.0 from Blackdown in Linux 2.2.17.
>>
>> I don't know how to kill an application from window's dos box. If some
>> one knows, please tell me! I'm curious :)
>>
>> Quique
>>
>> C. Lamont Gilbert wrote:
>>
>> > RMI seems like the most organized way in this instance.
>> >
>> >
>> >
>> > "Andrey Ptashinskiy" <ptash@mail.ru> wrote in message
>> > news:3b6e8071_1@dnews...
>> >> Hi, All!
>> >> How to close one java console from other? For example, like Tomcat.
>> >> I have some thoughts, to use:
>> >>     1. socket for sending some message
>> >>     2. RMI
>> >>
>> >> Details:
>> >> I have some MyClass
>> >> To run it: "java MyClass -start"
>> >> It run in the same console. But I need to stop execution. It may be
> made
>> >> from other console.
>> >> For example: "java MayClass -stop"
>> >>
>> >> What can you offer?
>> >> Andrey.
>> >>
>> >>
>> >
>> >
>> >
>>
> 
> 
> 
Technical Details
Message-ID: <3b6f65c8_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews
References: <3b6e8071_1@dnews> <3b6e842b_1@dnews> <3b6f1dac_2@dnews> <3b6f5e94_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1089d0,9288e0cb92bd8828
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2001-08-06 20:57:52 PST
From: Enrique Rodríguez <anakin@conectate.com.uy>
Subject: Re: How to close one java console from other?
Newsgroups: borland.public.jbuilder.java.api
Date: Tue, 7 Aug 2001 00:50:40 -0300
References: <3b6e8071_1@dnews> <3b6e842b_1@dnews> <3b6f1dac_2@dnews> <3b6f5e94_1@dnews>
Lines: 86
User-Agent: KNode/0.4
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8Bit
NNTP-Posting-Host: 200.40.25.37
Message-ID: <3b6f65c8_1@dnews>
X-Trace: dnews 997156296 200.40.25.37 (6 Aug 2001 20:51:36 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!128.230.129.106!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews