Class CachedListenerObjectRetriever

All Implemented Interfaces:
ListenerObjectCreationObserver, ListenerObjectRetriever

public class CachedListenerObjectRetriever extends DefaultListenerObjectRetriever implements ListenerObjectCreationObserver
This ListenerObjectRetriever implements caching to be able to retrieve ListenerObjects more quickly. It keeps a local Map where requests are mapped to Collections of ListenerObjects. This class extends from DefaultListenerObjectRetriever and adds caching to the retrieval methods, except DefaultListenerObjectRetriever.getListenerObjects(), because that one simply returns all ListenerObjects. This class implements the ListenerObjectCreationObserver in order to clear the cache if any new ListenerObjects are created by any of the ListenerObjectCreators that are associated with this CachedListenerObjectRetriever. Also, if you add a ListenerObjectCreator to this CachedListenerObjectRetriever, the cache will be cleared as well.
G.J. Schouten