Storing extra properties for each channel

jdv145 jandevries145 at fastmail.fm
Fri Mar 20 17:04:50 EDT 2009


I am using the latest beta now and noticed some great additions since last
stable release :). I feel like a kid with some new cool toys now ^^. 

Kudos for that Trustin 

Anyways i also got a question about storing some extra info for the
channels.

I used to store all channels in a concurrent map but since you made a nice
ChannelGroup now i like to use that. From the FAQ i understand you only need
to add the channel to a ChannelGroup when a connection is established. After
the channel is disconnected it is removed automatically from the
channelgroup (right?).

The thing is... i used to had a map with all channels and a seperate map
with all attribute Objects.

    private ConcurrentHashMap<Integer, Channel> channelsMap; // map
channel-ID to channel
    private ConcurrentHashMap<Integer, ChannelAttributes>
channelAttributesMap; //map channel-ID to ChannelAttributes

since i now am using the channelsgroup i am wondering what the best way is
to store an extra attribute-object for each channel. If i use my good old
channelAttributesMap i still need to handle channeldisconnect and
channelconnects myself. (i remembered you could store an object in mina for
each channel but so far i couldn't find something similar for netty yet).

Can you give me some advise on this one? 
-- 
View this message in context: http://n2.nabble.com/Storing-extra-properties-for-each-channel-tp2511153p2511153.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list