Package org.apache.webbeans.ejb.resource

Examples of org.apache.webbeans.ejb.resource.ResourceFactory


        p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
        p.put("movieDatabaseUnmanaged.JtaManaged", "false");
       
        new InitialContext(p);

        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


        p.put("movieDatabaseUnmanaged.JdbcUrl", "jdbc:hsqldb:mem:moviedb");
        p.put("movieDatabaseUnmanaged.JtaManaged", "false");
       
        new InitialContext(p);

        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

TOP

Related Classes of org.apache.webbeans.ejb.resource.ResourceFactory

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.