Class LockReleasingConnection

  • All Implemented Interfaces:
    InvocationHandler

    public class LockReleasingConnection
    extends Object
    implements InvocationHandler
    Wraps a Connection in a proxy object which delegates all method calls to it, and which additionally unlocks the given lock whenever the Connection.close() method is closed.

    Unlocks the lock at most once, ignoring subsequent calls.