BlockDirectiveCache bdc= CacheLocator.getBlockDirectiveCache();
DotCacheAdministrator dca = CacheLocator.getCacheAdministrator();
Set<String> keys= dca.getKeys(bdc.getPrimaryGroup());
long x = 0;
for(String key : keys){
BlockDirectiveCacheObject bo = bdc.get(key);
if(bo != null && bo.getCreated() + (bo.getTtl() * 1000) < System.currentTimeMillis()) {
bdc.remove(key);
x++;
}
}
long end = System.currentTimeMillis();