org.infinispan.container
Class EntryFactoryImpl
java.lang.Object
org.infinispan.container.EntryFactoryImpl
- All Implemented Interfaces:
- EntryFactory
public class EntryFactoryImpl
- extends Object
- implements EntryFactory
Method Summary |
boolean |
acquireLock(InvocationContext ctx,
Object key)
Attempts to lock an entry if the lock isn't already held in the current scope, and records the lock in the
context. |
void |
init()
|
void |
injectDependencies(DataContainer dataContainer,
LockManager lockManager,
Configuration configuration,
CacheNotifier notifier)
|
void |
releaseLock(Object key)
|
CacheEntry |
wrapEntryForReading(InvocationContext ctx,
Object key)
|
MVCCEntry |
wrapEntryForWriting(InvocationContext ctx,
InternalCacheEntry entry,
boolean createIfAbsent,
boolean forceLockIfAbsent,
boolean alreadyLocked,
boolean forRemoval)
|
MVCCEntry |
wrapEntryForWriting(InvocationContext ctx,
Object key,
boolean createIfAbsent,
boolean forceLockIfAbsent,
boolean alreadyLocked,
boolean forRemoval)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EntryFactoryImpl
public EntryFactoryImpl()
injectDependencies
public void injectDependencies(DataContainer dataContainer,
LockManager lockManager,
Configuration configuration,
CacheNotifier notifier)
init
public void init()
wrapEntryForReading
public final CacheEntry wrapEntryForReading(InvocationContext ctx,
Object key)
throws InterruptedException
- Specified by:
wrapEntryForReading
in interface EntryFactory
- Throws:
InterruptedException
wrapEntryForWriting
public final MVCCEntry wrapEntryForWriting(InvocationContext ctx,
Object key,
boolean createIfAbsent,
boolean forceLockIfAbsent,
boolean alreadyLocked,
boolean forRemoval)
throws InterruptedException
- Specified by:
wrapEntryForWriting
in interface EntryFactory
- Throws:
InterruptedException
wrapEntryForWriting
public MVCCEntry wrapEntryForWriting(InvocationContext ctx,
InternalCacheEntry entry,
boolean createIfAbsent,
boolean forceLockIfAbsent,
boolean alreadyLocked,
boolean forRemoval)
throws InterruptedException
- Specified by:
wrapEntryForWriting
in interface EntryFactory
- Throws:
InterruptedException
acquireLock
public final boolean acquireLock(InvocationContext ctx,
Object key)
throws InterruptedException,
TimeoutException
- Attempts to lock an entry if the lock isn't already held in the current scope, and records the lock in the
context.
- Specified by:
acquireLock
in interface EntryFactory
- Parameters:
ctx
- contextkey
- Key to lock
- Returns:
- true if a lock was needed and acquired, false if it didn't need to acquire the lock (i.e., lock was
already held)
- Throws:
InterruptedException
- if interrupted
TimeoutException
- if we are unable to acquire the lock after a specified timeout.
releaseLock
public final void releaseLock(Object key)
- Specified by:
releaseLock
in interface EntryFactory
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.