1 22 package org.jboss.aspects.concurrent; 23 24 import java.util.concurrent.CountDownLatch ; 25 26 31 public class LatchedObjectMixin implements LatchedObject 32 { 33 private CountDownLatch latch; 34 35 public LatchedObjectMixin(Object obj) 36 { 37 Latched l = obj.getClass().getAnnotation(Latched.class); 38 latch = new CountDownLatch (l.countdown()); 39 } 40 public CountDownLatch getLatch() 41 { 42 return latch; 43 } 44 45 public void resetLatch(int count) 46 { 47 latch = new CountDownLatch (count); 48 } 49 } 50 | Popular Tags |