org.infinispan.context
Interface EntryLookup

All Known Subinterfaces:
InvocationContext, TransactionContext
All Known Implementing Classes:
InvocationContextImpl, TransactionContextImpl

public interface EntryLookup

Interface that can look up MVCC wrapped entries.

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

Method Summary
 void clearLookedUpEntries()
          Clears the collection of entries looked up
 BidirectionalMap<Object,CacheEntry> getLookedUpEntries()
          Retrieves a map of entries looked up within the current scope.
 boolean hasLockedKey(Object key)
          Note that if a transaction is in scope, implementations should test this lock from on TransactionContext.
 boolean isContainsLocks()
           
 boolean isContainsModifications()
           
 CacheEntry lookupEntry(Object key)
          Retrieves an entry from the collection of looked up entries in the current scope.
 void putLookedUpEntries(Map<Object,CacheEntry> lookedUpEntries)
           
 void putLookedUpEntry(Object key, CacheEntry e)
          Puts an entry in the registry of looked up entries in the current scope.
 void removeLookedUpEntry(Object key)
           
 void setContainsLocks(boolean b)
          Sets whether locks have been acquired in the current context
 void setContainsModifications(boolean b)
          Sets whether modifications have been made in the current context
 

Method Detail

lookupEntry

CacheEntry lookupEntry(Object key)
Retrieves an entry from the collection of looked up entries in the current scope.

If a transaction is in progress, implementations should delegate to the same method in TransactionContext.

Parameters:
key - key to look up
Returns:
an entry, or null if it cannot be found.

getLookedUpEntries

BidirectionalMap<Object,CacheEntry> getLookedUpEntries()
Retrieves a map of entries looked up within the current scope.

If a transaction is in progress, implementations should delegate to the same method in TransactionContext.

Returns:
a map of looked up entries.

putLookedUpEntry

void putLookedUpEntry(Object key,
                      CacheEntry e)
Puts an entry in the registry of looked up entries in the current scope.

If a transaction is in progress, implementations should delegate to the same method in TransactionContext.

Parameters:
key - key to store
e - entry to store

putLookedUpEntries

void putLookedUpEntries(Map<Object,CacheEntry> lookedUpEntries)

removeLookedUpEntry

void removeLookedUpEntry(Object key)

clearLookedUpEntries

void clearLookedUpEntries()
Clears the collection of entries looked up


hasLockedKey

boolean hasLockedKey(Object key)
Note that if a transaction is in scope, implementations should test this lock from on TransactionContext. Using this method should always ensure locks checked in the appropriate scope.

Parameters:
key - lock to test
Returns:
true if the lock being tested is already held in the current scope, false otherwise.

isContainsModifications

boolean isContainsModifications()
Returns:
true if the context contains modifications, false otherwise

setContainsModifications

void setContainsModifications(boolean b)
Sets whether modifications have been made in the current context


isContainsLocks

boolean isContainsLocks()
Returns:
true if the context contains locks, false otherwise

setContainsLocks

void setContainsLocks(boolean b)
Sets whether locks have been acquired in the current context



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