public class InternalEntryFactoryImpl extends Object implements InternalEntryFactory
Constructor and Description |
---|
InternalEntryFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
CacheEntry |
copy(CacheEntry cacheEntry)
Creates a copy of this cache entry and synchronizes serializes the copy process with the
InternalEntryFactory.update(org.infinispan.container.entries.InternalCacheEntry, org.infinispan.metadata.Metadata) . |
InternalCacheEntry |
create(CacheEntry cacheEntry)
Creates a new
InternalCacheEntry instance based on the key, value, version and timestamp/lifespan
information reflected in the CacheEntry instance passed in. |
InternalCacheEntry |
create(Object key,
Object value,
EntryVersion version,
long created,
long lifespan,
long lastUsed,
long maxIdle)
Creates a new
InternalCacheEntry instance |
InternalCacheEntry |
create(Object key,
Object value,
InternalCacheEntry cacheEntry)
Creates a new
InternalCacheEntry instance based on the version and timestamp/lifespan
information reflected in the CacheEntry instance passed in. |
InternalCacheEntry |
create(Object key,
Object value,
Metadata metadata)
Creates a new
InternalCacheEntry instance |
InternalCacheEntry |
create(Object key,
Object value,
Metadata metadata,
long lifespan,
long maxIdle)
Creates a new
InternalCacheEntry instance |
InternalCacheEntry |
create(Object key,
Object value,
Metadata metadata,
long created,
long lifespan,
long lastUsed,
long maxIdle)
Creates a new
InternalCacheEntry instance |
<K,V> InternalCacheEntry |
createL1(K key,
V value,
Metadata metadata)
Creates a L1 entry.
|
InternalCacheValue |
createValue(CacheEntry cacheEntry)
Creates an
InternalCacheValue based on the InternalCacheEntry passed in. |
<K,V> InternalCacheValue<V> |
getValueFromCtx(K key,
InvocationContext ctx)
Retrieve an
InternalCacheValue from the provided InvocationContext if an InternalCacheEntry
exists, otherwise create InternalCacheEntry from the context's CacheEntry and return its value. |
static boolean |
isStoreMetadata(Metadata metadata,
InternalCacheEntry ice)
Indicates whether the entire metadata object needs to be stored or not.
|
InternalCacheEntry |
update(InternalCacheEntry ice,
Metadata metadata)
TODO: Adjust javadoc
Updates an existing
InternalCacheEntry with new metadata. |
InternalCacheEntry |
update(InternalCacheEntry cacheEntry,
Object value,
Metadata metadata)
Similar to
InternalEntryFactory.update(org.infinispan.container.entries.InternalCacheEntry, org.infinispan.metadata.Metadata)
but it also updates the InternalCacheEntry value. |
public InternalCacheEntry create(Object key, Object value, Metadata metadata)
InternalEntryFactory
InternalCacheEntry
instancecreate
in interface InternalEntryFactory
key
- key to usevalue
- value to usemetadata
- metadata for entrypublic InternalCacheEntry create(CacheEntry cacheEntry)
InternalEntryFactory
InternalCacheEntry
instance based on the key, value, version and timestamp/lifespan
information reflected in the CacheEntry
instance passed in.create
in interface InternalEntryFactory
cacheEntry
- cache entry to copypublic InternalCacheEntry create(Object key, Object value, InternalCacheEntry cacheEntry)
InternalEntryFactory
InternalCacheEntry
instance based on the version and timestamp/lifespan
information reflected in the CacheEntry
instance passed in. Key and value are both passed in
explicitly.create
in interface InternalEntryFactory
key
- key to usevalue
- value to usecacheEntry
- cache entry to retrieve version and timestamp/lifespan information frompublic InternalCacheEntry create(Object key, Object value, EntryVersion version, long created, long lifespan, long lastUsed, long maxIdle)
InternalEntryFactory
InternalCacheEntry
instancecreate
in interface InternalEntryFactory
key
- key to usevalue
- value to useversion
- version to usecreated
- creation timestamp to uselifespan
- lifespan to uselastUsed
- lastUsed timestamp to usemaxIdle
- maxIdle to usepublic InternalCacheEntry create(Object key, Object value, Metadata metadata, long created, long lifespan, long lastUsed, long maxIdle)
InternalEntryFactory
InternalCacheEntry
instancecreate
in interface InternalEntryFactory
key
- key to usevalue
- value to usemetadata
- metadata for entrycreated
- creation timestamp to uselifespan
- lifespan to uselastUsed
- lastUsed timestamp to usemaxIdle
- maxIdle to usepublic InternalCacheValue createValue(CacheEntry cacheEntry)
InternalEntryFactory
InternalCacheValue
based on the InternalCacheEntry
passed in.createValue
in interface InternalEntryFactory
cacheEntry
- to use to generate a InternalCacheValue
InternalCacheValue
public InternalCacheEntry create(Object key, Object value, Metadata metadata, long lifespan, long maxIdle)
InternalEntryFactory
InternalCacheEntry
instancecreate
in interface InternalEntryFactory
key
- key to usevalue
- value to usemetadata
- metadata for entrylifespan
- lifespan to usemaxIdle
- maxIdle to usepublic InternalCacheEntry update(InternalCacheEntry ice, Metadata metadata)
InternalEntryFactory
InternalCacheEntry
with new metadata. This may result in a new
InternalCacheEntry
instance being created, as a different InternalCacheEntry
implementation
may be more appropriate to suit the new metadata values. As such, one should consider the InternalCacheEntry
passed in as a parameter as passed by value and not by reference.update
in interface InternalEntryFactory
ice
- original internal cache entrymetadata
- new metadatapublic InternalCacheEntry update(InternalCacheEntry cacheEntry, Object value, Metadata metadata)
InternalEntryFactory
InternalEntryFactory.update(org.infinispan.container.entries.InternalCacheEntry, org.infinispan.metadata.Metadata)
but it also updates the InternalCacheEntry
value.
If the same internal cache entry is returned and if it is a mortal cache entry, the returned instance needs to be
reincarnated.update
in interface InternalEntryFactory
cacheEntry
- original internal cache entryvalue
- new valuemetadata
- new metadatapublic CacheEntry copy(CacheEntry cacheEntry)
InternalEntryFactory
InternalEntryFactory.update(org.infinispan.container.entries.InternalCacheEntry, org.infinispan.metadata.Metadata)
.
This is requires so that readers of the entry will get an consistent snapshot of the value red.copy
in interface InternalEntryFactory
public <K,V> InternalCacheEntry createL1(K key, V value, Metadata metadata)
InternalEntryFactory
createL1
in interface InternalEntryFactory
K
- The key type for the entryV
- The value type for the entryvalue
- @return a new InternalCacheEntry
public <K,V> InternalCacheValue<V> getValueFromCtx(K key, InvocationContext ctx)
InternalEntryFactory
InternalCacheValue
from the provided InvocationContext
if an InternalCacheEntry
exists, otherwise create InternalCacheEntry
from the context's CacheEntry
and return its value.
If the entry is not in the context a null value is returned
getValueFromCtx
in interface InternalEntryFactory
K
- The key type for the entryV
- The value type for the entrykey
- the key of the entry to be retrievedctx
- the invocation context from which the value should be retrievedInternalCacheValue
public static boolean isStoreMetadata(Metadata metadata, InternalCacheEntry ice)
Copyright © 2021 JBoss by Red Hat. All rights reserved.