mr-jaxb-mapping.xml

File purpose

The mr-jaxb-mapping.xml file defines the configuration of the Java Architecture for XML Binding (JAXB) for context values defined in the MR application. That binding is used for handling SOAP requests.

File location

The file is located in the folder mr-application\src\main\resources.

JAXB implementation requirements

In Atoti Server, a particular “enhanced” JAXB implementation is used, which relies on JAXBIntroductions. It enables configuring JAXB serialization through XML configuration files instead of the traditional way of using annotations in the Java code. Thus, you can decouple the Java implementation from the serialization logic.

Each class you want to equip with support for JAXB serialization requires at least:

  • a no-arg constructor
  • a setter for each field that shall be mapped with an XML attribute ()

Here is an excerpt of the code of the VaRConfidenceLevel class as an example:

public class VaRConfidenceLevel extends AContextValue implements IVaRConfidenceLevel {

	private static final long serialVersionUID = -7986551302570577435L;

	protected double vaRConfidenceLevel;

	protected VaRConfidenceLevel() {
		this.vaRConfidenceLevel = 99;
	}

        ......


	public void setVaRConfidenceLevel(double vaRConfidenceLevel) {
		this.vaRConfidenceLevel = vaRConfidenceLevel;
	}

	......

}

JAXB configuration

In the mr-jaxb-mapping.xml file you can define the paths to your various JAXB custom configurations. In this example, we define the mapping related to the VaR confidence level context value object:

<Class name="com.activeviam.mr.common.calculations.context.impl.VaRConfidenceLevel">
	<XmlRootElement name="vaRConfidenceLevel" />
	<Method name="getVaRConfidenceLevel">
		<XmlAttribute name="vaRConfidenceLevel" required="true" />
	</Method>
</Class>

File values

The file contains the JAXB configuration for the context values present in Atoti Market Risk. They are defined similar to the example for the VaR confidence level context value object shown in JAXB implementation requirements.