Generate the Java Classes for MATRIXX Data Containers
Follow this procedure to generate the Java classes to be used by any custom Java applications that connect to MATRIXX Engine.
Before you begin
Procedure
- Get the mdc_config_custom.xml file from the MATRIXX Engine pod.
-
Enter the following command to generate the Java API.
java -jar JavaApiGenerator.jar -config:mdc_config_custom.xmlNote: If the mdc_config_custom.xml file is in the current directory or in /opt/mtx/config when you run JavaApiGenerator.jar, you do not need to specify the
-config:
switch. To view the full list of JavaApiGenerator options, run the following command:java -jar JavaApiGenerator.jar -help
The following files are created:- dataContainer.jar file — Contains the Java classes for MDCs.
- platform.jar file — Contains platform files required by the sample Java client application.
- gen_docs directory — Contains the code-generated documentation.
generated
directory — Contains the code generated JAVA classes.- genxsd directory — Contains XSD files for XML validation.
-
Add the folder containing the output files to the Java application as a source
folder.
Your application that uses the code-generated class files must have access to the mdc_config_custom.xml used to generate the class files. You can put the file in the /opt/mtx/conf directory or you can set the
MTX_CONF_DIR
environment variable before running the program so that the system has access to the file. -
(Optional) Generate an XSD for every known data container:
java -jar JavaApiGenerator.jar -xsd:"^Mtx.*$"
-
Compile and run the
application.
Read the readme.txt file in the output directory for information about building the sample application.