Package org.apache.webbeans.spi.api

Examples of org.apache.webbeans.spi.api.ResourceReference


                {
                    Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());
                    if(ann != null)
                    {
                        @SuppressWarnings("unchecked")
                        ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(), field.getName(), field.getType(), ann);
                        boolean acess = field.isAccessible();
                        try
                        {
                            webBeansContext.getSecurityService().doPrivilegedSetAccessible(field, true);
                            field.set(managedBeanInstance, getResourceReference(resourceRef));
View Full Code Here


        ResourceFactory rf = ResourceFactory.getInstance();
       
        Class<TestBean> c = TestBean.class;
        Field field = c.getField("emf");
        EntityManagerFactory emf = (EntityManagerFactory) rf.getResourceReference(new ResourceReference(field.getDeclaringClass(),field.getName(),field.getType(),AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations())));
        Assert.assertNotNull( emf );
       
        field = c.getField("em");
        EntityManager em = (EntityManager) rf.getResourceReference(new ResourceReference(field.getDeclaringClass(),field.getName(),field.getType(),AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations())));
        Assert.assertNotNull( em );
    }
View Full Code Here

                    {
                        Annotation ann = AnnotationUtil.hasOwbInjectableResource(field.getDeclaredAnnotations());
                        if(ann != null)
                        {
                            @SuppressWarnings("unchecked")
                            ResourceReference<Object, ?> resourceRef = new ResourceReference(field.getDeclaringClass(), field.getName(), field.getType(), ann);
                            try
                            {
                                Object resourceToInject = getResourceReference(resourceRef);
                                if (resourceToInject != null)
                                {
View Full Code Here

TOP

Related Classes of org.apache.webbeans.spi.api.ResourceReference

Copyright © 2018 www.massapicom. 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.