public SessionAwareCache (String cacheName, final CacheFactory cacheFactory, final Type type, int maxStaleness) { assert (cacheFactory != null); this.localCache = cacheFactory.get(cacheName); if (type == Type.PREPAREDPLAN) { this.distributedCache = localCache; } else { this.distributedCache = cacheFactory.get(cacheName+REPL); if (this.distributedCache == null && this.localCache != null) { this.distributedCache = this.localCache; } } this.modTime = maxStaleness * 1000; this.type = type; assert (this.localCache != null); assert (this.distributedCache != null); }
public SessionAwareCache (String cacheName, final CacheFactory cacheFactory, final Type type, int maxStaleness) { assert (cacheFactory != null); this.localCache = cacheFactory.get(cacheName); if (type == Type.PREPAREDPLAN) { this.distributedCache = localCache; } else { this.distributedCache = cacheFactory.get(cacheName+REPL); if (this.distributedCache == null && this.localCache != null) { this.distributedCache = this.localCache; } } this.modTime = maxStaleness * 1000; this.type = type; assert (this.localCache != null); assert (this.distributedCache != null); }
public SessionAwareCache (String cacheName, final CacheFactory cacheFactory, final Type type, int maxStaleness) { assert (cacheFactory != null); this.localCache = cacheFactory.get(cacheName); if (type == Type.PREPAREDPLAN) { this.distributedCache = localCache; } else { this.distributedCache = cacheFactory.get(cacheName+REPL); if (this.distributedCache == null && this.localCache != null) { this.distributedCache = this.localCache; } } this.modTime = maxStaleness * 1000; this.type = type; assert (this.localCache != null); assert (this.distributedCache != null); }