|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.infinispan.CacheDelegate<K,V>
public class CacheDelegate<K,V>
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected BatchContainer |
batchContainer
|
protected CommandsFactory |
commandsFactory
|
protected ComponentRegistry |
componentRegistry
|
protected Configuration |
config
|
protected InvocationContextContainer |
invocationContextContainer
|
protected InterceptorChain |
invoker
|
protected Marshaller |
marshaller
|
protected CacheNotifier |
notifier
|
protected RpcManager |
rpcManager
|
protected TransactionManager |
transactionManager
|
Constructor Summary | |
---|---|
CacheDelegate(String name)
|
Method Summary | ||
---|---|---|
void |
addInterceptor(CommandInterceptor i,
int position)
Adds a custom interceptor to the interceptor chain, at specified position, where the first interceptor in the chain is at position 0 and the last one at NUM_INTERCEPTORS - 1. |
|
void |
addInterceptorAfter(CommandInterceptor i,
Class<? extends CommandInterceptor> afterInterceptor)
Adds a custom interceptor to the interceptor chain, after an instance of the specified interceptor type. |
|
void |
addInterceptorBefore(CommandInterceptor i,
Class<? extends CommandInterceptor> beforeInterceptor)
Adds a custom interceptor to the interceptor chain, before an instance of the specified interceptor type. |
|
void |
addListener(Object listener)
Adds a listener to the component. |
|
void |
clear()
|
|
void |
clear(Flag... flags)
|
|
void |
compact()
Method that releases object references of cached objects held in the cache by serializing them to byte buffers. |
|
boolean |
containsKey(Object key)
|
|
boolean |
containsKey(Object key,
Flag... flags)
|
|
boolean |
containsValue(Object value)
|
|
void |
endBatch(boolean successful)
|
|
Set<Map.Entry<K,V>> |
entrySet()
|
|
void |
evict(K key)
|
|
V |
get(Object key)
|
|
V |
get(Object key,
Flag... flags)
|
|
AdvancedCache<K,V> |
getAdvancedCache()
|
|
|
getAtomicMap(K key)
Returns an atomic map. |
|
BatchContainer |
getBatchContainer()
|
|
CacheManager |
getCacheManager()
Retrieves the cache manager responsible for creating this cache instance. |
|
ComponentRegistry |
getComponentRegistry()
|
|
Configuration |
getConfiguration()
|
|
DataContainer |
getDataContainer()
|
|
EvictionManager |
getEvictionManager()
|
|
List<CommandInterceptor> |
getInterceptorChain()
Retrieves the current Interceptor chain. |
|
InvocationContextContainer |
getInvocationContextContainer()
|
|
Set<Object> |
getListeners()
|
|
String |
getName()
|
|
RpcManager |
getRpcManager()
|
|
ComponentStatus |
getStatus()
|
|
String |
getVersion()
|
|
void |
injectDependencies(EvictionManager evictionManager,
InvocationContextContainer invocationContextContainer,
CommandsFactory commandsFactory,
InterceptorChain interceptorChain,
Configuration configuration,
CacheNotifier notifier,
ComponentRegistry componentRegistry,
TransactionManager transactionManager,
BatchContainer batchContainer,
RpcManager rpcManager,
DataContainer dataContainer,
Marshaller marshaller,
ResponseGenerator responseGenerator,
CacheManager cacheManager,
StateTransferManager stateTransferManager)
|
|
boolean |
isEmpty()
|
|
Set<K> |
keySet()
|
|
V |
put(K key,
V value)
|
|
V |
put(K key,
V value,
Flag... flags)
|
|
V |
put(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of Map.put(Object, Object) , which takes in lifespan parameters. |
|
V |
put(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of Map.put(Object, Object) , which takes in lifespan parameters. |
|
V |
put(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit,
Flag... flags)
|
|
void |
putAll(Map<? extends K,? extends V> map)
|
|
void |
putAll(Map<? extends K,? extends V> map,
Flag... flags)
|
|
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit unit)
An overloaded form of Map.putAll(java.util.Map) , which takes in lifespan parameters. |
|
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of Map.putAll(java.util.Map) , which takes in lifespan parameters. |
|
void |
putAll(Map<? extends K,? extends V> map,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit,
Flag... flags)
|
|
void |
putForExternalRead(K key,
V value)
Under special operating behavior, associates the value with the specified key. |
|
void |
putForExternalRead(K key,
V value,
Flag... flags)
|
|
V |
putIfAbsent(K key,
V value)
|
|
V |
putIfAbsent(K key,
V value,
Flag... flags)
|
|
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of ConcurrentMap.putIfAbsent(Object, Object) , which takes in lifespan parameters. |
|
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of ConcurrentMap.putIfAbsent(Object, Object) , which takes in lifespan parameters. |
|
V |
putIfAbsent(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit maxIdleTimeUnit,
Flag... flags)
|
|
V |
remove(Object key)
|
|
V |
remove(Object key,
Flag... flags)
|
|
boolean |
remove(Object key,
Object value)
|
|
boolean |
remove(Object key,
Object oldValue,
Flag... flags)
|
|
void |
removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
Removes the interceptor of specified type. |
|
void |
removeInterceptor(int position)
Removes the interceptor at a specified position, where the first interceptor in the chain is at position 0 and the last one at getInterceptorChain().size() - 1. |
|
void |
removeListener(Object listener)
Removes a listener from the component. |
|
V |
replace(K key,
V value)
|
|
V |
replace(K key,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of ConcurrentMap.replace(Object, Object) , which takes in lifespan parameters. |
|
V |
replace(K key,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of ConcurrentMap.replace(Object, Object) , which takes in lifespan parameters. |
|
boolean |
replace(K key,
V oldValue,
V newValue)
|
|
boolean |
replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit unit)
An overloaded form of ConcurrentMap.replace(Object, Object, Object) , which takes in lifespan parameters. |
|
boolean |
replace(K key,
V oldValue,
V value,
long lifespan,
TimeUnit lifespanUnit,
long maxIdleTime,
TimeUnit idleTimeUnit)
An overloaded form of ConcurrentMap.replace(Object, Object, Object) , which takes in lifespan parameters. |
|
int |
size()
|
|
void |
start()
|
|
boolean |
startBatch()
|
|
void |
stop()
|
|
String |
toString()
|
|
Collection<V> |
values()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Field Detail |
---|
protected InvocationContextContainer invocationContextContainer
protected CommandsFactory commandsFactory
protected InterceptorChain invoker
protected Configuration config
protected CacheNotifier notifier
protected BatchContainer batchContainer
protected ComponentRegistry componentRegistry
protected TransactionManager transactionManager
protected RpcManager rpcManager
protected Marshaller marshaller
Constructor Detail |
---|
public CacheDelegate(String name)
Method Detail |
---|
public void injectDependencies(EvictionManager evictionManager, InvocationContextContainer invocationContextContainer, CommandsFactory commandsFactory, InterceptorChain interceptorChain, Configuration configuration, CacheNotifier notifier, ComponentRegistry componentRegistry, TransactionManager transactionManager, BatchContainer batchContainer, RpcManager rpcManager, DataContainer dataContainer, Marshaller marshaller, ResponseGenerator responseGenerator, CacheManager cacheManager, StateTransferManager stateTransferManager)
public V putIfAbsent(K key, V value)
putIfAbsent
in interface ConcurrentMap<K,V>
public boolean remove(Object key, Object value)
remove
in interface ConcurrentMap<K,V>
public boolean replace(K key, V oldValue, V newValue)
replace
in interface ConcurrentMap<K,V>
public V replace(K key, V value)
replace
in interface ConcurrentMap<K,V>
public int size()
size
in interface Map<K,V>
public boolean isEmpty()
isEmpty
in interface Map<K,V>
public boolean containsKey(Object key)
containsKey
in interface Map<K,V>
public boolean containsValue(Object value)
containsValue
in interface Map<K,V>
public V get(Object key)
get
in interface Map<K,V>
public V put(K key, V value)
put
in interface Map<K,V>
public V remove(Object key)
remove
in interface Map<K,V>
public void putAll(Map<? extends K,? extends V> map)
putAll
in interface Map<K,V>
public void clear()
clear
in interface Map<K,V>
public Set<K> keySet()
keySet
in interface Map<K,V>
public Collection<V> values()
values
in interface Map<K,V>
public Set<Map.Entry<K,V>> entrySet()
entrySet
in interface Map<K,V>
public void putForExternalRead(K key, V value)
Cache
ConcurrentMap.putIfAbsent(Object,
Object)
)
putForExternalRead
in interface Cache<K,V>
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.public void evict(K key)
evict
in interface Cache<K,V>
public Configuration getConfiguration()
getConfiguration
in interface Cache<K,V>
public void addListener(Object listener)
Listenable
Listener
and
further to that, contain methods annotated appropriately, otherwise the listener will not be registered.
See the Listener
annotation for more information.
addListener
in interface Listenable
listener
- must not be null.public void removeListener(Object listener)
Listenable
removeListener
in interface Listenable
listener
- listener to remove. Must not be null.public Set<Object> getListeners()
getListeners
in interface Listenable
public void start()
start
in interface Lifecycle
public void stop()
stop
in interface Lifecycle
public List<CommandInterceptor> getInterceptorChain()
AdvancedCache
getInterceptorChain
in interface AdvancedCache<K,V>
List
of CommandInterceptor
s
configured for this cachepublic void addInterceptor(CommandInterceptor i, int position)
AdvancedCache
addInterceptor
in interface AdvancedCache<K,V>
i
- the interceptor to addposition
- the position to add the interceptorpublic void addInterceptorAfter(CommandInterceptor i, Class<? extends CommandInterceptor> afterInterceptor)
AdvancedCache
addInterceptorAfter
in interface AdvancedCache<K,V>
i
- interceptor to addafterInterceptor
- interceptor type after which to place custom interceptorpublic void addInterceptorBefore(CommandInterceptor i, Class<? extends CommandInterceptor> beforeInterceptor)
AdvancedCache
addInterceptorBefore
in interface AdvancedCache<K,V>
i
- interceptor to addbeforeInterceptor
- interceptor type before which to place custom interceptorpublic void removeInterceptor(int position)
AdvancedCache
removeInterceptor
in interface AdvancedCache<K,V>
position
- the position at which to remove an interceptorpublic void removeInterceptor(Class<? extends CommandInterceptor> interceptorType)
AdvancedCache
removeInterceptor
in interface AdvancedCache<K,V>
interceptorType
- type of interceptor to removepublic EvictionManager getEvictionManager()
getEvictionManager
in interface AdvancedCache<K,V>
public ComponentRegistry getComponentRegistry()
getComponentRegistry
in interface AdvancedCache<K,V>
public void putForExternalRead(K key, V value, Flag... flags)
putForExternalRead
in interface AdvancedCache<K,V>
public V put(K key, V value, Flag... flags)
put
in interface AdvancedCache<K,V>
public V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
put
in interface AdvancedCache<K,V>
public V putIfAbsent(K key, V value, Flag... flags)
putIfAbsent
in interface AdvancedCache<K,V>
public V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
putIfAbsent
in interface AdvancedCache<K,V>
public void putAll(Map<? extends K,? extends V> map, Flag... flags)
putAll
in interface AdvancedCache<K,V>
public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit maxIdleTimeUnit, Flag... flags)
putAll
in interface AdvancedCache<K,V>
public V remove(Object key, Flag... flags)
remove
in interface AdvancedCache<K,V>
public boolean remove(Object key, Object oldValue, Flag... flags)
remove
in interface AdvancedCache<K,V>
public void clear(Flag... flags)
clear
in interface AdvancedCache<K,V>
public boolean containsKey(Object key, Flag... flags)
containsKey
in interface AdvancedCache<K,V>
public V get(Object key, Flag... flags)
get
in interface AdvancedCache<K,V>
public ComponentStatus getStatus()
getStatus
in interface Cache<K,V>
public boolean startBatch()
startBatch
in interface Cache<K,V>
public void endBatch(boolean successful)
endBatch
in interface Cache<K,V>
public String getName()
getName
in interface Cache<K,V>
public String getVersion()
getVersion
in interface Cache<K,V>
public String toString()
toString
in class Object
public <AMK,AMV> AtomicMap<AMK,AMV> getAtomicMap(K key) throws ClassCastException
AtomicMapCache
getAtomicMap
in interface AtomicMapCache<K,V>
AMK
- map keysAMV
- map valueskey
- key under which to obtain and store this map in the cache
ClassCastException
- if there already is a value stored under the given key and the type of value cannot be
used as an AtomicMap.public BatchContainer getBatchContainer()
getBatchContainer
in interface AdvancedCache<K,V>
public InvocationContextContainer getInvocationContextContainer()
getInvocationContextContainer
in interface AdvancedCache<K,V>
public DataContainer getDataContainer()
getDataContainer
in interface AdvancedCache<K,V>
public CacheManager getCacheManager()
Cache
getCacheManager
in interface Cache<K,V>
public final V put(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
Map.put(Object, Object)
, which takes in lifespan parameters.
put
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final V putIfAbsent(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
ConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.
putIfAbsent
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
Map.putAll(java.util.Map)
, which takes in lifespan parameters. Note that the lifespan
is applied to all mappings in the map passed in.
putAll
in interface Cache<K,V>
map
- map containing mappings to enterlifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle timepublic final V replace(K key, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
ConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.
replace
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public final boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit lifespanUnit, long maxIdleTime, TimeUnit idleTimeUnit)
Cache
ConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.
replace
in interface Cache<K,V>
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.lifespanUnit
- time unit for lifespanmaxIdleTime
- the maximum amount of time this key is allowed to be idle for before it is considered as
expiredidleTimeUnit
- time unit for max idle time
public V put(K key, V value, long lifespan, TimeUnit unit)
Cache
Map.put(Object, Object)
, which takes in lifespan parameters.
put
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.unit
- unit of measurement for the lifespan
public V putIfAbsent(K key, V value, long lifespan, TimeUnit unit)
Cache
ConcurrentMap.putIfAbsent(Object, Object)
, which takes in lifespan parameters.
putIfAbsent
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.unit
- unit of measurement for the lifespan
public void putAll(Map<? extends K,? extends V> map, long lifespan, TimeUnit unit)
Cache
Map.putAll(java.util.Map)
, which takes in lifespan parameters. Note that the lifespan
is applied to all mappings in the map passed in.
putAll
in interface Cache<K,V>
map
- map containing mappings to enterlifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.unit
- unit of measurement for the lifespanpublic V replace(K key, V value, long lifespan, TimeUnit unit)
Cache
ConcurrentMap.replace(Object, Object)
, which takes in lifespan parameters.
replace
in interface Cache<K,V>
key
- key to usevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.unit
- unit of measurement for the lifespan
public boolean replace(K key, V oldValue, V value, long lifespan, TimeUnit unit)
Cache
ConcurrentMap.replace(Object, Object, Object)
, which takes in lifespan parameters.
replace
in interface Cache<K,V>
key
- key to useoldValue
- value to replacevalue
- value to storelifespan
- lifespan of the entry. Negative values are intepreted as unlimited lifespan.unit
- unit of measurement for the lifespan
public AdvancedCache<K,V> getAdvancedCache()
getAdvancedCache
in interface Cache<K,V>
public void compact()
Cache
compact
in interface Cache<K,V>
public RpcManager getRpcManager()
getRpcManager
in interface AdvancedCache<K,V>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |