Apama 10.3 | Apama Documentation | Developing Apama Applications | Developing Apama Applications in Java | Developing and Deploying JMon Applications | Creating deployment descriptor files | Generating deployment descriptor files from annotations
Generating deployment descriptor files from annotations
There are two utilities that you can use to generate the deployment descriptor file from annotations in your source files:
*com.apama.jmon.annotation.DirectoryProcessor — This utility processes a directory and generates the deployment descriptor file, which you must add to your application's JAR file.
*com.apama.jmon.annotation.JarProcessor — This utility processes an application's JAR file and adds the deployment descriptor file to that JAR file.
You can execute these utilities from the command line or from a Java build file.
The DirectoryProcessor utility takes three optional arguments:
*-r indicates that you want to recursively process the .class files in each directory and subdirectory in the specified directory. The default is that the utility processes only the .class files that are in the specified directory.
*-d specifies the directory that contains the .class files you want to process. The default is that the utility processes any .class files in the current working directory.
*-o specifies the file in which to store the output. The default is that output goes to stdout. In the JMon application JAR file, the name of the deployment descriptor file must always be jmon-jar.xml.
After you generate the deployment descriptor file, you must place it in the META-INF directory of your development directory. For example, you can execute the DirectoryProcessor utility from the command line as follows:
cd src
javac -classpath
java -DAPAMA_LOG_LEVEL=WARN -classpath
com.apama.jmon.annotation.DirectoryProcessor -r -d ./src -o
jar -cf ../simple-jmon.jar META-INF/jmon-jar.xml *.class
The JarProcessor utility takes one required argument, which is the name of the JAR file to operate on. To execute the JarProcessor utility from a Java build file, you can define something like the following:
<!--Target to process the annotations in the JMon application classes
    to produce jmon-jar.xml -- the deployment descriptor file.
<target name="process-jar" depends="jar">
  <echo message=
    "Process annotations in jar file: ${process-jar-file}" />
  <java jvm="java"
    classname="com.apama.jmon.annotation.JarProcessor" dir="."
      <fileset dir="${lib-dir}">
        <patternset refid="libs" />
    <jvmarg value="-DAPAMA_LOG_LEVEL=WARN" />
    <arg value="${process-jar-file}" />
<target name="process" depends="jar">
  <antcall target="process-jar">
    <param name="process-jar-file" value="${jar-file}" />

Copyright © 2013-2018 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.