ejb-jar.xml
所有bean类(无论是会话bean还是实体bean)必须实现的最基本的接口是javax.ejb.EnterpriseBean接口。 所有的会话bean必须实现javax.ejb.SessionBean, 所有的实体bean必须实现javax.ejb.EntityBean.
<ejb-client-jar> 可选的, ejb-client-jar元素指定一个JAR文件,这个文件包含了一个客户端程序访问EJB-JAR文件中定义的企业Bean时所需要的类文件.发布者使得EJB CLIENT JAR 文件对于客户端的类装载器来说变得容易访问了。
<?xml version="1.0" encoding="UTF-8"?> <ejb-jar id="ejb-jar_ID" version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd"> <display-name>BatchController</display-name> <enterprise-beans> <session id="BatchControllerStartup"> <ejb-name>BatchControllerStartup</ejb-name> <home>com.ibm.websphere.startupservice.AppStartUpHome</home> <remote>com.ibm.websphere.startupservice.AppStartUp</remote> <ejb-class>com.batch.controller.bean.BatchControllerStartupBean</ejb-class> <session-type>Stateless</session-type> <transaction-type>Bean</transaction-type> <env-entry> <description> </description> <env-entry-name>BeanFactory</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>batchcontrollerbeanfactory</env-entry-value> </env-entry> </session> <message-driven id="BatchJobRequestListener"> <ejb-name>BatchJobRequestListener</ejb-name> <ejb-class>com.esf.jms.async.impl.EnhancedEsShareContextMessageDrivenBean</ejb-class> <messaging-type>javax.jms.MessageListener</messaging-type> <transaction-type>Container</transaction-type> <message-destination-type>javax.jms.Queue</message-destination-type> <env-entry> <description> </description> <env-entry-name>BeanFactory</env-entry-name> <env-entry-type>java.lang.String</env-entry-type> <env-entry-value>batchcontrollerbeanfactory</env-entry-value> </env-entry> </message-driven> </enterprise-beans> <assembly-descriptor> <container-transaction> <method> <ejb-name>BatchJobRequestListener</ejb-name> <method-name>onMessage</method-name> <method-params> <method-param>javax.jms.Message</method-param> </method-params> </method> <method> <ejb-name>BatchJobRequestListener1</ejb-name> <method-name>onMessage</method-name> <method-params> <method-param>javax.jms.Message</method-param> </method-params> </method> <trans-attribute>NotSupported</trans-attribute> </container-transaction> </assembly-descriptor> <ejb-client-jar>BatchControllerClient.jar</ejb-client-jar> </ejb-jar>