[Seaside-dev] Can WAServerAdaptor be split up?

Philippe Marschall philippe.marschall at gmail.com
Mon Jan 7 16:16:25 UTC 2013


On Sun, Jan 6, 2013 at 12:48 PM, Norbert Hartl <norbert at hartl.name> wrote:
> I'm experimenting at the moment with setups to serve static files from a one click image without using file libraries. I'm trying to serve static files from within a one click distribution directory. Therefor I create a zinc server myself and I want to plug in seaside as a handler. Here is a snippet
>
> start
>    "file delegate serves from a neighbor directory 'web'"
>    staticFileDelegate := ZnStaticFileServerDelegate new directory: (
>       FileDirectory default containingDirectory directoryNamed: 'web').
>
>    server := (ZnServer on: self port)
>       delegate: (
>         "the next class just maps the first path element of a uri to a handler"
>         NTedContextDispatcherDelegate new
>             map: 'css' to: staticFileDelegate;
>             map: 'js' to: staticFileDelegate;
>             defaultHandler: (ZnSeasideServerAdaptorDelegate with: ZnZincServerAdaptor new) ).
>    server start
>
> Whenever I start my server there is another adaptor created on port 8080. This is due to ZnZincServerAdaptor is an instance of WAServerAdaptor and always starts a server instance with a default being port 8080.
>
> In my opinion WAServerAdaptor has too many responsibilities. It does server management as well as request conversion.

Form memory without checking the code:
WAServerManager does the server management. AFAIK WAServerAdaptor
automatically registers. You should be able to either stop or
unregister the server adapter and then no starting or port binding
should happen.

Cheers
Philippe


More information about the seaside-dev mailing list