部署
containers (EJB)
- Session bean
- Message driven bean
resources
- DataSource
- ActiveMQResourceAdapter
- javax.jms.ConnectionFactory
- javax.jms.Queue
- javax.jms.Topic
Deployments(可多个)
To point to a directory
- jars should contain 'META-INF/ejb-jar.xml'
- relative directory to %TOMCAT_HOME%
To include a single jar
查找使用
injected
public class JmsClient { @Resource(name="MyQueue") private Queue queue; public void sendMessage() { // implementation here... }}
looked up via JNDI
openejb:Resources/MyQueue
Queue myQueue = (Queue) ctx.lookup("openejb:Resources/MyQueue");
---------------------- tomee.xml end -------------
----------------------resources.xml start -------------------
还可以通过 openejb:Resource/appname/resource id 引入.war 中的资源(include a WEB-INF/resources.xml
)详细见官网
----------------------resources.xml end -------------------