commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Zeigermann (JIRA)" <j...@apache.org>
Subject [jira] Created: (TRANSACTION-20) Create a new type of lock manager
Date Sun, 22 Jul 2007 12:26:06 GMT
Create a new type of lock manager
---------------------------------

                 Key: TRANSACTION-20
                 URL: https://issues.apache.org/jira/browse/TRANSACTION-20
             Project: Commons Transaction
          Issue Type: New Feature
    Affects Versions: 2.0
            Reporter: Oliver Zeigermann
            Assignee: Oliver Zeigermann


For the new implementations we need a new type of lock manager. We need something general
that can be used for the file manager, the tx maps, and optionally can even be used in a general
programming environment.

This is my proposal. It is meant to be used by one or more transactional resource managers:

public interface LockManager<K> {
    public void startWork(long timeout, TimeUnit unit);
    public void endWork();
    public void lock(K key, boolean exclusive) throws LockException;
}

Where "startWork" starts a block of work for which a certain set of locks is required and
"endWork" ends it. Only in between these call one can use the "lock" method to lock resources
denoted by the given key. 

The timeout is meant for the whole block of work and thus does not have to be passed with
every lock request.

At the end of the working block all locks are released. 

The "lock" method throws an exception in case of timeout, interruption or deadlock.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message