Show TOC

Deployment DescriptorsLocate this document in the navigation structure

Definition

Files in XML format that provide metadata for the JobBean. A JobBean has the following deployment descriptors:

  • ejb-j2ee-engine.xml and application-j2ee-engine.xml which are the deployment descriptors for message-driven beans.

  • job-definition.xml , which is a JobBean-specific deployment descriptor.

Structure
  • ejb-j2ee-engine.xml

    Specifies the destination name and connection factory name that the JobBean uses. The destination name is JobQueue , and the connection factory name is JobQueueFactory .

    The sample below shows the ejb-j2ee-engine.xml deployment descriptor for a HelloWorld job definition whose JobBean class is named HelloWorldBean .

    Sample Code
                         <?xml version="1.0" encoding="UTF-8"?>
    <ejb-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       
                            xsi:noNamespaceSchemaLocation="ejb-j2ee-engine_3_0.xsd">
      <enterprise-beans>
        <enterprise-bean>
          <ejb-name>HelloWorldBean</ejb-name>
          <jndi-name> HelloWorldBean </jndi-name>
          <message-props>
            <destination-name>JobQueue</destination-name>
            <connection-factory-name>JobQueueFactory</connection-factory-name>
          </message-props>
        </enterprise-bean>
      </enterprise-beans>
    </ejb-j2ee-engine>
    
                      
  • application-j2ee-engine.xml

    Incorporates a reference to the APIs of the SAP NetWeaver Scheduler for Java containing the JobContext and MDBJobImplementation classes. In addition, this deployment descriptor uses a <modules additional> element, which identifies the application you deploy on the server as a job.

    The sample below shows the application-j2ee-engine.xml deployment descriptor for a HelloWorld job definition, created in an EJB project named HelloWorldProject .

    Sample Code
                         <?xml version="1.0" encoding="UTF-8"?>
    <application-j2ee-engine xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    
      <provider-name>sap.com</provider-name>
    
      <reference reference-type="hard">
        <reference-target provider-name="sap.com" target-type= "service">
               scheduler~runtime
        </reference-target>
      </reference>
      <modules-additional>
        <module>
          <entry-name>HelloWorldProject.jar</entry-name>
          <container-type>scheduler~container</container-type>
        </module>
      </modules-additional>
    </application-j2ee-engine>
    
                      

The value of <entry name> is the name of the JAR file containing the JobBean class.

  • job-definition.xml

    An additional deployment descriptor of JobBeans, which contains purely job-specific meta information. It specifies:

    • The job name and description

      Free text name and description of the job.

    • The names and properties of job parameters .

    • The job default retention period

      The retention period determines the number of days, for which the job logs are persisted in the database.

    The sample below shows the job-definition.xml deployment descriptor for a job definition with name HelloWorld that only logs a Hello World! message and has no job parameters.

    Sample Code
                         <job-definitions>
        <job-definition name="HelloWorldJob">
        </job-definition>
    </job-definitions>
                      

    The job definition name has to be identical with the value of the message selector specified in the JobBean class .

    For more information about the Document Type Definition of the job-definition.xml , see Job-definition.dtd .