Class ChannelTracker<K,C extends Channel,A>

java.lang.Object
org.jdrupes.vmoperator.manager.events.ChannelTracker<K,C,A>
Type Parameters:
K - the key type
C - the channel type
A - the type of the associated data
All Implemented Interfaces:
ChannelDictionary<K,C,A>

public class ChannelTracker<K,C extends Channel,A> extends Object implements ChannelDictionary<K,C,A>
Used to track mapping from a key to a channel.

Entries must be maintained by handlers for “add/remove” (or “open/close”) events delivered on the channels that are to be made available by the tracker.

The channels are stored in the dictionary using WeakReferences. Removing entries is therefore best practice but not an absolute necessity as entries for cleared references are removed when one of the methods values(), ChannelDictionary.channels() or ChannelDictionary.associated() is called.