org.infinispan.container
Class EntryFactoryImpl

java.lang.Object
  extended by org.infinispan.container.EntryFactoryImpl
All Implemented Interfaces:
EntryFactory
Direct Known Subclasses:
IncrementalVersionableEntryFactoryImpl

public class EntryFactoryImpl
extends Object
implements EntryFactory

EntryFactory implementation to be used for optimistic locking scheme.

Since:
5.1
Author:
Mircea Markus

Field Summary
protected  boolean localModeWriteSkewCheck
           
protected  boolean useRepeatableRead
           
 
Constructor Summary
EntryFactoryImpl()
           
 
Method Summary
protected  MVCCEntry createWrappedEntry(Object key, Object value, EntryVersion version, boolean isForInsert, boolean forRemoval, long lifespan)
           
 void init()
           
 void injectDependencies(DataContainer dataContainer, Configuration configuration, CacheNotifier notifier)
           
 MVCCEntry wrapEntryForClear(InvocationContext ctx, Object key)
          Used for wrapping individual keys when clearing the cache.
 CacheEntry wrapEntryForDelta(InvocationContext ctx, Object deltaKey, Delta delta)
          Used for wrapping Delta entry to be applied to DeltaAware object stored in cache.
 MVCCEntry wrapEntryForPut(InvocationContext ctx, Object key, InternalCacheEntry icEntry, boolean undeleteIfNeeded)
          Used for wrapping a cache entry for addition to cache.
 CacheEntry wrapEntryForReading(InvocationContext ctx, Object key)
          Wraps an entry for reading.
 MVCCEntry wrapEntryForRemove(InvocationContext ctx, Object key)
          Used for wrapping a cache entry for removal.
 MVCCEntry wrapEntryForReplace(InvocationContext ctx, Object key)
          Used for wrapping a cache entry for replacement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

useRepeatableRead

protected boolean useRepeatableRead

localModeWriteSkewCheck

protected boolean localModeWriteSkewCheck
Constructor Detail

EntryFactoryImpl

public EntryFactoryImpl()
Method Detail

injectDependencies

public void injectDependencies(DataContainer dataContainer,
                               Configuration configuration,
                               CacheNotifier notifier)

init

public void init()

wrapEntryForReading

public final CacheEntry wrapEntryForReading(InvocationContext ctx,
                                            Object key)
                                     throws InterruptedException
Description copied from interface: EntryFactory
Wraps an entry for reading. Usually this is just a raw 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.

Specified by:
wrapEntryForReading in interface EntryFactory
Parameters:
ctx - current invocation context
key - key to look up and wrap
Throws:
InterruptedException - when things go wrong, usually trying to acquire a lock

wrapEntryForClear

public final MVCCEntry wrapEntryForClear(InvocationContext ctx,
                                         Object key)
                                  throws InterruptedException
Description copied from interface: EntryFactory
Used for wrapping individual keys when clearing the cache. The wrapped entry is added to the supplied InvocationContext.

Specified by:
wrapEntryForClear in interface EntryFactory
Throws:
InterruptedException

wrapEntryForReplace

public final MVCCEntry wrapEntryForReplace(InvocationContext ctx,
                                           Object key)
                                    throws InterruptedException
Description copied from interface: EntryFactory
Used for wrapping a cache entry for replacement. The wrapped entry is added to the supplied InvocationContext.

Specified by:
wrapEntryForReplace in interface EntryFactory
Throws:
InterruptedException

wrapEntryForRemove

public final MVCCEntry wrapEntryForRemove(InvocationContext ctx,
                                          Object key)
                                   throws InterruptedException
Description copied from interface: EntryFactory
Used for wrapping a cache entry for removal. The wrapped entry is added to the supplied InvocationContext.

Specified by:
wrapEntryForRemove in interface EntryFactory
Throws:
InterruptedException

wrapEntryForPut

public final MVCCEntry wrapEntryForPut(InvocationContext ctx,
                                       Object key,
                                       InternalCacheEntry icEntry,
                                       boolean undeleteIfNeeded)
                                throws InterruptedException
Description copied from interface: EntryFactory
Used for wrapping a cache entry for addition to cache. The wrapped entry is added to the supplied InvocationContext.

Specified by:
wrapEntryForPut in interface EntryFactory
Throws:
InterruptedException

wrapEntryForDelta

public CacheEntry wrapEntryForDelta(InvocationContext ctx,
                                    Object deltaKey,
                                    Delta delta)
                             throws InterruptedException
Description copied from interface: EntryFactory
Used for wrapping Delta entry to be applied to DeltaAware object stored in cache. The wrapped entry is added to the supplied InvocationContext.

Specified by:
wrapEntryForDelta in interface EntryFactory
Throws:
InterruptedException

createWrappedEntry

protected MVCCEntry createWrappedEntry(Object key,
                                       Object value,
                                       EntryVersion version,
                                       boolean isForInsert,
                                       boolean forRemoval,
                                       long lifespan)

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.