Examples of ClassTransformer


Examples of org.jboss.weld.resources.ClassTransformer

    */
    @Category(Broken.class)
    @Test
    public void testWeldClassForCovariantReturnType() {
        TypeStore typeStore = new TypeStore();
        EnhancedAnnotatedType<Attacker> weldClass = new ClassTransformer(typeStore, new SharedObjectCache(), ReflectionCacheFactory.newInstance(typeStore), RegistrySingletonProvider.STATIC_INSTANCE).getEnhancedAnnotatedType(Attacker.class, AnnotatedTypeIdentifier.NULL_BDA_ID);
        Collection<EnhancedAnnotatedMethod<?, ? super Attacker>> methods = weldClass.getEnhancedMethods();
        Assert.assertEquals(4, methods.size());
        List<EnhancedAnnotatedMethod<?, ?>> interceptableMethods = Beans.getInterceptableMethods(weldClass);
        Assert.assertEquals(4, interceptableMethods.size());
    }
View Full Code Here

Examples of org.jboss.weld.resources.ClassTransformer

    public void start(StartContext context) throws StartException {
        final ClassLoader oldTCCL = SecurityActions.getContextClassLoader();
        try {
            SecurityActions.setContextClassLoader(classLoader);
            final BeanManagerImpl bm = beanManager.getValue();
            final ClassTransformer transformer = bm.getServices().get(ClassTransformer.class);
            final List<Injection> injectionPoints = new ArrayList<Injection>();
            //we do it this way to get changes introduced by extensions
            WeldClass<?> weldClass = transformer.loadClass(componentClass);
            for (AnnotatedField<?> field : weldClass.getFields()) {
                if (field.isAnnotationPresent(Inject.class)) {
                    final Set<Annotation> qualifiers = new HashSet<Annotation>();
                    for (Annotation annotation : field.getAnnotations()) {
                        if (bm.isQualifier(annotation.annotationType())) {
View Full Code Here

Examples of org.jboss.weld.resources.ClassTransformer

        this.proxyClassConstructorInjectionPoint = new ProxyClassConstructorInjectionPointWrapper<T>(bean, type.getJavaClass(), constructorForEnhancedSubclass, originalConstructor, manager);
        this.componentClassConstructor = originalConstructor.getAnnotated().getJavaMember();
    }

    protected EnhancedAnnotatedConstructor<T> initEnhancedSubclass(BeanManagerImpl manager, EnhancedAnnotatedType<T> type, Bean<?> bean, ConstructorInjectionPoint<T> originalConstructorInjectionPoint) {
        ClassTransformer transformer = manager.getServices().get(ClassTransformer.class);
        EnhancedAnnotatedType<T> enhancedSubclass = transformer.getEnhancedAnnotatedType(createEnhancedSubclass(type, bean, manager), type.slim().getIdentifier().getBdaId());
        return findMatchingConstructor(originalConstructorInjectionPoint.getSignature(), enhancedSubclass);
    }
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.