users@grizzly.java.net

Re: Problem with SSL

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Tue, 30 Sep 2008 21:00:22 -0400

Salut,

quende wrote:
> Hello,
>
> John ROM wrote:
>> Just a guess:
>> In
>> DispatchFilter after SSLReader you do logically a
>> getDefaultPipeline().execute ( {SSLOutputWriter.flushChannel(..) });
>>
>
> Yes, that's what i do.
>
>
> John ROM wrote:
>> This can't work for SSL because your code will be exeuted on a new
>> WorkerThread
>> which has no SSL information...
>>
>>
>
> I think you are right. But what kind of information is it? I mean, where can
> I find one on the current thread and is there any chance to share it among
> newly created WorkerThreads? The concept of pipeline brings me necessary
> control over the number of threads, I don't want to give it up, so I wish
> there can be some workaround to keep the pipeline in SSL model.

Mainly, what you need to do is to call:

ThreadAttachment ta = ((WorkerThread)Thread.currentThread()).detach();

The ThreadAttachment contains everything you need. Now pass that
ThreadAttachment to your Callable/Runable, and make sure the first
operation you do consist of:

((WorkerThread)Thread.currentThread()).attach(ta);

After that you are all set.

Hope that help.

-- Jeanfrancois




>
> Thanks,
> -- Quende