[Seaside-dev] questions about WAServerAdaptor

Philippe Marschall philippe.marschall at gmail.com
Sun Nov 9 22:09:20 UTC 2008


2008/11/9, Julian Fitzell <jfitzell at gmail.com>:
> On Sun, Nov 9, 2008 at 10:35 PM, Philippe Marschall
> <philippe.marschall at gmail.com> wrote:
>> Hi
>>
>> I'm about half way through porting the Swazoo 2 server adaptor to
>> WAServerAdaptor. It works but has some rough edges. Here are the
>> questions that popped up:
>>
>> What is the difference between #basicStop and #shutDown?
>
> #shutDown is the message that is called on each instance when the
> image is shut down.
>
> Lukas and I were discussing the possibility of having the
> ServerAdaptor keep track of which instances are "supposed" to be
> running so that it could simply call #stop and #start on the
> appropriate instances during image startup and shutdown. This seemed
> cleaner in some ways and uglier in others.
>
>> What is the purpose of #statusString? What are examples that it should
>> return? Can it be provided by WAServerAdapter?
>
> Michael added it as a human-readable field of status information for
> use in WAControlPanel (in Seaside-Squeak-Environment). I'm not sure
> what it's supposed to return... I think that part's a bit of a
> work-in-progress.
>
>> Could the whole status tracking be provided by WAServerAdapter?
>> Something along the lines of:
>>
>> WAServerStatus
>>   isRunning
>>     ^false
>>   isString
>>     ^false
>>   isStopped
>>     ^false
>>   isStopping
>>     ^false
>>
>> WARunningServerStatus < WAServerStatus
>>   isRunning
>>     ^true
>
> Well, status could definitely be implemented in different ways. My
> feeling was that most of the adaptors actually have to determine the
> status from the server they are adapting. It's not necessarily enough
> to simply call #start and then assume it is started: there could be an
> error, the server could die, etc.
>
> I'm not sure that I quite get your example but it looks like you're
> suggesting the server adaptor just store an instance of a status class
> representing the current status? If so, I feel like that doesn't allow
> the above. Though looking at it again, maybe you're just suggesting
> returning a status class, not storing it? In which case, that might
> work but I don't know if it ends up better or not. I kind of wanted to
> have a #status method at first but could only think of returning
> symbols, which seemed worse than having all the #isMethods.  I guess
> try it and see?

My idea is that WAServerAdaptor has an instance variable status that
holds an instance of a subclass of WAServerStatus. The code would then
look something like this

WAServerAdaptor >> stop
    status := WAStoppingStatus new.
    self basicStop.
    status := WAStoppedStatus new

with WAStoppingStatus and WAStoppedStatus something like the code
outlined in the previous mail. .

Cheers
Philippe


More information about the seaside-dev mailing list