K - the cache key typeV - the cache value typepublic class SimpleCache<K,V extends Identifiable<K>> extends Object implements Cache<K,V>, Predicate<K>
Cache implementation using in-memory storage and eager expiration.CURRENT_GROUP| Constructor and Description |
|---|
SimpleCache(StatefulObjectFactory<V> factory,
Supplier<K> identifierFactory,
StatefulTimeoutInfo timeout,
org.jboss.as.server.ServerEnvironment environment) |
| 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 value)
Discard the specified object from cache.
|
V |
get(K key)
Get the specified object from cache.
|
int |
getCacheSize() |
Supplier<K> |
getIdentifierFactory()
Returns the identifier factory of this cache.
|
int |
getPassivatedCount() |
org.jboss.ejb.client.Affinity |
getStrictAffinity() |
int |
getTotalSize() |
org.jboss.ejb.client.Affinity |
getWeakAffinity(K key) |
void |
release(V bean)
Decreases the objects usage count.
|
void |
remove(K key)
Remove and destroy the specified object from cache.
|
void |
start() |
void |
stop() |
boolean |
test(K key) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRemotablepublic SimpleCache(StatefulObjectFactory<V> factory, Supplier<K> identifierFactory, StatefulTimeoutInfo timeout, org.jboss.as.server.ServerEnvironment environment)
public void start()
start in interface org.wildfly.clustering.ee.Restartablepublic void stop()
stop in interface org.wildfly.clustering.ee.Restartablepublic org.jboss.ejb.client.Affinity getStrictAffinity()
getStrictAffinity in interface AffinitySupport<K>public org.jboss.ejb.client.Affinity getWeakAffinity(K key)
getWeakAffinity in interface AffinitySupport<K>public Supplier<K> getIdentifierFactory()
CachegetIdentifierFactory in interface Cache<K,V extends Identifiable<K>>public V create()
CacheT.public void discard(V value)
Cachepublic void remove(K key)
Cachepublic V get(K key)
Cachepublic boolean contains(K key)
Cachepublic void release(V bean)
Cachepublic int getCacheSize()
getCacheSize in interface Cache<K,V extends Identifiable<K>>public int getPassivatedCount()
getPassivatedCount in interface Cache<K,V extends Identifiable<K>>public int getTotalSize()
getTotalSize in interface Cache<K,V extends Identifiable<K>>Copyright © 2022 JBoss by Red Hat. All rights reserved.