1 22 package org.jboss.aspects.concurrent; 23 24 import java.util.concurrent.locks.ReentrantLock ; 25 26 31 public class MutexedObjectMixin implements MutexedObject 32 { 33 protected ReentrantLock lock; 34 35 public MutexedObjectMixin(Object obj) 36 { 37 Mutexed m = obj.getClass().getAnnotation(Mutexed.class); 38 lock = new ReentrantLock (m.isFair()); 39 } 40 41 public ReentrantLock getMutex() 42 { 43 return lock; 44 } 45 } 46 | Popular Tags |