<?xml version="1.0"?>

<!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 component is used to track basic information about people. 
   </description>

   <!-- display-name
        This is a short name used by tools to display the name of the
	component.
	-->
   <display-name>Personnel Component</display-name>

   <!-- enterprise-beans
      This section is used to define the core of the beans in the
      component.
      -->
   <enterprise-beans>
      <entity>
         <description>
	    This bean is used to track the individual state of each person.
         </description>
	 <display-name>Person Bean</display-name>

	 <!-- ejb-name
	      This field provides a unique name within this deployment
	      descriptor. There is no direct relationship between this
	      value and the resultant jndi context it is stored.
              -->
	 <ejb-name>Person</ejb-name>

	 <!-- home - lists the home interface for this bean. -->
	 <home>ejava.ejb.personnel.PersonHome</home>

	 <!-- remote - lists the remote interface for this bean. -->
	 <remote>ejava.ejb.personnel.Person</remote>

	 <!-- ejb-class - lists the bean class for this bean. -->
	 <ejb-class>ejava.ejb.personnel.PersonBean</ejb-class>

         <!-- persistence-type - [ Bean or Container ] -->
	 <persistence-type>Container</persistence-type>
	 
	 <!-- prim-key-class - lists the primary key class for the bean. 
	    Note that this class is only _required_ when more than one
	    of the bean's fields makeup the primary key for the object.
	    Its public attributes must contain attributes that match in 
	    name and type with the primary key attributes of the object.
	    
	    One can use the primkey-field property if only a single 
	    attribute is necessary.
	    -->
	 <prim-key-class>ejava.ejb.personnel.PersonPK</prim-key-class>

	 <!-- reentrant - specifies whether subsequent calls into the bean
	      are allowed within the same transaction context.
	      -->
	 <reentrant>True</reentrant>

         <!-- cmp-field - describes a container managed attribute -->
	 <cmp-field> <field-name>id_</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>address_</field-name> </cmp-field>
	 <cmp-field> <field-name>phoneNumber_</field-name> </cmp-field>

         <!-- primkey-field - lists a single attribute within the bean
	      that acts as the primary key for the object. This is not
	      used when a primarykey-class is used
	      -->

         <!-- env-entry - lists properties that will be placed in the 
	      bean's environment at run-time.
	      -->
	 <env-entry>
	    <description>This is a sample env entry.</description>
	    <env-entry-name>sample</env-entry-name>
	    <env-entry-type>java.lang.String</env-entry-type>
	    <env-entry-value>Sample Environement Value</env-entry-value>
	 </env-entry>

	 <!-- ejb-ref 
	      This contains the value in the code that the bean will use
	      to locate other beans. It won't be used in this bean.
	      -->
	 <!--
	 <ejb-ref>
	    <description></description>
	    <ejb-ref-name></ejb-ref-name>
	    <ejb-ref-type>Session or Entity</ejb-ref-type>
	    <home></home>
	    <remote></remote>
	    <ejb-link></ejb-link>
	 </ejb-ref>
	 -->
	 
	 <!-- security-role-ref
	      Lists names or security roles specifically tested with the
	      code. This allows the assembler to map the code's value to
	      a role defined in the security-role section. This bean will
	      be using declarative security and thus will not use this
	      feature.
	      -->
         <!--
	 <security-role-ref>
	    <description>MyAdmin is hardcoded within bean.</description>
	    <role-name>MyAdmin<role-name>
	    <role-link>Admin<role-link>
	 </security-role-ref>
	 -->

         <!-- resource-ref 
	    Lists resources the bean code is coded to search for in the
	    the environment. Examples of this would include connection
	    pools for Bean Managed Persistence. This will not be used 
	    in this bean.
	    -->
         <!--
	 <resource-ref>
	    <res-ref-name>jdbc/personnelDB</res-ref-name>
	    <res-type>javax.sql.DataSource</res-type>
	    <res-auth>Container</res-auth>
	 </resource-ref>
	 -->
      </entity>

<!--
      <session>
         <description>
	    Used to handle actions that span people or beans required for
	    use with people.
         </description>

	 <display-name>Registrar Bean</display-name>
	 <ejb-name>Registrar</ejb-name>
	 <home>ejava.ejb.personnel.RegistrarHome</home>
	 <remote>ejava.ejb.personnel.Registrar</remote>
	 <ejb-class>ejava.ejb.personnel.RegistrarBean</ejb-class>
	 <session-type>Stateless</session-type>
	 <transaction-type>Container</transaction-type>
	 <ejb-ref>
	    <description>Used to generate unique IDs</description>
	    <ejb-ref-name>ejb/UIDGeneratorHome</ejb-ref-name>
	    <ejb-ref-type>Entity</ejb-ref-type>
	    <home>ejava.ejb.uid.UIDGeneratorHome</home>
	    <remote>ejava.ejb.uid.UIDGenerator</remote>
	    <ejb-link>UIDGeneratorHome</ejb-link>
	 </ejb-ref>
	 <ejb-ref>
	    <description>Used to manage person records</description>
	    <ejb-ref-name>ejb/PersonHome</ejb-ref-name>
	    <ejb-ref-type>Entity</ejb-ref-type>
	    <home>ejava.ejb.personnel.PersonHome</home>
	    <remote>ejava.ejb.personnel.Person</remote>
	    <ejb-link>PersonHome</ejb-link>
	 </ejb-ref>
      </session>
-->
   </enterprise-beans>
   
   <!-- assembly-descriptor
        This contains optional information that may be used during
	application assembly.
	-->
   <assembly-descriptor>
      <!-- security-role
           This contains one or more names of security roles that will
	   interface with the bean.
	   -->
      <security-role>
         <description>Allowed read/write to obejcts</description>
	 <role-name>Admin</role-name>
      </security-role>
      <security-role>
         <description>Allowed read-only access to objects</description>
	 <role-name>User</role-name>
      </security-role>

      <method-permission>
         <description>These are the writable methods.</description>
	 <role-name>Admin</role-name>
	 <method>
	    <!-- ejb-name - names a bean from the deployment descriptor -->
	    <ejb-name>Person</ejb-name>
	    <!-- method-intf - Remote or Home.  Required only if Home and 
	         Remote have a method of the same signature. 
		 -->
	    <method-intf>Home</method-intf>
	    <method-name>create</method-name>

	    <!-- method-params - Required only of method overloaded. -->
	    <method-params>
	       <method-param>java.lang.String</method-param> <!-- id -->
	    </method-params>
	 </method>

	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>create</method-name>
	    <method-params>
	       <method-param>java.lang.String</method-param> <!-- id -->
	       <method-param>java.lang.String</method-param> <!-- firstName -->
	       <method-param>java.lang.String</method-param> <!-- lastName -->
	       <method-param>java.lang.String</method-param> <!-- address -->
	       <method-param>java.lang.String</method-param> <!-- phNumber -->
	    </method-params>
	 </method>

	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>setFirstName</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>setLastName</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>setAddress</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>setPhoneNumber</method-name>
	 </method>
      </method-permission>

      <method-permission>
         <description>These are the read-only methods</description>
	 <role-name>Admin</role-name>
	 <role-name>User</role-name>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>findByPrimaryKey</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>findByLikeName</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>getFirstName</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>getLastName</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>getAddress</method-name>
	 </method>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>getPhoneNumber</method-name>
	 </method>
      </method-permission>

      <!-- container-transaction
           These properties allow the assembler to determine the
	   transactional properties of each bean method.
	   -->
      <container-transaction>
         <description></description>
	 <method>
	    <ejb-name>Person</ejb-name>
	    <method-name>*</method-name>
	 </method>
	 
	 <!-- trans-attribute
	      NotSupported, Supports, Required, RequiresNew,
	      Mandatory, or Never
	      -->
	 <trans-attribute>Required</trans-attribute>
      </container-transaction>
   </assembly-descriptor>

   <!-- ejb-client-jar
        Specifies the jar file that contains classes for use by remote
	clients of the component.
	-->
   <ejb-client-jar>PersonnelClient.jar</ejb-client-jar>
</ejb-jar>
