K - the cache key typeV - the cache value typepublic class DistributableCache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>> extends Object implements Cache<K,V>
Cache implementation.
This object is responsible for:
CURRENT_GROUP| Constructor and Description |
|---|
DistributableCache(BeanManager<K,V,org.wildfly.clustering.ee.Batch> manager,
StatefulObjectFactory<V> factory,
TransactionSynchronizationRegistry tsr) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(K id)
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 id)
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 id) |
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 value)
Decreases the objects usage count.
|
void |
remove(K id)
Remove and destroy the specified object from cache.
|
void |
start()
Start the cache.
|
void |
stop()
Stop the cache.
|
public DistributableCache(BeanManager<K,V,org.wildfly.clustering.ee.Batch> manager, StatefulObjectFactory<V> factory, TransactionSynchronizationRegistry tsr)
public org.jboss.ejb.client.Affinity getStrictAffinity()
getStrictAffinity in interface AffinitySupport<K>public org.jboss.ejb.client.Affinity getWeakAffinity(K id)
getWeakAffinity in interface AffinitySupport<K>public K createIdentifier()
createIdentifier in interface IdentifierFactory<K>public V create()
CacheT.create in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>Tpublic V get(K id)
Cacheget in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>id - the identifier of the objectpublic void release(V value)
Cacherelease in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>value - the objectpublic void remove(K id)
Cacheremove in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>id - the identifier of the objectpublic void discard(V value)
Cachediscard in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>value - the object to discardpublic boolean contains(K id)
Cachecontains in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>id - the cache keytrue if the key is present in the cache, false otherwise.public void start()
Cachestart in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>public void stop()
Cachestop in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>public int getCacheSize()
getCacheSize in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>public int getPassivatedCount()
getPassivatedCount in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>public int getTotalSize()
getTotalSize in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>public boolean isRemotable(Throwable throwable)
CacheThrowable is remotable meaning it can be safely sent to the client over the wire.isRemotable in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>Copyright © 2021 JBoss by Red Hat. All rights reserved.