The caching service

Interface CachingService is the main interface of the cachemanager component.

For Maven: groupId=hippo, artifactId=hippo-repository-cachemanager, version=[see download page]

Simple cache

Create an implementation of interface Cache and use that to create a CachingService. A default implementation using JCS is provided with the library, but it is perfectly OK to write your own implementation.

JCSDefaultCache cache = new JCSDefaultCache("default");
CachingService cachingService = new CachingServiceImpl(cache)
      

EventAware cache

A CachingService can be "EventAware" if associated with an UpdateNotificationService. An EventAware CachingService will evict enties from the cache that have become outdated because of a repository content update.

JCSDefaultCache cache = new JCSDefaultCache("default"); 
UpdateNotificationService updateNotifier = (see update notifier documentation);
CachingService cachingService = new CachingServiceImpl(cache, updateNotifier.getEventAwareManager(), "default")
      

Will create a CachingService that will be aware of content changes in the default repository namespace.