long willExpire = expiration.getTime();
long cacheIntervalSecs = (willExpire - now) / 1000;
if ( cacheIntervalSecs > 0 )
{
SmartCache sc = (SmartCache)getLockCache(lock.getEntityType());
synchronized (sc) {
sc.put( getCacheKey(lock), lock, (cacheIntervalSecs) );
}
}
// Else the lock has already expired.
}