🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to close one java console from other?

#1899
From: C. Lamont Gilbert
Date: Tue, 07 Aug 2001 03:15
67 lines
2790 bytes
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: <3b6f5e94_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!62.112.0.25!newsfeed.online.be!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews
References: <3b6e8071_1@dnews> <3b6e842b_1@dnews> <3b6f1dac_2@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:41:55 PST
From: "C. Lamont Gilbert" <Lamont_Gilbert @ RigidSoftware.com>
Newsgroups: borland.public.jbuilder.java.api
References: <3b6e8071_1@dnews> <3b6e842b_1@dnews> <3b6f1dac_2@dnews>
Subject: Re: How to close one java console from other?
Date: Mon, 6 Aug 2001 23:15:41 -0400
Lines: 69
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4522.1200
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
NNTP-Posting-Host: 24.181.226.14
Message-ID: <3b6f5e94_1@dnews>
X-Trace: dnews 997154452 24.181.226.14 (6 Aug 2001 20:20:52 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!62.112.0.25!newsfeed.online.be!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews