public void addChannelToCache ( Channel channel ) { Channel oldChannel = channels . put ( channel . getId ( ) , channel ) ; if ( oldChannel != channel && oldChannel instanceof Cleanupable ) { ( ( Cleanupable ) oldChannel ) . cleanup ( ) ; } }
Adds a channel to the cache .