K - the cache key typeV - the cache value typepublic class SimpleCache<K,V extends Identifiable<K>> extends Object implements Cache<K,V>
Cache implementation using in-memory storage and eager expiration.CURRENT_GROUP| Constructor and Description |
|---|
SimpleCache(StatefulObjectFactory<V> factory,
IdentifierFactory<K> identifierFactory,
StatefulTimeoutInfo timeout,
org.jboss.as.server.ServerEnvironment environment,
ScheduledExecutorService executor) |
| 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. |
K |
createIdentifier() |
void |
discard(V value)
Discard the specified object from cache.
|
V |
get(K key)
Get the specified object from cache.
|
int |
getCacheSize() |
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()
Start the cache.
|
void |
stop()
Stop the cache.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRemotablepublic SimpleCache(StatefulObjectFactory<V> factory, IdentifierFactory<K> identifierFactory, StatefulTimeoutInfo timeout, org.jboss.as.server.ServerEnvironment environment, ScheduledExecutorService executor)
public void start()
Cachepublic void stop()
Cachepublic 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 K createIdentifier()
createIdentifier in interface IdentifierFactory<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 © 2019 JBoss by Red Hat. All rights reserved.