mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@apache.org>
Subject Re: AW: [3.0] IoSession attachment no---signature
Date Mon, 26 Oct 2009 15:46:39 GMT
Steve Ulrich wrote:
>> Emmanuel Lecharny wrote:
>>
>> Julien Vermillard wrote:
>>     
>>> That's the idea for me.
>>>
>>> kill IoSessionAttributMap,
>>> put a Synchronized HashMap in AbstractIoSession
>>> and provide only : getAttribute, setAttribute, removeAttribute,
>>> getAttributeKeys (could be renamed to getAttributeNames)
>>>
>>>       
>
> Nitpick: A ConcurrentHashMap may have a better performance. ;-)
>   

Absolutely. Considering that the session will probably be used in a 
single thread (or at least the concurrency level will be minimal), this 
is most certainly the correct data structure to use.
>> We may add a listener attached to some attributes too, or to the
>> session.
>>     
>
> That may justify an own Map implementation, but you should redesign/clean that interface
of the IoSessionAttributeMap (why do I need to give a sessions to it, the implementation ignores
it anyway?).
>   
Well, not sure. It should be enough to add the triggers into the 
addAttribute()/removeAttribute() methods.

-- 
--
cordialement, regards,
Emmanuel L├ęcharny
www.iktek.com
directory.apache.org



Mime
View raw message