directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter royal <peter.ro...@pobox.com>
Subject Re: [mina] New configuration API
Date Thu, 26 Jan 2006 13:27:35 GMT
On Jan 26, 2006, at 1:57 AM, Trustin Lee wrote:
> Because of all these configuration classes, there's no more session  
> interface for specific transport type (e.g. SocketSession).   
> Instead, you have an IoSessionConfig implementation for the  
> specific transport type. ( e.g. SocketSessionConfig). For example:
>
> IoSession session = ...;
> SocketSessionConfig cfg = ( SocketSessionConfig ) session.getConfig();
> cfg.setReceiveBufferSize( 2048 );
>
> The downside of this refactoring is that it makes us to downcast  
> returned values too frequently when we change some settings.  I  
> think this issue can be resolved by Covariant Return Type, which is  
> introduced with Java 5.  We might have to consider to support Java  
> 5 for simplicity.

I like this change! Very nice!

One issue, why do you need to wrap exceptions in SocketSessionImpl in  
the RuntimeIOException.. why not just have the SocketSessionConfig  
interface declare to throw the exception when necessary? Seems like  
unnecessary wrapping to me.
-pete

-- 
(peter.royal|osi)@pobox.com - http://fotap.org/~osi


Mime
View raw message