🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: an idea to consider

#935
From: Alan Shiers
Date: Sun, 07 Jul 2002 15:43
49 lines
3035 bytes
Hi Owen,

The fact that I would need to create a shell script anyway for launching
the program is a given.  I'm new to Linux so I have some work to do in
understanding how to do scripting. 

Aside from that, my only concern was shutting the server app off. If it
is running before login then there has to be some way to tell it to shut
off. The only thing I could think of was my idea of using a threaded
class with a ServerSocket object running off to the side, waiting for a
signal to connect long enough to get the signal to terminate the
program.

I've not heard of this ShutdownHook class.  It doesn't appear to be part
of the J2SDK library.  Is it a third party class freely available on the
Net or something?   

I'd like to know how it is implemented.  Maybe you've had experience
with this class before?  Is there examples someplace that show how to
use it?

I want to know more about it.

Alan

Owen Green wrote:
> 
> "Alan Shiers" <ashiers@hfx.eastlink.ca> wrote in message
> news:3D279D25.59AA52E@hfx.eastlink.ca...
> 
> >
> > Then I got the bright idea...why not encorporate a threaded class as
> > part of the server app that has another ServerSocket object in it set to
> > listen only to the loopback address (127.0.0.1).  Then include with the
> > program one additional class with its own main() method and a Socket
> > object, which I can use to execute solely for the purposes to
> > communicating with the running server app and tell it to shut down.
> >
> > That would work, wouldn't it?
> >
> > For those of you who are Linux savy, maybe you see some problems with
> > this?
> > I'd like to hear any comments you may have.
> The ShutdownHook class can be used to catch the KILL signal and do just that
> :)
> 
> You could knock up a nice shell script, like the one apache has, to have the
> start, stop etc. presented. This could be invoked in a startup script and /
> or from the command line.
Technical Details
Message-ID: <3D2861BB.63220DF5@hfx.eastlink.ca>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews
References: <3D279D25.59AA52E@hfx.eastlink.ca> <3d27a0b2_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,4157c064c52214d4
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2002-07-07 07:47:09 PST
Message-ID: <3D2861BB.63220DF5@hfx.eastlink.ca>
Date: Sun, 07 Jul 2002 11:43:55 -0400
From: Alan Shiers <ashiers@hfx.eastlink.ca>
Organization: Mustard Seed Software
X-Mailer: Mozilla 4.78 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.api
Subject: Re: an idea to consider
References: <3D279D25.59AA52E@hfx.eastlink.ca> <3d27a0b2_2@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 24.222.101.2
X-Trace: dnews 1026052883 24.222.101.2 (7 Jul 2002 07:41:23 -0700)
Lines: 49
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-08!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!fu-berlin.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!nntp.cs.uni-magdeburg.de!PeerFeed.KWeb.on.ca!dnews