directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Allen <mrchrisal...@gmail.com>
Subject Re: [MINA] ReconnectFilter
Date Wed, 28 Dec 2005 13:47:30 GMT
Yeah, that is cool.  Sometimes you just have to get it done.  I hear ya. ;-)

Anyway, it's working well for me.  I did have some trouble integrating
it with Spring, as I needed reference to my IoConnection before it was
setup and passing this filter into the Application context at start up
caused a circular reference error.  I ended up handling it by making
the ReconnectionFilter implement Spring's ApplicationContectAware
interface and getting the IoConnection bean only when the closed
connection event was triggered.  I don't particularly like having this
class know about Spring, and also have\ing to know what I named the
IoConnection bean, but I couldn't think of a better solution at the
time.  If anyone has any other suggestions let me know.

I'm also planning on adding a limit to the amount of times that the
filter tries to reconnect, just in case the server it's trying to
establish the connection with really is down.

-Chris

On 12/28/05, Julien Vermillard <jvermillard@archean.fr> wrote:
>  Yes you are right, but I use it that way :
>
>  session.getFilterChain().addLast("reconnection",new
> ReconnectionFilter(2000,connector,ATMess.this,session.getRemoteAddress(),session.getLocalAddress()));
>
>  It was a lazy solution for postponing implemention all the constructor :)
>
>  Julien
>
>  Le mardi 27 décembre 2005 à 12:35 -0500, Chris Allen a écrit :
>
>
>  Hi Julien,
>
>  After writing the last email and doing a little more research, I guess the
> thing to do to make your ReconnectionFilter as flexible as possible, would
> be to allow each of the IoConnector.connect() methods to work with this
> class. As you can see in the MINA JavaDocs:
> http://directory.apache.org/subprojects/network/apidocs/org/apache/mina/common/IoConnector.html
> there are four different versions of connect() and the filter currently only
> supports one of them.
>
>  The easiest way that I can see to accomplish this is to provide multiple
> constructors for the ReconnectionFilter class that account for each of these
> connection methods.  I've currently added my own with the single
> SocketAddress, but for a truly flexible filter I guess it would have to
> support the others as well.
>
>  Anyway, I know this is a work in progress, but I just thought that I should
> mention it, even though it's super obvious.
>
>  Thanks again for letting me know where to find this class, and for creating
> it in the first place.
>
>  -Chris

Mime
View raw message