[ http://issues.apache.org/jira/browse/DIRMINA-217?page=all ]
     
Trustin Lee closed DIRMINA-217:
-------------------------------

    Resolution: Fixed

Done

> Make IoFuture and its subclasses interfaces
> -------------------------------------------
>
>          Key: DIRMINA-217
>          URL: http://issues.apache.org/jira/browse/DIRMINA-217
>      Project: Directory MINA
>         Type: Improvement

>     Reporter: Trustin Lee
>     Assignee: Trustin Lee
>     Priority: Minor
>      Fix For: 0.9.5

>
> Would it be nice if we have IoFuture.getSession()?  IoFuture.Callback doesn't 
> have any mean to get the session associated with the future.  For example, in 
> DIRMINA-210, we have to create a new intanceof ClosingCallback every time we 
> set the callback.  If we can get the associated session by calling 
> IoFuture.getSession(), then it will look like this:
> public interface Callback {
>     static Callback CLOSE = new Callback() {
>         public void operationComplete(IoFuture future) {
>             future.getSession().close();
>         }
>     }
>     ...
> }
> session.write(...).setCallback(ioFuture.Callback.CLOSE);
> The only issue with this change is that the throws clause of 
> ConnectFuture.getSession() should be removed and it should throw 
> RuntimeIOException instead of IOException.  This will cause compilation 
> errors in legacy code, for the use of connectors.
> The second design issue with IoFuture is about making it interface.  For now, 
> they are concrete classes which expose internal methods that change their 
> state.  I'd like to change them look like this:
> * IoFuture
>    * WriteFuture (extends IoFuture)
>       * DefaultWriteFuture (implements WriteFuture, internal use only)
>    * ConnectFuture (extends IoFuture)
>       * DefaultConnectFuture (implements ConnectFuture, internal use only)
>    * CloseFuture (extends IoFuture)
>       * DefaultCloseFuture (implements CloseFuture, internal use only)
> Making them interfaces has an advantage in that we can create more complex 
> futures such as CompositeWriteFuture or dummy futures which never impacts 
> performance due to synchronized block.
> Detailed conversation:
> http://thread.gmane.org/gmane.comp.apache.directory.mina.devel/106/focus=106

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to