mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Gollmer <...@jatosoft.com>
Subject JMX StatCollector & IoSession Attribute
Date Wed, 23 May 2007 20:52:33 GMT
Hi all,

I have an application which reuses IoSessions often. Basically as the  
client sends data, state is built up within the IoSession via a  
series of attributes. When the server recognizes that an event has  
taken place, it processes the session, and clears the attributes for  
the next round of data collection.

To facilitate this, I had written a clearAttrs() method which simply  
iterated through the attribute keys and called  
IoSession.removeAttribute() on each key. Unfortunately when I added  
Mina's JMX statistics collection to my app, I began seeing null  
pointer exceptions in StatCollector$Worker. This was puzzling until I  
looked at the source and found that stats are gathered in sessions,  
using the attribute StatCollector.KEY.

Of course, it probably isn't the best application design to go around  
blasting IoSession attributes willy-nilly. However, I know my code,  
and nothing else was storing attributes on IoSessions until I started  
working with JMX. It would be nice to have a mention of this on the  
Mina+JMX wiki page for future reference.


Thanks,
-- 
Ben



Mime
View raw message