示例#1
0
  /** Construct the Cache. No automatic refresh handling. */
  public MemCache(
      BasicMemoryService memoryService, EventTrackingService eventTrackingService, Ehcache cache) {
    // inject our dependencies
    m_memoryService = memoryService;
    m_eventTrackingService = eventTrackingService;
    this.cache = cache;

    // register as a cacher
    m_memoryService.registerCacher(this);
  }
示例#2
0
  /** Clean up. */
  public void destroy() {
    cache.removeAll(); // TODO Do we boolean doNotNotifyCacheReplicators? Ian?
    cache.getStatistics().clearStatistics();

    // if we are not in a global shutdown
    if (!ComponentManager.hasBeenClosed()) {
      // remove my registration
      m_memoryService.unregisterCacher(this);

      // remove my event notification registration
      m_eventTrackingService.deleteObserver(this);
    }
  }