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. |
void |
discard(V value)
Discard the specified object from cache.
|
V |
get(K id)
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 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() |
void |
stop() |
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 Supplier<K> getIdentifierFactory()
CachegetIdentifierFactory in interface Cache<K,V extends Identifiable<K> & Contextual<org.wildfly.clustering.ee.Batch>>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()
start in interface org.wildfly.clustering.ee.Restartablepublic void stop()
stop in interface org.wildfly.clustering.ee.Restartablepublic 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 © 2022 JBoss by Red Hat. All rights reserved.