Search in sources :

Example 1 with Metadata

use of org.infinispan.metadata.Metadata in project indy by Commonjava.

the class ScheduleManager method getNextExpireTime.

private Date getNextExpireTime(final ScheduleKey cacheKey) {
    return scheduleCache.execute(cache -> {
        final CacheEntry entry = cache.getAdvancedCache().getCacheEntry(cacheKey);
        if (entry != null) {
            final Metadata metadata = entry.getMetadata();
            long expire = metadata.lifespan();
            final long startTimeInMillis = (Long) scheduleCache.get(cacheKey).get(SCHEDULE_TIME);
            return calculateNextExpireTime(expire, startTimeInMillis);
        }
        return null;
    });
}
Also used : Metadata(org.infinispan.metadata.Metadata) CacheEntry(org.infinispan.container.entries.CacheEntry)

Aggregations

CacheEntry (org.infinispan.container.entries.CacheEntry)1 Metadata (org.infinispan.metadata.Metadata)1