// Invalidation bridge : listen for PageService events and invalidate the DataStorage cache
Listener<?, org.exoplatform.portal.mop.page.PageKey> invalidator = new Listener<Object, org.exoplatform.portal.mop.page.PageKey>() {
@Override
public void onEvent(Event<Object, org.exoplatform.portal.mop.page.PageKey> event) throws Exception {
org.exoplatform.portal.mop.page.PageKey key = event.getData();
PageKey adaptedKey = new PageKey(key.getSite().getTypeName(), key.getSite().getName(), key.getName());
pomMgr.getSession().scheduleForEviction(adaptedKey);
}
};
listenerService.addListener(EventType.PAGE_UPDATED, invalidator);
listenerService.addListener(EventType.PAGE_DESTROYED, invalidator);