You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by da...@daune-consult.com on 2006/08/01 10:17:31 UTC

IoSession.toString()

Hi all,

I have added some traces to my app, and it appears that adding the  
session in a String generates the default info (class name  
(SocketSessionImpl) @ hash code)

What about defining an IoSessionStringifier that could be set to IoSession?

BaseIoSession would then implement:

public String toString() {
   return stringifier.toString(this);
}

BaseIoSession would have a default IoSessionStringifier returning the  
same that java.lang.Object#toString()

SocketSessionImpl could have a default IoSessionStringifier that  
returns the socket address.

I could then define mine that uses session attributes to print useful info.

If it suits everyone, I can implement it and send patch.

J-F



Re: IoSession.toString()

Posted by peter royal <pr...@apache.org>.
On Aug 1, 2006, at 4:17 AM, daune.jf@daune-consult.com wrote:
> I could then define mine that uses session attributes to print  
> useful info.
>
> If it suits everyone, I can implement it and send patch.

Sounds reasonable.
-pete


-- 
proyal@apache.org - http://fotap.org/~osi