Package org.infinispan.container.impl
Class EntryFactoryImpl
- java.lang.Object
-
- org.infinispan.container.impl.EntryFactoryImpl
-
- All Implemented Interfaces:
EntryFactory
public class EntryFactoryImpl extends Object implements EntryFactory
EntryFactory
implementation to be used for optimistic locking scheme.- Since:
- 5.1
- Author:
- Mircea Markus
-
-
Constructor Summary
Constructors Constructor Description EntryFactoryImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MVCCEntry
createWrappedEntry(Object key, CacheEntry cacheEntry)
void
init()
void
wrapEntryForExpired(InvocationContext ctx, Object key, int segment, boolean isOwner)
Insert an entry that exists in the data container into the context, even if it is expired Doesn't do anything if the key was already wrappedvoid
wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner)
Wraps an entry for reading.void
wrapEntryForWriting(InvocationContext ctx, Object key, int segment, boolean isOwner, boolean isRead)
Insert an entry that exists in the data container into the context.void
wrapExternalEntry(InvocationContext ctx, Object key, CacheEntry externalEntry, boolean isRead, boolean isWrite)
Insert an external entry (e.g.
-
-
-
Method Detail
-
init
public void init()
-
wrapEntryForReading
public final void wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner)
Description copied from interface:EntryFactory
Wraps an entry for reading. Usually this is just a rawCacheEntry
but certain combinations of isolation levels and the presence of an ongoing JTA transaction may force this to be a proper, wrapped MVCCEntry. The entry is also typically placed in the invocation context.- Specified by:
wrapEntryForReading
in interfaceEntryFactory
- Parameters:
ctx
- current invocation contextkey
- key to look up and wrapsegment
- segment for the keyisOwner
- true if this node is current owner in readCH (or we ignore CH)
-
wrapEntryForWriting
public void wrapEntryForWriting(InvocationContext ctx, Object key, int segment, boolean isOwner, boolean isRead)
Description copied from interface:EntryFactory
Insert an entry that exists in the data container into the context. Doesn't do anything if the key was already wrapped.- Specified by:
wrapEntryForWriting
in interfaceEntryFactory
- Parameters:
ctx
- current invocation contextkey
- key to look up and wrapsegment
- segment for the keyisOwner
- true if this node is current owner in readCH (or we ignore CH)isRead
- true if this operation is expected to read the value of the entry
-
wrapEntryForExpired
public void wrapEntryForExpired(InvocationContext ctx, Object key, int segment, boolean isOwner)
Description copied from interface:EntryFactory
Insert an entry that exists in the data container into the context, even if it is expired Doesn't do anything if the key was already wrapped- Specified by:
wrapEntryForExpired
in interfaceEntryFactory
- Parameters:
ctx
- current invocation contextkey
- key to look up and wrapsegment
- segment for the keyisOwner
- true if this node is current owner in readCH (or we ignore CH)
-
wrapExternalEntry
public void wrapExternalEntry(InvocationContext ctx, Object key, CacheEntry externalEntry, boolean isRead, boolean isWrite)
Description copied from interface:EntryFactory
Insert an external entry (e.g. loaded from a cache loader or from a remote node) into the context.- Specified by:
wrapExternalEntry
in interfaceEntryFactory
- Parameters:
ctx
- current invocation contextkey
- key to look up and wrapexternalEntry
- the value to be inserted into contextisRead
- true if this operation is expected to read the value of the entryisWrite
- if this is executed within a write command
-
createWrappedEntry
protected MVCCEntry createWrappedEntry(Object key, CacheEntry cacheEntry)
-
-