public class EntryFactoryImpl extends Object implements EntryFactory
EntryFactory
implementation to be used for optimistic locking scheme.Constructor and Description |
---|
EntryFactoryImpl() |
Modifier and Type | Method and Description |
---|---|
protected MVCCEntry<?,?> |
createWrappedEntry(Object key,
CacheEntry<?,?> cacheEntry) |
void |
init() |
void |
wrapEntryForExpired(InvocationContext ctx,
Object key,
int segment)
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
|
CompletionStage<Void> |
wrapEntryForReading(InvocationContext ctx,
Object key,
int segment,
boolean isOwner,
boolean hasLock)
Wraps an entry for reading.
|
CompletionStage<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.
|
public void init()
public final CompletionStage<Void> wrapEntryForReading(InvocationContext ctx, Object key, int segment, boolean isOwner, boolean hasLock)
EntryFactory
CacheEntry
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.wrapEntryForReading
in interface EntryFactory
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)hasLock
- true if the invoker already has the lock for this keypublic CompletionStage<Void> wrapEntryForWriting(InvocationContext ctx, Object key, int segment, boolean isOwner, boolean isRead)
EntryFactory
The returned stage will always be complete if isOwner is false.
wrapEntryForWriting
in interface EntryFactory
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 entrypublic void wrapEntryForExpired(InvocationContext ctx, Object key, int segment)
EntryFactory
wrapEntryForExpired
in interface EntryFactory
ctx
- current invocation contextkey
- key to look up and wrapsegment
- segment for the keypublic void wrapExternalEntry(InvocationContext ctx, Object key, CacheEntry externalEntry, boolean isRead, boolean isWrite)
EntryFactory
wrapExternalEntry
in interface EntryFactory
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 commandprotected MVCCEntry<?,?> createWrappedEntry(Object key, CacheEntry<?,?> cacheEntry)
Copyright © 2021 JBoss by Red Hat. All rights reserved.