I\'m looking for a way to synchronize a method based on the parameter it receives, something like this:
public synchronized void doSomething(name){ //some co
I've created a tokenProvider based on the IdMutexProvider of McDowell. The manager uses a WeakHashMap which takes care of cleaning up unused locks.
WeakHashMap
You could find my implementation here.