This document explains the requirements and the design of a concurrency framework.
Even though concurrency support is provided as part the Java platform standard edition, this support focusses only on concurrency within a single virtual machine. Therefore, separate concurrency support is required that can be used transparently within a standard single JVM environment as well as in a clustered environment. The current concurrency support is implemented only for a single JVM, but implementations for a clustered environment are also possible.
The current functionality is really small. It will be extended as soon as more concurrency problems are found.
To cover the requirements Lock interface is provided which is the interface for a single reentrant pessimistic lock. There is one impkementation of this lock for within a single JVM environment. It is possible also to provide a lock which is suitable within a clustered environment.
The JvmLock class is the implementation of the Lock interface for within a single JVM environment. It uses the standard ReentrantLock class from the Java runtime environment for its implementation. In addition, a LockAdvice class is present by which method invocations can be automatically guarded by a lock using AOP.
To use the concurrency support effectively, the following rules should be followed: