tomee.xml

时间:2022-09-16 05:23:23

部署

<?xml version="1.0" encoding="UTF-8"?>
<tomee>
<!-- see http://tomee.apache.org/containers-and-resources.html--> <!-- see http://tomee.apache.org/deployments.html-->
<!-- activate next line to be able to deploy applications in apps -->
<!-- <Deployments dir="apps" /> -->
</tomee>

containers (EJB)

  • Session bean
  • Message driven bean

resources

  • DataSource
  • ActiveMQResourceAdapter
  • javax.jms.ConnectionFactory
  • javax.jms.Queue
  • javax.jms.Topic

Deployments(可多个)

<Deployments dir="apps" />

To point to a directory

  • jars should contain 'META-INF/ejb-jar.xml'
  • relative directory to %TOMCAT_HOME%
<Deployments jar="c:\my\app\superEjbs.jar" />

To include a single jar

查找使用

http://tomee.apache.org/application-resources.html

injected

<tomee>
<Resource id="MyQueue" type="javax.jms.Queue"/>
</tomee>
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 -------------------

相关文章