public interface Cache<K,V extends Identifiable<K>> extends AffinitySupport<K>, IdentifierFactory<K>
Modifier and Type | Field and Description |
---|---|
static ThreadLocal<Object> |
CURRENT_GROUP |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(K key)
Indicates whether or not the specified key is contained within this cache.
|
V |
create()
Creates and caches a new instance of
T . |
void |
discard(V obj)
Discard the specified object from cache.
|
V |
get(K key)
Get the specified object from cache.
|
int |
getCacheSize() |
int |
getPassivatedCount() |
int |
getTotalSize() |
default boolean |
isRemotable(Throwable throwable)
Checks whether the supplied
Throwable is remotable meaning it can be safely sent to the client over the wire. |
void |
release(V obj)
Decreases the objects usage count.
|
void |
remove(K key)
Remove and destroy the specified object from cache.
|
void |
start()
Start the cache.
|
void |
stop()
Stop the cache.
|
getStrictAffinity, getWeakAffinity
createIdentifier
static final ThreadLocal<Object> CURRENT_GROUP
V create()
T
.T
V get(K key)
key
- the identifier of the objectvoid release(V obj)
obj
- the objectboolean contains(K key)
key
- the cache keytrue
if the key is present in the cache, false
otherwise.void discard(V obj)
obj
- the object to discardvoid remove(K key)
key
- the identifier of the objectvoid start()
void stop()
int getCacheSize()
int getPassivatedCount()
int getTotalSize()
Copyright © 2016 JBoss by Red Hat. All rights reserved.