public class PassivatingBackingCacheImpl<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>> extends AbstractBackingCache<K,V,E> implements PassivatingBackingCache<K,V,E>
Modifier and Type | Field and Description |
---|---|
protected org.jboss.logging.Logger |
log |
Constructor and Description |
---|
PassivatingBackingCacheImpl(StatefulObjectFactory<V> factory,
BackingCacheEntryFactory<K,V,E> entryFactory,
ReplicationPassivationManager<K,E> passivationManager,
BackingCacheEntryStore<K,V,E> store) |
PassivatingBackingCacheImpl(StatefulObjectFactory<V> factory,
BackingCacheEntryFactory<K,V,E> entryFactory,
ReplicationPassivationManager<K,E> passivationManager,
BackingCacheEntryStore<K,V,E> store,
ScheduledExecutorService executor) |
PassivatingBackingCacheImpl(StatefulObjectFactory<V> factory,
BackingCacheEntryFactory<K,V,E> entryFactory,
ReplicationPassivationManager<K,E> passivationManager,
BackingCacheEntryStore<K,V,E> store,
ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
E |
create()
Creates and caches a new instance of
C , wrapped by a new T . |
void |
discard(K key)
Discard the specified object from cache.
|
E |
get(K key)
Get the specified object from cache.
|
GroupCompatibilityChecker |
getCompatibilityChecker()
Gets any
GroupCompatibilityChecker this cache is using. |
org.jboss.ejb.client.Affinity |
getStrictAffinity()
Returns the strict affinity associated with the entries of this cache
|
org.jboss.ejb.client.Affinity |
getWeakAffinity(K key)
Returns the weak affinity associated with the specified entry of this cache
|
boolean |
hasAffinity(K key)
Indicates whether the cache has an affinity for the specified key.
|
boolean |
isClustered()
Gets whether this cache supports clustering functionality.
|
void |
passivate(K key) |
E |
peek(K key)
Peek at an object which might be in use.
|
E |
release(K key)
Release the object from use.
|
void |
remove(K key)
Remove and destroy the specified object from cache.
|
void |
start()
Start the cache.
|
void |
stop()
Stop the cache.
|
addLifecycleListener, notifyLifecycleListeners, removeLifecycleListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addLifecycleListener, removeLifecycleListener
public PassivatingBackingCacheImpl(StatefulObjectFactory<V> factory, BackingCacheEntryFactory<K,V,E> entryFactory, ReplicationPassivationManager<K,E> passivationManager, BackingCacheEntryStore<K,V,E> store)
public PassivatingBackingCacheImpl(StatefulObjectFactory<V> factory, BackingCacheEntryFactory<K,V,E> entryFactory, ReplicationPassivationManager<K,E> passivationManager, BackingCacheEntryStore<K,V,E> store, ThreadFactory threadFactory)
public PassivatingBackingCacheImpl(StatefulObjectFactory<V> factory, BackingCacheEntryFactory<K,V,E> entryFactory, ReplicationPassivationManager<K,E> passivationManager, BackingCacheEntryStore<K,V,E> store, ScheduledExecutorService executor)
public boolean isClustered()
BackingCache
isClustered
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
true
if clustering is supported, false
otherwisepublic org.jboss.ejb.client.Affinity getStrictAffinity()
AffinitySupport
getStrictAffinity
in interface AffinitySupport<K extends Serializable>
public org.jboss.ejb.client.Affinity getWeakAffinity(K key)
AffinitySupport
getWeakAffinity
in interface AffinitySupport<K extends Serializable>
public boolean hasAffinity(K key)
AffinitySupport
hasAffinity
in interface AffinitySupport<K extends Serializable>
key
- a candidate keypublic E create()
BackingCache
C
, wrapped by a new T
. The new T
*is*
returned, but is not regarded as being "in use". Callers *must not* attempt to use the underlying C
without
first calling #get(Object)
.create
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
T
public E get(K key) throws javax.ejb.NoSuchEJBException
BackingCache
get
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
key
- the identifier of the objectjavax.ejb.NoSuchEJBException
- if the object does not existpublic void passivate(K key)
passivate
in interface Passivatable<K extends Serializable>
public E peek(K key) throws javax.ejb.NoSuchEJBException
BackingCache
peek
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
key
- the identifier of the objectjavax.ejb.NoSuchEJBException
- if the object does not existpublic E release(K key)
BackingCache
release
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
key
- the identifier of the objectpublic void discard(K key)
BackingCache
discard
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
key
- the identifier of the objectpublic void remove(K key)
Removable
remove
in interface Removable<K extends Serializable>
key
- the identifier of the objectpublic void start()
BackingCache
start
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
public void stop()
BackingCache
stop
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
public GroupCompatibilityChecker getCompatibilityChecker()
PassivatingBackingCache
GroupCompatibilityChecker
this cache is using.getCompatibilityChecker
in interface PassivatingBackingCache<K extends Serializable,V extends Cacheable<K>,E extends BackingCacheEntry<K,V>>
null
if this cache is not using one.Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.