/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.aspects.concurrent;

import java.util.concurrent.locks.ReentrantLock;

/**
 * comment
 *
 * @author <a href="mailto:bill@jboss.org">Bill Burke</a>
 */
public class MutexedObjectMixin implements MutexedObject
{
   protected ReentrantLock lock;

   public MutexedObjectMixin(Object obj)
   {
      Mutexed m = obj.getClass().getAnnotation(Mutexed.class);
      lock = new ReentrantLock(m.isFair());
   }

   public ReentrantLock getMutex()
   {
      return lock;
   }
}
