Class LockReleasingConnection
- java.lang.Object
-
- com.googlecode.cqengine.persistence.support.sqlite.LockReleasingConnection
-
- All Implemented Interfaces:
InvocationHandler
public class LockReleasingConnection extends Object implements InvocationHandler
Wraps aConnection
in a proxy object which delegates all method calls to it, and which additionally unlocks the given lock whenever theConnection.close()
method is closed. Unlocks the lock at most once, ignoring subsequent calls.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
invoke(Object proxy, Method m, Object[] args)
static Connection
wrap(Connection targetConnection, Lock lockToUnlock)
-
-
-
Method Detail
-
invoke
public Object invoke(Object proxy, Method m, Object[] args) throws Throwable
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
wrap
public static Connection wrap(Connection targetConnection, Lock lockToUnlock)
-
-