code: @Override
      public void addCacheItem(String request, ResponseCtx response) {
          String hash = null;
  
          try {
              hash = makeHash(request);
  
              // thread-safety on cache operations
              synchronized (requestCache) {
  
                  // if we have a maxxed cache, remove least used item
                  if (requestCache.size() >= CACHE_SIZE) {
                      String key = requestCacheUsageTracker.remove(0);
                      requestCache.remove(key);
                      if (logger.isDebugEnabled()) {
                          logger.debug("Purging cache element");
                      }
                  }
  
                  requestCache.put(hash, response);
                  requestCacheUsageTracker.add(hash);
                  requestCacheTimeTracker.put(hash, new Long(System
                                                             .currentTimeMillis()));
              }
  
              if (logger.isDebugEnabled()) {
                  logger.debug("Adding Cache Item (" + requestCache.size() + "/"
                               + requestCacheUsageTracker.size() + "/"
                               + requestCacheTimeTracker.size() + "): " + hash);
              }
          } catch (Exception e) {
              logger.warn("Error adding cache item: " + e.getMessage(), e);
          }
      }
docs: /*
  (non-Javadoc)
  @see org.fcrepo.server.security.xacml.pep.ResponseCache#addCacheItem(java.lang.String,
  java.lang.String)