|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjconch.lock.AbstractLogEqLock<OBJ_T,Object>
jconch.lock.SyncLogEqLock<OBJ_T>
OBJ_T - The type of object being processed by the lock.public class SyncLogEqLock<OBJ_T>
This class should be used to implement logically equivalent locks.
Currently, Java has a major failing in its synchronization mechanism. The
synchronize keyword operates at the reference level, which
means that two different but logically equivalent objects can enter the same
synchronized block concurrently. Since POJOs are often generated such that
they are logically equivalent, but referentially different, this is a
problem.
A single instance of this class will provide the same Object instance
for each logically equivalent object passed in.
| Constructor Summary | |
|---|---|
SyncLogEqLock()
Default constructor. |
|
| Method Summary | |
|---|---|
protected Object |
createNewLock()
Implementation of the "lock" that is created. |
static SyncLogEqLock<Object> |
getGlobalInstance()
Provides the same instance of this class every time it is called. |
| Methods inherited from class jconch.lock.AbstractLogEqLock |
|---|
getLock, hasLockFor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SyncLogEqLock()
| Method Detail |
|---|
public static SyncLogEqLock<Object> getGlobalInstance()
protected Object createNewLock()
AbstractLogEqLock
createNewLock in class AbstractLogEqLock<OBJ_T,Object>Object.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||