Created
April 17, 2012 17:13
-
-
Save antoinesd/2407572 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<X> void processAnnotatedType(@Observes final ProcessAnnotatedType<X> pat, BeanManager beanManager) { | |
final AnnotatedType<X> annotatedType = pat.getAnnotatedType(); | |
final Class<X> javaClass = annotatedType.getJavaClass(); | |
final Package pkg = javaClass.getPackage(); | |
// Support for @Veto | |
if (annotatedType.isAnnotationPresent(Veto.class) || (pkg != null && pkg.isAnnotationPresent(Veto.class))) { | |
pat.veto(); | |
log.info("Preventing " + javaClass + " from being installed as bean due to @Veto annotation"); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment