per session attributes

falconair shahbazc at gmail.com
Sat Dec 26 23:31:19 EST 2009


I am trying to figure out how to set variables per connection.  Once a client
connects to my server, they send a log on message with some attributes.  I'd
like to make those attributes available to every filter/handler in my
pipeline.

Previous messages in the mailing list point to ChannelLocal, such as the
following example:

final ChannelLocal<String> myAttr = new ChannelLocal<String>(); 
  ... 
  String a = myAttr.get(channel); 
  myAttr.set(channel, "newValue"); 
  myAttr.remove(channel); 

But I'm not sure how to use it exactly.  Am I supposed to 'put' myAttr in
the ChannelHandlerContext?  In other words, say my logon handler retrieves
my attribute, how do I make it available to subsequent handlers?

Thanks
-- 
View this message in context: http://n2.nabble.com/per-session-attributes-tp4219656p4219656.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list