Hi Seth, On 8/3/07, Seth Pollack <[EMAIL PROTECTED]> wrote: > > Hello, > > i'm working on my first MINA project, and i'm wondering what the best > practice is for passing additional state into my IoHandler. For example, i > want to pass in what the idle timeout period should be (as determined > elsewhere in my code), references to some external objects, etc.
Session attributes can be initialized using an IoFilter: http://mina.apache.org/report/trunk/xref/org/apache/mina/filter/util/SessionAttributeInitializingFilter.html This class is not available in 1.x, so you will have to backport it by yourself. For now, session idle time and write timeout can not be configured in an IoC manner because they don't belong to IoSessonConfig but directly to IoSession. I think Moving these properties to IoSessionConfig so they can be configured before an IoSession is created. WDYT? If there's no objection, I will move the two properties to IoSessionConfig in trunk. Ieanwhile, in 1.x, please create a custom IoFilter referring to SessionAttributeInitializingFilter to set the idle time and the write timeout. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
