org.infinispan.factories
Interface EntryFactory

All Known Implementing Classes:
EntryFactoryImpl

public interface EntryFactory

// TODO: MANIK: Document this

Since:
4.0
Author:
Manik Surtani (manik@jboss.org)

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 releaseLock(Object key)
           
 CacheEntry wrapEntryForReading(InvocationContext ctx, Object key)
           
 MVCCEntry wrapEntryForWriting(InvocationContext ctx, Object key, boolean createIfAbsent, boolean forceLockIfAbsent, boolean alreadyLocked, boolean forRemoval)
           
 

Method Detail

releaseLock

void releaseLock(Object key)

acquireLock

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.

Parameters:
ctx - context
key - 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.

wrapEntryForWriting

MVCCEntry wrapEntryForWriting(InvocationContext ctx,
                              Object key,
                              boolean createIfAbsent,
                              boolean forceLockIfAbsent,
                              boolean alreadyLocked,
                              boolean forRemoval)
                              throws InterruptedException
Throws:
InterruptedException

wrapEntryForReading

CacheEntry wrapEntryForReading(InvocationContext ctx,
                               Object key)
                               throws InterruptedException
Throws:
InterruptedException

Google Analytics

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