public class NonPassivatingBackingCacheImpl<K extends Serializable,V extends Cacheable<K>> extends AbstractBackingCache<K,V,NonPassivatingBackingCacheEntry<K,V>> implements BackingCacheEntryFactory<K,V,NonPassivatingBackingCacheEntry<K,V>>
BackingCache
that doesn't handle passivation (although it does handle expiration). Pure in-VM memory cache.
Not group-aware, as there is no point in managing groups if there is no serialization.log
Constructor and Description |
---|
NonPassivatingBackingCacheImpl(StatefulObjectFactory<V> factory,
ScheduledExecutorService executor,
StatefulTimeoutInfo timeout,
ServerEnvironment environment) |
NonPassivatingBackingCacheImpl(StatefulObjectFactory<V> factory,
ThreadFactory threadFactory,
StatefulTimeoutInfo timeout,
ServerEnvironment environment) |
Modifier and Type | Method and Description |
---|---|
NonPassivatingBackingCacheEntry<K,V> |
create()
Creates and caches a new instance of
C , wrapped by a new T . |
NonPassivatingBackingCacheEntry<K,V> |
createEntry(V item) |
void |
destroyEntry(NonPassivatingBackingCacheEntry<K,V> entry) |
void |
discard(K key)
Discard the specified object from cache.
|
NonPassivatingBackingCacheEntry<K,V> |
get(K key)
Get the specified object from cache.
|
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.
|
NonPassivatingBackingCacheEntry<K,V> |
peek(K key)
Peek at an object which might be in use.
|
NonPassivatingBackingCacheEntry<K,V> |
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
public NonPassivatingBackingCacheImpl(StatefulObjectFactory<V> factory, ThreadFactory threadFactory, StatefulTimeoutInfo timeout, ServerEnvironment environment)
public NonPassivatingBackingCacheImpl(StatefulObjectFactory<V> factory, ScheduledExecutorService executor, StatefulTimeoutInfo timeout, ServerEnvironment environment)
public 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 NonPassivatingBackingCacheEntry<K,V> 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>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
T
public NonPassivatingBackingCacheEntry<K,V> createEntry(V item)
createEntry
in interface BackingCacheEntryFactory<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
public void destroyEntry(NonPassivatingBackingCacheEntry<K,V> entry)
destroyEntry
in interface BackingCacheEntryFactory<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
public NonPassivatingBackingCacheEntry<K,V> get(K key) throws javax.ejb.NoSuchEJBException
BackingCache
get
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
key
- the identifier of the objectjavax.ejb.NoSuchEJBException
- if the object does not existpublic NonPassivatingBackingCacheEntry<K,V> peek(K key) throws javax.ejb.NoSuchEJBException
BackingCache
peek
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
key
- the identifier of the objectjavax.ejb.NoSuchEJBException
- if the object does not existpublic NonPassivatingBackingCacheEntry<K,V> release(K key)
BackingCache
release
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
key
- the identifier of the objectpublic void discard(K key)
BackingCache
discard
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
key
- the identifier of the objectpublic void remove(K key)
Removable
remove
in interface Removable<K extends Serializable>
key
- the identifier of the objectpublic boolean isClustered()
BackingCache
isClustered
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
true
if clustering is supported, false
otherwisepublic void start()
BackingCache
start
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
public void stop()
BackingCache
stop
in interface BackingCache<K extends Serializable,V extends Cacheable<K>,NonPassivatingBackingCacheEntry<K extends Serializable,V extends Cacheable<K>>>
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.