Evict a node from cache.
if (log.isTraceEnabled())
{
log.trace("Attempting to evict cache node with fqn of " + fqn);
}
EvictionPolicy policy = region.getEvictionPolicy();
try
{
policy.evict(fqn);
}
catch (ContextInUseException e)
{
// Don't log it at any alarming level
if (log.isTraceEnabled())
log.trace("Eviction of " + fqn + " aborted as bean is in use");
return false;
}
catch (TimeoutException e)
{
log.warn("Eviction of " + fqn + " timed out, retrying later");
log.debug(e, e);
return false;
}
catch (RuntimeException e)
{
Throwable cause = e.getCause();
if (cause instanceof ContextInUseException)
{
// Don't log it at any alarming level
if (log.isTraceEnabled())
log.trace("Eviction of " + fqn + " aborted as bean is in use");
return false;
}
log.error("Eviction of " + fqn + " failed", e);
return false;
}
catch (Exception e)
{
log.error("Eviction of " + fqn + " failed", e);
return false;
}
if (log.isTraceEnabled())
{
log.trace("Eviction of cache node with fqn of " + fqn + " successful");
}
return true;