1 25 package org.objectweb.easybeans.tests.common.ejbs.stateless.containermanaged.resourceref; 26 27 import static org.objectweb.easybeans.tests.common.helper.ContextHelper.checkResource; 28 29 import javax.annotation.Resource; 30 import javax.annotation.Resources; 31 import javax.ejb.Remote ; 32 import javax.ejb.SessionContext ; 33 import javax.ejb.Stateless ; 34 35 import org.objectweb.easybeans.tests.common.ejbs.base.ItfResourceEnvRef00; 36 37 43 @Stateless (name = "SLSBResourceRefDeclaration00") 44 @Remote (ItfResourceEnvRef00.class) 45 @Resources({@Resource(name = "jdbc/ds00", type = javax.sql.DataSource .class), 46 @Resource(name = "jdbc/ds01", type = javax.sql.DataSource .class, mappedName="jdbc_1"), 47 @Resource(name = "jms/cf00", type = javax.jms.ConnectionFactory .class), 48 @Resource(name = "jms/qcf00", type = javax.jms.QueueConnectionFactory .class), 49 @Resource(name = "jms/tcf00", type = javax.jms.TopicConnectionFactory .class), 50 @Resource(name = "mail/mail00", type = javax.mail.Session .class), 51 @Resource(name = "url/url00", type = java.net.URL .class), 52 @Resource(name = "ejbctx/ctx00", type = javax.ejb.EJBContext .class), 53 @Resource(name = "jms/queue00", type = javax.jms.Queue .class), 54 @Resource(name = "jms/topic00", type = javax.jms.Topic .class)}) 55 @Resource(name = "url/url01", type = java.net.URL .class) 56 public class SLSBResourceRefDeclaration00 implements ItfResourceEnvRef00{ 57 58 61 @Resource 62 private SessionContext sessionContext; 63 64 67 public void checkJDBC() { 68 checkResource(sessionContext, "jdbc/ds00"); 69 checkResource(sessionContext, "jdbc/ds01"); 70 } 71 72 75 public void checkJMSConFactory() { 76 checkResource(sessionContext, "jms/cf00"); 77 } 78 79 82 public void checkJMSQueueConFactory() { 83 checkResource(sessionContext, "jms/qcf00"); 84 } 85 86 89 public void checkJMSTopicConFactory() { 90 checkResource(sessionContext, "jms/tcf00"); 91 } 92 93 96 public void checkMailSession() { 97 checkResource(sessionContext, "mail/mail00"); 98 } 99 100 104 public void checkUrl() { 105 checkResource(sessionContext, "url/url00"); 106 checkResource(sessionContext, "url/url01"); 107 } 108 109 113 public void checkEJBContext() { 114 checkResource(sessionContext, "ejbctx/ctx00"); 115 } 116 117 121 public void checkJMSQueue() { 122 checkResource(sessionContext, "jms/queue00"); 123 } 124 125 129 public void checkJMSTopic() { 130 checkResource(sessionContext, "jms/topic00"); 131 } 132 133 } 134 | Popular Tags |