public class EHCacheReplayCache extends Object implements ReplayCache
Modifier and Type | Field and Description |
---|---|
protected Ehcache |
cache |
protected CacheManager |
cacheManager |
static long |
DEFAULT_TTL |
static long |
MAX_TTL |
Constructor and Description |
---|
EHCacheReplayCache(String key,
CacheManager cacheManager) |
EHCacheReplayCache(String key,
URL configFileURL) |
Modifier and Type | Method and Description |
---|---|
void |
add(String identifier)
Add the given identifier to the cache.
|
void |
add(String identifier,
long timeToLive)
Add the given identifier to the cache to be cached for the given time
|
void |
close() |
boolean |
contains(String identifier)
Return true if the given identifier is contained in the cache
|
long |
getTTL()
Get the (default) TTL value in seconds
|
void |
initComplete() |
void |
postShutdown() |
void |
preShutdown() |
void |
setTTL(long newTtl)
Set a new (default) TTL value in seconds
|
public static final long DEFAULT_TTL
public static final long MAX_TTL
protected Ehcache cache
protected CacheManager cacheManager
public EHCacheReplayCache(String key, CacheManager cacheManager)
public void setTTL(long newTtl)
newTtl
- a new (default) TTL value in secondspublic long getTTL()
public void add(String identifier)
add
in interface ReplayCache
identifier
- The identifier to be addedpublic void add(String identifier, long timeToLive)
add
in interface ReplayCache
identifier
- The identifier to be addedtimeToLive
- The length of time to cache the Identifier in secondspublic boolean contains(String identifier)
contains
in interface ReplayCache
identifier
- The identifier to checkpublic void close()
close
in interface Closeable
close
in interface AutoCloseable
public void initComplete()
public void preShutdown()
public void postShutdown()
Copyright © 2016 JBoss by Red Hat. All rights reserved.