This file contains hidden or 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
| package org.jboss.cdi.api.test.injectiontargetsample; | |
| import javax.enterprise.context.ApplicationScoped; | |
| import javax.enterprise.context.spi.CreationalContext; | |
| import javax.enterprise.inject.Produces; | |
| import javax.enterprise.inject.literal.InjectLiteral; | |
| import javax.enterprise.inject.spi.BeanManager; | |
| import javax.enterprise.inject.spi.InjectionTarget; | |
| import javax.enterprise.inject.spi.InjectionTargetFactory; | |
| import javax.inject.Inject; |
This file contains hidden or 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
| import org.cdisandbox.event.Qualified; | |
| import javax.enterprise.event.Observes; | |
| import javax.enterprise.inject.spi.BeforeBeanDiscovery; | |
| import javax.enterprise.inject.spi.Extension; | |
| public class CacheContextExt implements Extension { | |
| public void addCacheContextAsQualifier(@Observes BeforeBeanDiscovery bbd) { | |
| bbd.addQualifier(CacheContext.class); |
This file contains hidden or 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
| package org.cdisandbox.injectarget; | |
| import java.lang.annotation.Annotation; | |
| import java.lang.reflect.Type; | |
| import java.util.HashSet; | |
| import java.util.Set; | |
| import javax.enterprise.inject.spi.AnnotatedConstructor; | |
| import javax.enterprise.inject.spi.AnnotatedField; | |
| import javax.enterprise.inject.spi.AnnotatedMethod; | |
| import javax.enterprise.inject.spi.AnnotatedType; |
This file contains hidden or 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
| package org.cdispec.converter; | |
| import static java.lang.annotation.ElementType.FIELD; | |
| import static java.lang.annotation.ElementType.METHOD; | |
| import static java.lang.annotation.ElementType.PARAMETER; | |
| import static java.lang.annotation.ElementType.TYPE; | |
| import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
| import java.lang.annotation.Documented; | |
| import java.lang.annotation.Retention; |
This file contains hidden or 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
| package org.jboss.weld.test; | |
| import javax.enterprise.context.RequestScoped; | |
| import javax.enterprise.context.SessionScoped; | |
| import javax.enterprise.event.Observes; | |
| import javax.enterprise.inject.spi.AnnotatedConstructor; | |
| import javax.enterprise.inject.spi.AnnotatedField; | |
| import javax.enterprise.inject.spi.AnnotatedMethod; | |
| import javax.enterprise.inject.spi.AnnotatedType; | |
| import javax.enterprise.inject.spi.Extension; |
This file contains hidden or 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
| java.lang.NoClassDefFoundError: javax/servlet/ServletContextListener | |
| at java.lang.ClassLoader.defineClass1(Native Method) | |
| at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) | |
| at java.lang.ClassLoader.defineClass(ClassLoader.java:615) | |
| at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) | |
| at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) | |
| at java.net.URLClassLoader.access$000(URLClassLoader.java:58) | |
| at java.net.URLClassLoader$1.run(URLClassLoader.java:197) | |
| at java.security.AccessController.doPrivileged(Native Method) | |
| at java.net.URLClassLoader.findClass(URLClassLoader.java:190) |
This file contains hidden or 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; |