use of org.infinispan.container.entries.ReadCommittedEntry in project infinispan by infinispan.
the class EntryFactoryImpl method createWrappedEntry.
protected MVCCEntry<?, ?> createWrappedEntry(Object key, CacheEntry<?, ?> cacheEntry) {
Object value = null;
Metadata metadata = null;
PrivateMetadata internalMetadata = null;
if (cacheEntry != null) {
synchronized (cacheEntry) {
value = cacheEntry.getValue();
metadata = cacheEntry.getMetadata();
internalMetadata = cacheEntry.getInternalMetadata();
}
}
if (log.isTraceEnabled())
log.tracef("Creating new entry for key %s", toStr(key));
MVCCEntry<?, ?> mvccEntry;
if (useRepeatableRead) {
if (useVersioning) {
if (internalMetadata == null) {
internalMetadata = nonExistingPrivateMetadata;
}
mvccEntry = new VersionedRepeatableReadEntry(key, value, metadata);
} else {
mvccEntry = new RepeatableReadEntry(key, value, metadata);
}
} else {
mvccEntry = new ReadCommittedEntry(key, value, metadata);
}
mvccEntry.setInternalMetadata(internalMetadata);
if (cacheEntry != null) {
mvccEntry.setCreated(cacheEntry.getCreated());
mvccEntry.setLastUsed(cacheEntry.getLastUsed());
}
return mvccEntry;
}
Aggregations