Launch a service to start the image

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

Launch a service to start the image

Herve Darce-2
Hi,

I want to launch at startup of the image this:

ma := ModuleAssembly core.
ma serverRoot: FileDirectory default fullName.
ma alias: '/seaside' to: [ma addPlug: [:request |  (WAKom default)
process: request]].
ma documentRoot: FileDirectory default fullName.
ma directoryIndex: 'index.html index.htm'.
ma serveFiles.
(HttpService startOn: 9094 named: 'myhttpd') plug: ma rootModule.


I put this in a workspace and I do a "do it". So  I can open
http://localhost/seaside in my my webbrowser. I save and I quit. I
reopens the image, but I can not open http://localhost/seaside. The last
command  does not seem to work at startup. Why?

However, this method works with this command:

WAKom startOn: 9094

How to launch a service to start the image?

Thanks

Herve Darce
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Launch a service to start the image

Randal L. Schwartz
>>>>> "Hervé" == Hervé Darce <[hidden email]> writes:

Hervé> I want to launch at startup of the image this:

I handled this by adding the startup/shutdown stuff to a class
in my package that holds my WaKom initialization.  The simplest
version of this would be:

    MyClass class >> initialize

      Smalltalk addToStartUpList: self.
      Smalltalk addToShutDownList: self.
      self startUp.

    MyClass class >> startUp

      self start. "in case I want more things here"

    MyClass class >> start

      | ma seaside |
      seaside := WAKom default.
      ma := ModuleAssembly core.
      ma serverRoot: (FileDirectory default directoryNamed: 'FileRoot') fullName.
      ma
        alias: '/seaside'
        to: [ma addPlug: [:request | seaside process: request]].
      ma documentRoot: (FileDirectory default directoryNamed: 'FileRoot') fullName.
      ma directoryIndex: 'index.html index.htm'.
      ma serveFiles.
      (HttpService startOn: 9090 named: 'httpd') plug: ma rootModule.

    MyClass class >> shutDown

      self stop.

    MyClass class >> stop

      HttpService allInstancesDo: [:each | each stop. each unregister].

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[hidden email]> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Launch a service to start the image

Herve Darce-2
Randal L. Schwartz a écrit :

>>>>>> "Hervé" == Hervé Darce <[hidden email]> writes:
>>>>>>            
>
> Hervé> I want to launch at startup of the image this:
>
> I handled this by adding the startup/shutdown stuff to a class
> in my package that holds my WaKom initialization.  The simplest
> version of this would be:
>
>     MyClass class >> initialize
>
>       Smalltalk addToStartUpList: self.
>       Smalltalk addToShutDownList: self.
>       self startUp.
>
>     MyClass class >> startUp
>
>       self start. "in case I want more things here"
>
>     MyClass class >> start
>
>       | ma seaside |
>       seaside := WAKom default.
>       ma := ModuleAssembly core.
>       ma serverRoot: (FileDirectory default directoryNamed: 'FileRoot') fullName.
>       ma
>         alias: '/seaside'
>         to: [ma addPlug: [:request | seaside process: request]].
>       ma documentRoot: (FileDirectory default directoryNamed: 'FileRoot') fullName.
>       ma directoryIndex: 'index.html index.htm'.
>       ma serveFiles.
>       (HttpService startOn: 9090 named: 'httpd') plug: ma rootModule.
>
>     MyClass class >> shutDown
>
>       self stop.
>
>     MyClass class >> stop
>
>       HttpService allInstancesDo: [:each | each stop. each unregister].
>
>  
Thanks, It's ok now.

cheers

Herve Darce
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners