com.calitha.concurrent
Class LockProxyFactory

java.lang.Object
  extended by com.calitha.concurrent.LockProxyFactory

public final class LockProxyFactory
extends Object

Factory for creating object with automatic locking.

Author:
Robert van Loenhout

Method Summary
static
<T> T
createReadWriteLockProxy(T obj, Class<T> clazz)
          Creates a proxy that uses the annotations on methods to use a read or write lock.
static
<T> T
createSynchronizedProxy(T obj, Class<T> clazz)
          Creates a proxy that uses synchronized on each method for locking.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createReadWriteLockProxy

public static <T> T createReadWriteLockProxy(T obj,
                                             Class<T> clazz)
Creates a proxy that uses the annotations on methods to use a read or write lock.

Parameters:
obj - object for which the proxy must be created
clazz - proxy interface class
Returns:
proxy

createSynchronizedProxy

public static <T> T createSynchronizedProxy(T obj,
                                            Class<T> clazz)
Creates a proxy that uses synchronized on each method for locking.

Parameters:
obj - object for which the proxy must be created
clazz - proxy interface class
Returns:
proxy