Package org.jboss.ejb3.aop.annotation

Examples of org.jboss.ejb3.aop.annotation.CachingAnnotationRepository.addAnnotation()


      AnnotationRepository repository = new CachingAnnotationRepository(delegate, classLoader);
     
      Method member = beanClass.getDeclaredMethod("sayHi", String.class);
      String annotation = "javax.interceptor.Interceptors";
      String value = "@javax.interceptor.Interceptors (value={" + DummyInterceptor.class.getName() + ".class})";
      repository.addAnnotation(member, annotation, value);
     
      Interceptors interceptors = (Interceptors) repository.resolveAnnotation(member, Interceptors.class);
      assertArrayEquals(new Class[] { DummyInterceptor.class }, interceptors.value());
   }
}
View Full Code Here


      ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
      AnnotationRepositoryToMetaData repository = new AnnotationRepositoryToMetaData(TwoLifecycleMethodsBean.class, beanMetaData, canonicalObjectName, classLoader);
     
      Method method = Dummy.class.getDeclaredMethod("dummyMethod");
      Annotation annotation = new ResourceImpl();
      repository.addAnnotation(method, Resource.class, annotation);
     
      assertTrue("Failed to find annotation @Resource on " + method, repository.hasAnnotation(method, Resource.class));
   }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.