com.voidsearch.voidbase.apps.cache
Class CacheModuleLockStrategy

java.lang.Object
  extended by com.voidsearch.voidbase.apps.cache.CacheModuleLockStrategy

public class CacheModuleLockStrategy
extends java.lang.Object

CacheModuleLockStrategy handles atomicity of cache operations based on cache handler configuration


Field Summary
protected static org.slf4j.Logger logger
           
 
Constructor Summary
CacheModuleLockStrategy()
          Creates a new instance of CacheModuleLockStrategy
 
Method Summary
protected  CacheValue execute(VoidBaseCache handler, java.lang.String operation, java.util.List<java.lang.String> route, java.util.Map<java.lang.String,java.lang.String> params, java.lang.String key, java.lang.String value)
          Executes cache operation with respect to operation's atomicity and proxies it down to specific executors (atomic, global lock, etc.)
protected  CacheValue execute(VoidBaseCache handler, java.lang.String operation, java.lang.String name, java.lang.String key, java.lang.String value)
          Executes cache operation with respect to operation's atomicity and proxies it down to specific executors (atomic, global lock, etc.)
protected  CacheValue executeAtomicLockOperation(VoidBaseCache handler, java.lang.String operation, java.util.List<java.lang.String> route, java.util.Map<java.lang.String,java.lang.String> params, java.lang.String key, java.lang.String value)
          Executes atomic operation on cache
protected  CacheValue executeAtomicLockOperation(VoidBaseCache handler, java.lang.String operation, java.lang.String name, java.lang.String key, java.lang.String value)
          Executes atomic operation on cache
protected  CacheValue executeGlobalLockOperation(VoidBaseCache handler, java.lang.String operation, java.util.List<java.lang.String> route, java.util.Map<java.lang.String,java.lang.String> params, java.lang.String key, java.lang.String value)
          Executes globally locked operation on cache
protected  CacheValue executeGlobalLockOperation(VoidBaseCache handler, java.lang.String operation, java.lang.String name, java.lang.String key, java.lang.String value)
           
protected  CacheValue executeOperation(VoidBaseCache handler, java.lang.String operation, java.util.List<java.lang.String> route, java.util.Map<java.lang.String,java.lang.String> params, java.lang.String key, java.lang.String value)
          Executes operation on cache without any locking
protected  CacheValue executeOperation(VoidBaseCache handler, java.lang.String operation, java.lang.String name, java.lang.String key, java.lang.String value)
          Executes operation on cache without any locking
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final org.slf4j.Logger logger
Constructor Detail

CacheModuleLockStrategy

public CacheModuleLockStrategy()
Creates a new instance of CacheModuleLockStrategy

Method Detail

execute

protected CacheValue execute(VoidBaseCache handler,
                             java.lang.String operation,
                             java.util.List<java.lang.String> route,
                             java.util.Map<java.lang.String,java.lang.String> params,
                             java.lang.String key,
                             java.lang.String value)
                      throws CacheException
Executes cache operation with respect to operation's atomicity and proxies it down to specific executors (atomic, global lock, etc.)

Parameters:
handler -
operation -
route -
params -
key -
value -
Returns:
a response from operation
Throws:
CacheException

execute

protected CacheValue execute(VoidBaseCache handler,
                             java.lang.String operation,
                             java.lang.String name,
                             java.lang.String key,
                             java.lang.String value)
                      throws CacheException
Executes cache operation with respect to operation's atomicity and proxies it down to specific executors (atomic, global lock, etc.)

Parameters:
handler -
operation -
name -
key -
value -
Returns:
Throws:
CacheException

executeAtomicLockOperation

protected CacheValue executeAtomicLockOperation(VoidBaseCache handler,
                                                java.lang.String operation,
                                                java.util.List<java.lang.String> route,
                                                java.util.Map<java.lang.String,java.lang.String> params,
                                                java.lang.String key,
                                                java.lang.String value)
                                         throws CacheException,
                                                java.lang.InterruptedException
Executes atomic operation on cache

Parameters:
handler -
operation -
route -
params -
key -
value -
Returns:
a response from operation
Throws:
CacheException
java.lang.InterruptedException

executeAtomicLockOperation

protected CacheValue executeAtomicLockOperation(VoidBaseCache handler,
                                                java.lang.String operation,
                                                java.lang.String name,
                                                java.lang.String key,
                                                java.lang.String value)
                                         throws CacheException,
                                                java.lang.InterruptedException
Executes atomic operation on cache

Parameters:
handler -
operation -
name -
key -
value -
Returns:
Throws:
CacheException
java.lang.InterruptedException

executeGlobalLockOperation

protected CacheValue executeGlobalLockOperation(VoidBaseCache handler,
                                                java.lang.String operation,
                                                java.util.List<java.lang.String> route,
                                                java.util.Map<java.lang.String,java.lang.String> params,
                                                java.lang.String key,
                                                java.lang.String value)
                                         throws CacheException
Executes globally locked operation on cache

Parameters:
handler -
operation -
route -
params -
key -
value -
Returns:
a response from operation
Throws:
CacheException

executeGlobalLockOperation

protected CacheValue executeGlobalLockOperation(VoidBaseCache handler,
                                                java.lang.String operation,
                                                java.lang.String name,
                                                java.lang.String key,
                                                java.lang.String value)
                                         throws CacheException
Throws:
CacheException

executeOperation

protected CacheValue executeOperation(VoidBaseCache handler,
                                      java.lang.String operation,
                                      java.util.List<java.lang.String> route,
                                      java.util.Map<java.lang.String,java.lang.String> params,
                                      java.lang.String key,
                                      java.lang.String value)
                               throws CacheException
Executes operation on cache without any locking

Parameters:
handler -
operation -
route -
params -
key -
value -
Returns:
a response from operation
Throws:
CacheException

executeOperation

protected CacheValue executeOperation(VoidBaseCache handler,
                                      java.lang.String operation,
                                      java.lang.String name,
                                      java.lang.String key,
                                      java.lang.String value)
                               throws CacheException
Executes operation on cache without any locking

Parameters:
handler -
operation -
name -
key -
value -
Returns:
Throws:
CacheException


Copyright © 2009. All Rights Reserved.