Salut,
Oleksiy Stashok wrote:
> Hello Mark,
>
> I think main decision was to make Adapter stateless, so it will not have
> any internal state, so there should not be multi-threading issues.
Indeed. We already creates DefaultProcessorTask/Request/Response which
are statefull, the Adapter doesn't necessary needs to be statefull as
well....That makes a big difference under load.
>
>> I was just wondering if someone could give me some incite behind the
>> decision to, when the selector thread calls
>> configureProcessorTask(DefaultProcessorTask task) it assigns the
>> task.setAdapter(adapter); method?
>>
>> This would mean that each DefaultProcessorTask has the same adapter
>> assigned to process requests... wouldn't this create multi-threading
>> issues when many different DefaultProcessorTask's try to call their
>> adapters service method?
>>
>> I may have the wrong impression here but wouldnt it be better if in
>> the configureProcessorTask method in the SelectorThread class sets a
>> new instance of an adapter onto the DefaultProcessorTask?
>>
>> task.setAdapter( new SampleAdapter() );
>>
>> instead of task.setAdapter(adapter);
>>
>> Ofcourse, if you wanted to copy the object instead of a new instance,
>> then you would need to implement Cloneable on the adapter...
> IMHO, clones it's always tricky... and place with possible issues.
> Can you pls. describe your scenario? Why you may need to have stateful
> Adapter?
Right? Or better, if you have time, maybe you can send us a patch that
support stateless and statefull Adapter :-) :-) :-)
Thanks!
-- Jesnfrancois
>
> Thanks.
>
> WBR,
> Alexey.
>
>>
>>
>> Cheers,
>> Mark
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>