The following example illustrates a sample deployment descriptor for the EJB JAR containing the Wombat 's assembled application described in Section EJB.3.2. Note The text in the <description> elements has been formatted by adding white space to appear properly indented in this document. In a real deployment descriptor document, the <description> elements would likely contain no extra white space characters . <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc. //DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd"><ejb-jar> <description> This ejb-jar file contains assembled enterprise beans that are part of employee self-service application. </description> <enterprise-beans> <session> <description> The EmployeeService session bean implements a session between an employee and the employee self-service application. </description> <ejb-name>EmployeeService</ejb-name> <home>com.wombat.empl.EmployeeServiceHome</home> <remote>com.wombat.empl.EmployeeService</remote> <ejb-class>com.wombat.empl.EmployeeServiceBean</ejb-class> <session-type>Stateful</session-type> <transaction-type>Bean</transaction-type> <env-entry> <env-entry-name>envvar1</env-entry-name> <env-entry-type>String</env-entry-type> <env-entry-value>some value</env-entry-value> </env-entry> <ejb-ref> <ejb-ref-name>ejb/EmplRecords</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.wombat.empl.EmployeeRecordHome</home> <remote>com.wombat.empl.EmployeeRecord</remote> <ejb-link>EmployeeRecord</ejb-link> </ejb-ref> <ejb-ref> <ejb-ref-name>ejb/Payroll</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.aardvark.payroll.PayrollHome</home> <remote>com.aardvark.payroll.Payroll</remote> <ejb-link>AardvarkPayroll</ejb-link> </ejb-ref> <ejb-ref> <ejb-ref-name>ejb/PensionPlan</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <home>com.wombat.empl.PensionPlanHome</home> <remote>com.wombat.empl.PensionPlan</remote> </ejb-ref> <resource-ref> <description> This is a reference to a JDBC database. EmployeeService keeps a log of all transactions performed through the EmployeeService bean for auditing purposes. </description> <res-ref-name>jdbc/EmployeeAppDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session> <session> <description> The EmployeeServiceAdmin session bean implements the session used by the application's administrator. </description> <ejb-name>EmployeeServiceAdmin</ejb-name> <home>com.wombat.empl.EmployeeServiceAdminHome</home> <remote>com.wombat.empl.EmployeeServiceAdmin</remote> <ejb-class> com.wombat.empl.EmployeeServiceAdminBean</ejb-class> <session-type>Stateful</session-type> <transaction-type>Bean</transaction-type> <resource-ref> <description> This is a reference to a JDBC database. EmployeeService keeps a log of all transactions performed through the EmployeeService bean for auditing purposes. </description> <res-ref-name>jdbc/EmployeeAppDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref> </session> <entity> <description> The EmployeeRecord entity bean encapsulates access to the employee records.The deployer will use container-managed persistence to integrate the entity bean with the back-end system managing the employee records. </description> <ejb-name>EmployeeRecord</ejb-name> <home>com.wombat.empl.EmployeeRecordHome</home> <remote>com.wombat.empl.EmployeeRecord</remote> <ejb-class>com.wombat.empl.EmployeeRecordBean</ejb-class> <persistence-type>Container</persistence-type> <prim-key-class>com.wombat.empl.EmployeeID </prim-key-class> <reentrant>True</reentrant> <cmp-field><field-name>employeeID</field-name> </cmp-field> <cmp-field><field-name>firstName</field-name></cmp-field> <cmp-field><field-name>lastName</field-name></cmp-field> <cmp-field><field-name>address1</field-name></cmp-field> <cmp-field><field-name>address2</field-name></cmp-field> <cmp-field><field-name>city</field-name></cmp-field> <cmp-field><field-name>state</field-name></cmp-field> <cmp-field><field-name>zip</field-name></cmp-field> <cmp-field><field-name>homePhone</field-name></cmp-field> <cmp-field><field-name>jobTitle</field-name></cmp-field> <cmp-field><field-name>managerID</field-name></cmp-field> <cmp-field><field-name>jobTitleHistory </field-name></cmp-field> </entity> <entity> <description> The Payroll entity bean encapsulates access to the payroll system.The deployer will use container-managed persistence to integrate the entity bean with the back-end system managing payroll information. </description> <ejb-name>AardvarkPayroll</ejb-name> <home>com.aardvark.payroll.PayrollHome</home> <remote>com.aardvark.payroll.Payroll</remote> <ejb-class>com.aardvark.payroll.PayrollBean</ejb-class> <persistence-type>Bean</persistence-type> <prim-key-class>com.aardvark.payroll.AccountID </prim-key-class> <reentrant>False</reentrant> <security-role-ref> <role-name>payroll-org</role-name> <role-link>payroll-department</role-link> </security-role-ref> </entity> </enterprise-beans> <assembly-descriptor> <security-role> <description> This role includes the employees of the enterprise who are allowed to access the employee self-service application. This role is allowed only to access his/her own information. </description> <role-name>employee</role-name> </security-role> <security-role> <description> This role includes the employees of the human resources department. The role is allowed to view and update all employee records. </description> <role-name>hr-department</role-name> </security-role> <security-role> <description> This role includes the employees of the payroll department. The role is allowed to view and update the payroll entry for any employee. </description> <role-name>payroll-department</role-name> </security-role> <security-role> <description> This role should be assigned to the personnel authorized to perform administrative functions for the employee self-service application. This role does not have direct access to sensitive employee and payroll information. </description> <role-name>admin</role-name> </security-role> <method-permission> <role-name>employee</role-name> <method> <ejb-name>EmployeeService</ejb-name> <method-name>*</method-name> </method> </method-permission> <method-permission> <role-name>employee</role-name> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>findByPrimaryKey</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>getDetail</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>updateDetail</method-name> </method> </method-permission> <method-permission> <role-name>employee</role-name> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>findByPrimaryKey</method-name> </method> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>getEmployeeInfo</method-name> </method> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>updateEmployeeInfo</method-name> </method> </method-permission> <method-permission> <role-name>admin</role-name> <method> <ejb-name>EmployeeServiceAdmin</ejb-name> <method-name>*</method-name> </method> </method-permission> <method-permission> <role-name>hr-department</role-name> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>create</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>remove</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>changeManager</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>changeJobTitle</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>findByPrimaryKey</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>getDetail</method-name> </method> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>updateDetail</method-name> </method> </method-permission> <method-permission> <role-name>payroll-department</role-name> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>findByPrimaryKey</method-name> </method> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>getEmployeeInfo</method-name> </method> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>updateEmployeeInfo</method-name> </method> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>updateSalary</method-name> </method> </method-permission> <container-transaction> <method> <ejb-name>EmployeeRecord</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> <container-transaction> <method> <ejb-name>AardvarkPayroll</ejb-name> <method-name>*</method-name> </method> <trans-attribute>Required</trans-attribute> </container-transaction> </assembly-descriptor> </ejb-jar> |