码迷,mamicode.com
首页 > 其他好文 > 详细

EJB2的配置

时间:2017-11-16 17:16:03      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:html   org   stat   sha   ble   XML   contain   require   data   

1. ejb-jar.xml

<?xml version="1.0" encoding="UTF-8"?>
<ejb-jar 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"
         version="2.1">
    <enterprise-beans>
        <session>
          <display-name>ServiceSkeleton</display-name>
            <ejb-name>ServiceSkeletonEJB</ejb-name>
            <home>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonRemoteHome</home>
            <remote>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonRemote</remote>
            <local>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonLocal</local>
            <local-home>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonLocalHome</local-home>
            <ejb-class>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>
                    
            <env-entry>
                <env-entry-name>SERVICE_CONTEXT</env-entry-name>
                <env-entry-type>java.lang.String</env-entry-type>
                <env-entry-value>config/service/published-services.xml</env-entry-value>
            </env-entry>

            <env-entry>
                <env-entry-name>SERVICE_POOL_SIZE</env-entry-name>
                <env-entry-type>java.lang.Integer</env-entry-type>
                <env-entry-value>20</env-entry-value>
            </env-entry>

            <resource-ref>
                <res-ref-name>XPCDataSource</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Application</res-auth>
                <res-sharing-scope>Shareable</res-sharing-scope>
            </resource-ref>
        </session>
    </enterprise-beans>

    <assembly-descriptor>
        <container-transaction>
            <method>
                <ejb-name>ServiceSkeletonEJB</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>invokeServiceNotSuport</method-name>
                <method-params>
                    <method-param>com.ecvision.xpressroad.framework.context.SessionInfo</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String[]</method-param>
                    <method-param>java.lang.Object[]</method-param>
                </method-params>
            </method>
            <trans-attribute>NotSupported</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ServiceSkeletonEJB</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>invokeServiceSupport</method-name>
                <method-params>
                    <method-param>com.ecvision.xpressroad.framework.context.SessionInfo</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String[]</method-param>
                    <method-param>java.lang.Object[]</method-param>
                </method-params>
            </method>
            <trans-attribute>Supports</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ServiceSkeletonEJB</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>invokeServiceReq</method-name>
                <method-params>
                    <method-param>com.ecvision.xpressroad.framework.context.SessionInfo</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String[]</method-param>
                    <method-param>java.lang.Object[]</method-param>
                </method-params>
            </method>
            <trans-attribute>Required</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ServiceSkeletonEJB</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>invokeServiceReqNew</method-name>
                <method-params>
                    <method-param>com.ecvision.xpressroad.framework.context.SessionInfo</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String[]</method-param>
                    <method-param>java.lang.Object[]</method-param>
                </method-params>
            </method>
            <trans-attribute>RequiresNew</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ServiceSkeletonEJB</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>invokeServiceMandatory</method-name>
                <method-params>
                    <method-param>com.ecvision.xpressroad.framework.context.SessionInfo</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String[]</method-param>
                    <method-param>java.lang.Object[]</method-param>
                </method-params>
            </method>
            <trans-attribute>Mandatory</trans-attribute>
        </container-transaction>
        <container-transaction>
            <method>
                <ejb-name>ServiceSkeletonEJB</ejb-name>
                <method-intf>Remote</method-intf>
                <method-name>invokeServiceNever</method-name>
                <method-params>
                    <method-param>com.ecvision.xpressroad.framework.context.SessionInfo</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String</method-param>
                    <method-param>java.lang.String[]</method-param>
                    <method-param>java.lang.Object[]</method-param>
                </method-params>
            </method>
            <trans-attribute>Never</trans-attribute>
        </container-transaction>
    </assembly-descriptor>
</ejb-jar>

2. jboss.xml

<jboss>
    <enterprise-beans>
        <session>
            <ejb-name>ServiceSkeletonEJB</ejb-name>
           <local-jndi-name>ServiceSkeleton</local-jndi-name>
            <resource-ref>
                <res-ref-name>XPCDataSource</res-ref-name>
                <jndi-name>java:/XPCDataSource</jndi-name>
            </resource-ref>
        </session>
    </enterprise-beans>
</jboss>


3. web.xml

<!--  <ejb-ref>
        <ejb-ref-name>ServiceSkeletonEJB</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <home>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonRemoteHome</home>
        <remote>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonRemote</remote>
        <ejb-link>ServiceSkeletonEJB</ejb-link>
    </ejb-ref>-->
   
    <ejb-local-ref>
    <ejb-ref-name>ServiceSkeletonEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonLocal</local>
    <local-home>com.ecvision.xpressroad.framework.context.skeleton.ServiceSkeletonLocalHome</local-home>
    </ejb-local-ref>
   
</web-app>

4. jboss-web.xml

<jboss-web>
    <ejb-local-ref>
        <ejb-ref-name>ServiceSkeletonEJB</ejb-ref-name>
        <local-jndi-name>ServiceSkeleton</local-jndi-name>
    </ejb-local-ref>
</jboss-web>

 

EJB2的配置

标签:html   org   stat   sha   ble   XML   contain   require   data   

原文地址:http://www.cnblogs.com/firstdream/p/7845072.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!