public class CacheWorkArounds<K,V> extends Object
Modifier and Type | Class | Description |
---|---|---|
static class |
CacheWorkArounds.Mode |
The handled special modes.
|
Constructor | Description |
---|---|
CacheWorkArounds(org.infinispan.Cache<K,V> infinispanCache) |
Creates a new cache work arounds instance.
|
CacheWorkArounds(org.infinispan.Cache<K,V> infinispanCache,
org.apache.logging.log4j.Logger log) |
Creates a new cache work arounds instance.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clearCacheIfStateless() |
If the cache is in the special "stateless mode" causes the
underlying data container (in memory) to be cleared.
|
static boolean |
detectInvalidationMode(org.infinispan.Cache cache) |
Checks if the specified cache is configured in invalidation mode.
|
static boolean |
detectStatelessMode(org.infinispan.Cache cache) |
Checks if the specified cache is configured in "stateless mode".
|
CacheWorkArounds.Mode |
getMode() |
Returns the special work around mode.
|
boolean |
isInvalidation() |
Returns
true if the cache is in invalidation mode. |
boolean |
isStateless() |
Returns
true if the cache is in the special "stateless
mode". |
public CacheWorkArounds(org.infinispan.Cache<K,V> infinispanCache)
infinispanCache
- The Infinispan cache.public CacheWorkArounds(org.infinispan.Cache<K,V> infinispanCache, org.apache.logging.log4j.Logger log)
infinispanCache
- The Infinispan cache.log
- Optional logger for the detection,
null
if not specified.public static boolean detectInvalidationMode(org.infinispan.Cache cache)
cache
- The cache to check.true
if the cache is configured in invalidation
mode, else false
.public static boolean detectStatelessMode(org.infinispan.Cache cache)
cache
- The cache to check.true
if the cache is configured in "stateless mode",
else false
.public CacheWorkArounds.Mode getMode()
null
if none (implies follow
regular operation).public boolean isInvalidation()
true
if the cache is in invalidation mode.true
if the cache is in invalidation mode, else
false
.public boolean isStateless()
true
if the cache is in the special "stateless
mode".true
if the cache is in the "stateless mode", else
false
.public void clearCacheIfStateless()
Copyright © 2018 Connect2id. All rights reserved.