1 package ejava.examples.jndidemo;
2
3 import javax.annotation.Resource;
4
5 import javax.ejb.EJB;
6 import javax.enterprise.inject.Produces;
7 import javax.persistence.EntityManager;
8 import javax.persistence.PersistenceContext;
9 import javax.sql.DataSource;
10
11
12
13
14
15
16 public class SchedulerResources {
17
18
19
20
21
22 @Resource(mappedName="java:jboss/datasources/ExampleDS")
23 @Produces
24 @JndiDemo
25 public DataSource ds;
26
27
28
29
30
31
32 @PersistenceContext(unitName="jndidemo")
33 @Produces
34 @JndiDemo
35 public EntityManager em;
36
37
38
39
40
41 @Produces
42 @JndiDemo
43 public String message="Hello CDI!!!";
44
45
46
47
48 @EJB(lookup="java:app/jndiDemoEJB/CookEJB!ejava.examples.jndidemo.ejb.CookLocal")
49 @Produces
50 @Cook
51 public Scheduler cook;
52 }