weld/subsystem/src/main/java/org/jboss/as/weld/injection/InjectionTargets.java
public static <T> WeldInjectionTarget<T> createInjectionTarget(Class<?> componentClass, Bean<T> bean, BeanManagerImpl beanManager,
            boolean interceptionSupport) {
        final ClassTransformer transformer = beanManager.getServices().get(ClassTransformer.class);
        @SuppressWarnings("unchecked")
        final Class<T> clazz = (Class<T>) componentClass;
        EnhancedAnnotatedType<T> type = transformer.getEnhancedAnnotatedType(clazz, beanManager.getId());

        if (!type.getJavaClass().equals(componentClass)) {
            /*
             * Jasper loads a class with multiple classloaders which is not supported by Weld.
             * If this happens, use a combination of a bean archive identifier and class' classloader hashCode as the BDA ID.
             * This breaks AnnotatedType serialization but that does not matter as these are non-contextual components.
             */
            final ClassLoader classLoader = WildFlySecurityManager.isChecking() ? doPrivileged(new GetClassLoaderAction(componentClass)) : componentClass.getClassLoader();
            final String bdaId = beanManager.getId() + classLoader.hashCode();
            type = transformer.getEnhancedAnnotatedType(clazz, bdaId);
        }

        if (Beans.getBeanConstructor(type) == null) {
            /*
             * For example, AsyncListeners may be CDI-incompatible as long as the application never calls javax.servletAsyncContext#createListener(Class)
             * and only instantiates the listener itself.
             */
            return beanManager.getInjectionTargetFactory(type).createNonProducibleInjectionTarget();
        }
        WeldInjectionTargetBuilder<T> builder = beanManager.createInjectionTargetBuilder(type);
        builder.setBean(bean);
        builder.setResourceInjectionEnabled(false); // because these are all EE components where resource injection is not handled by Weld
        if (interceptionSupport) {
            return builder.build();
        } else {
            // suppress interception/decoration because this is a component for which WF provides interception support
            return builder.setInterceptionEnabled(false).setTargetClassLifecycleCallbacksEnabled(false).setDecorationEnabled(false).build();
        }
    }
public static <T> WeldInjectionTarget<T> createInjectionTarget(Class<?> componentClass, Bean<T> bean, BeanManagerImpl beanManager,
            boolean interceptionSupport) {
        final ClassTransformer transformer = beanManager.getServices().get(ClassTransformer.class);
        @SuppressWarnings("unchecked")
        final Class<T> clazz = (Class<T>) componentClass;
        EnhancedAnnotatedType<T> type = transformer.getEnhancedAnnotatedType(clazz, beanManager.getId());

        if (!type.getJavaClass().equals(componentClass)) {
            /*
             * Jasper loads a class with multiple classloaders which is not supported by Weld.
             * If this happens, use a combination of a bean archive identifier and class' classloader hashCode as the BDA ID.
             * This breaks AnnotatedType serialization but that does not matter as these are non-contextual components.
             */
            final ClassLoader classLoader = WildFlySecurityManager.isChecking() ? doPrivileged(new GetClassLoaderAction(componentClass)) : componentClass.getClassLoader();
            final String bdaId = beanManager.getId() + classLoader.hashCode();
            type = transformer.getEnhancedAnnotatedType(clazz, bdaId);
        }

        if (Beans.getBeanConstructor(type) == null) {
            /*
             * For example, AsyncListeners may be CDI-incompatible as long as the application never calls javax.servletAsyncContext#createListener(Class)
             * and only instantiates the listener itself.
             */
            return beanManager.getInjectionTargetFactory(type).createNonProducibleInjectionTarget();
        }
        WeldInjectionTargetBuilder<T> builder = beanManager.createInjectionTargetBuilder(type);
        builder.setBean(bean);
        builder.setResourceInjectionEnabled(false); // because these are all EE components where resource injection is not handled by Weld
        if (interceptionSupport) {
            return builder.build();
        } else {
            // suppress interception/decoration because this is a component for which WF provides interception support
            return builder.setInterceptionEnabled(false).setTargetClassLifecycleCallbacksEnabled(false).setDecorationEnabled(false).build();
        }
    }
public static < T > WeldInjectionTarget < T > createInjectionTarget ( Class < ? > componentClass , Bean < T > bean , BeanManagerImpl beanManager , boolean interceptionSupport ) { final ClassTransformer transformer = beanManager . getServices ( ) . get ( ClassTransformer . class ) ; @ SuppressWarnings ( "unchecked" ) final Class < T > clazz = ( Class < T > ) componentClass ; EnhancedAnnotatedType < T > type = transformer . getEnhancedAnnotatedType ( clazz , beanManager . getId ( ) ) ; if ( ! type . getJavaClass ( ) . equals ( componentClass ) ) { /*
             * Jasper loads a class with multiple classloaders which is not supported by Weld.
             * If this happens, use a combination of a bean archive identifier and class' classloader hashCode as the BDA ID.
             * This breaks AnnotatedType serialization but that does not matter as these are non-contextual components.
             */ final ClassLoader classLoader = WildFlySecurityManager . isChecking ( ) ? doPrivileged ( new GetClassLoaderAction ( componentClass ) ) : componentClass . getClassLoader ( ) ; final String bdaId = beanManager . getId ( ) + classLoader . hashCode ( ) ; type = transformer . getEnhancedAnnotatedType ( clazz , bdaId ) ; } if ( Beans . getBeanConstructor ( type ) == null ) { /*
             * For example, AsyncListeners may be CDI-incompatible as long as the application never calls javax.servletAsyncContext#createListener(Class)
             * and only instantiates the listener itself.
             */ return beanManager . getInjectionTargetFactory ( type ) . createNonProducibleInjectionTarget ( ) ; } WeldInjectionTargetBuilder < T > builder = beanManager . createInjectionTargetBuilder ( type ) ; builder . setBean ( bean ) ; builder . setResourceInjectionEnabled ( false ) ; // because these are all EE components where resource injection is not handled by Weld if ( interceptionSupport ) { return builder . build ( ) ; } else { // suppress interception/decoration because this is a component for which WF provides interception support return builder . setInterceptionEnabled ( false ) . setTargetClassLifecycleCallbacksEnabled ( false ) . setDecorationEnabled ( false ) . build ( ) ; } }
Creates a new InjectionTarget for a given class. If the interceptionSupport flag is set to true the resulting instance will support
interception (support provided by Weld). If an InjectionTarget is created for a component where interception support is implemented
through component's view (EJBs, managed beans) the flag must be set to false.

@param componentClass
@param bean
@param beanManager
@param interceptionSupport
@return
Creates a new InjectionTarget for a given class . If the interceptionSupport flag is set to true the resulting instance will support interception ( support provided by Weld ) . If an InjectionTarget is created for a component where interception support is implemented through component s view ( EJBs managed beans ) the flag must be set to false .