You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Trustin Lee (JIRA)" <ji...@apache.org> on 2006/08/03 10:18:14 UTC

[jira] Commented: (DIRMINA-68) Automatic reconnect configuration for client channels.

    [ http://issues.apache.org/jira/browse/DIRMINA-68?page=comments#action_12425464 ] 
            
Trustin Lee commented on DIRMINA-68:
------------------------------------

Now, prepareToClose() (formerly unclose()) is exposed to BaseIoSession.  It is used to reset the internal 'closed' status to 'not closed'.  We exposed this method because we want to reuse the existing session object.  As we discussed before, reusing the session instance can reduce the overhead of reconstructing the filter chain.  (Do I remember correctly?)  But all other attributes and properties should be cleared so they could be set by IoHandler implementation.  We don't have any control over the attributes that might contain critical state information that might affect the behavior of an application.  Actually we also don't have any control over the insertion and removal of filters in the middle of a connection, so it makes us very hard to reuse a session instance.

So, here's my idea:

1. Create IoConnectorSession interface which extends IoSession and provides 'ConnectFuture reconnect()'
2. Create an implementation of IoConnectorSession which wraps existing IoSession implementations and takes care of all reconnection process (i.e. calling IoConnector.connect() again and switching the wrapped session)
3. IoConnector.connect() wraps the original IoSession implementation (e.g. SocketSession) with the IoConnectorSession implementation.

I think this will minimize changes in our code and enables us to provide reconnection feature more easily for future transport implementations.

There's one problem though; how can we get the original session instance from IoConnectorSession instance if IoConnector.connect() returns a wrapped session?  We need to find out a trick.

> Automatic reconnect configuration for client channels.
> ------------------------------------------------------
>
>                 Key: DIRMINA-68
>                 URL: http://issues.apache.org/jira/browse/DIRMINA-68
>             Project: Directory MINA
>          Issue Type: Improvement
>            Reporter: Trustin Lee
>         Attachments: MinaFailoverSession.java, ReconnectionFilter.java, ReconnectionFilter.java, ReconnectionFilter.java
>
>
> We need to provide:
> * automatic reconnect property for client sessions
> * reconnect delay
> * max retry count
> Current retry count and client session flag will be stored as session attributes.

-- 
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