views:

705

answers:

1

Hi,

Are we allowed to specify a method name with an access modifier of 'protected' or 'private' inside the <container-transaction><method></method></contaner-transaction> tag ?

Below is a sample of the ejb-jar.xml:

<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.1">
      <enterprise-beans>
        <session>
          <ejb-name>myEJBName</ejb-name>
          <home>myEJBHome</home>
          <remote>myEJBInterface</remote>
          <ejb-class>myEJBClass</ejb-class>
          <session-type>Stateless</session-type>
          <transaction-type>Container</transaction-type>
        </session>
      </enterprise-beans>
      <assembly-descriptor>
        <security-role>
          <role-name>mySecurityRole</role-name>
        </security-role>
        <method-permission>
          <description></description>
          <role-name>myRoleName</role-name>
          <method>myEJBMethod</ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>*</method-name>
          </method>
        </method-permission>
        <container-transaction>
          <method>
            <ejb-name>myEJB</ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>myEJBMethod</method-name>
          </method>
          <trans-attribute>Required</trans-attribute>
        </container-transaction>
      </assembly-descriptor>
</ejb-jar>
+2  A: 

No, EJB methods are always public.

bkail
Yeah, there wouldn't be much point to remote EJBs with private methods.
Kaleb Brasee