K
- the cache key typeV
- the cache value typepublic class DistributableCache<K,V extends Identifiable<K> & Contextual<Batch>> extends Object implements Cache<K,V>
Cache
implementation.
This object is responsible for:
CURRENT_GROUP
Constructor and Description |
---|
DistributableCache(BeanManager<K,V,Batch> manager,
StatefulObjectFactory<V> factory) |
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,Batch> manager, StatefulObjectFactory<V> factory)
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()
Cache
T
.create
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
T
public V get(K id)
Cache
get
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
id
- the identifier of the objectpublic void release(V value)
Cache
release
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
value
- the objectpublic void remove(K id)
Cache
remove
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
id
- the identifier of the objectpublic void discard(V value)
Cache
discard
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
value
- the object to discardpublic boolean contains(K id)
Cache
contains
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
id
- the cache keytrue
if the key is present in the cache, false
otherwise.public void start()
Cache
start
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
public void stop()
Cache
stop
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
public int getCacheSize()
getCacheSize
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
public int getPassivatedCount()
getPassivatedCount
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
public int getTotalSize()
getTotalSize
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
public boolean isRemotable(Throwable throwable)
Cache
Throwable
is remotable meaning it can be safely sent to the client over the wire.isRemotable
in interface Cache<K,V extends Identifiable<K> & Contextual<Batch>>
Copyright © 2016 JBoss by Red Hat. All rights reserved.