[ENH] StartUp/ShutDown - less than perfect

Mats Nygren nygren at sics.se
Thu Jun 1 16:04:48 UTC 2000


Hi,

It seems to be a bad idea to have two separate lists StartUpList,
ShutDownList for closing and reopening the image. This invites problems:

SoundPlayer - stops on save doesnt start again
  Solution: add it to StartUpList
  I havent tried this.
PWS - Stops on ShutDown, doesnt start on StartUp.
  Solution: add it to StartUpList. (In SystemDictionary
class>>initialize)
  This I have tried, see manual ChangeSet below. The PWS will then
continue to run until stopped. Try starting it, save and quit, restart,
it will run again.

There is obviously a general pattern here, whatever is frosen on
shutdown should be thawed on startup.

Better to have one list. It could be called FreezeList for instance.
Send startUp in order at startup, send shutDown in reverse order at
shutdown. The default will then be that things continue to work
transcending save/restore.

Questions:

Why is this initialized within SystemDictionary not in
aClass>>initialize?

Why is this restricted to classes? Why not give any object that wants it
shutDown/startUp messages?

/Mats Nygren

--  ChangeSet (kind of)  --

"
SystemDictionary class>>initialize
add:
	Smalltalk addToStartUpList: PWS.
before:
	Smalltalk addToStartUpList: ImageSegment.
"

'From Squeak2.8alpha of 12 May 2000 [latest update: #2158] on 1 June
2000 at 3:56:00 pm'!

!PWS class methodsFor: 'Serving' stamp: 'mn 5/18/2000 17:35'!
startUp
   "PWS startUp"
	"rewrite howTOStart a little"
	"of course 8080 and log.txt should be changed to the actual values"
   PWS serveOnPort: 8080 loggingTo: 'log.txt'
! !





More information about the Squeak-dev mailing list