image start - how to run code at image start

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

image start - how to run code at image start

squeakman
Greetings,

I would like to run some code when my image start up, before anything
else runs.  How does one do this?

Also, how does one detect an image shutdown and execute some code before
the image shuts down?

Thanks,
Frank


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: image start - how to run code at image start

Boris Popov, DeepCove Labs (SNN)
Have a look at Subsystem, its subclasses and references in the
AppDevGuide.pdf.

-Boris


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of squeakman
Sent: Thursday, February 02, 2012 10:01 AM
To: [hidden email]
Subject: [vwnc] image start - how to run code at image start

Greetings,

I would like to run some code when my image start up, before anything
else runs.  How does one do this?

Also, how does one detect an image shutdown and execute some code before
the image shuts down?

Thanks,
Frank


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: image start - how to run code at image start

Holger Guhl
Also have a look at class SystemEventInterest and its class method #example. The most prominent
events for image startup/shutdown are #returnFromSnapshot / #aboutToSnapshot.
But be careful: "before anything else runs" is a dangerous formula! For running your early code the
image needs to pass certain bootstrap phases. If your "anything else" is necessary system
initialization, you cannot do too much...

Regards,
Holger

Am 02.02.2012 16:17, schrieb Boris Popov, DeepCove Labs:

> Have a look at Subsystem, its subclasses and references in the
> AppDevGuide.pdf.
>
> -Boris
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of squeakman
> Sent: Thursday, February 02, 2012 10:01 AM
> To: [hidden email]
> Subject: [vwnc] image start - how to run code at image start
>
> Greetings,
>
> I would like to run some code when my image start up, before anything
> else runs.  How does one do this?
>
> Also, how does one detect an image shutdown and execute some code before
> the image shuts down?
>
> Thanks,
> Frank

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: image start - how to run code at image start

jarober
In reply to this post by squeakman
Also, if you want things to run based on command line arguments, look at class CommandLineInterest.  Using that with Subsystem (as Boris pointed out) can give you very good control over what an image does on startup.

On Feb 2, 2012, at 10:00 AM, squeakman wrote:

> Greetings,
>
> I would like to run some code when my image start up, before anything
> else runs.  How does one do this?
>
> Also, how does one detect an image shutdown and execute some code before
> the image shuts down?
>
> Thanks,
> Frank
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

James Robertson
http://www.jarober.com
[hidden email]




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: image start - how to run code at image start

Runar Jordahl
In reply to this post by squeakman
Hi Squeakman! Whoever you are...

You could run a text file with Smalltalk source code:
C:\<Path to VisualWorks>\vw7.7.1\bin\win\visual.exe MyImage.im
-filein "MyFileWithSmalltalk.st"

And you can send in Smalltalk code as argument:
C:\<Path to VisualWorks>\vw7.7.1\bin\win\visual.exe MyImage.im  -doit
"MyClass new doTheWork"

Examples are for Windows. Non-standard OSes might use different syntax ;-)

Runar
blog.epigent.com
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc