Sun B2B Suite HIPAA OTD Library User's Guide

On Demand Parsing

For performance enhancement reasons, the unmarshal()method does not unmarshal the entire message to the leaf element and subelement level. Instead, this method does the following:

This behavior is also referred to as “parse on demand,” meaning that elements within a segment or composite are not unmarshaled until an element in that segment or composite is accessed by a getxxx() method invoked in a Collaboration or during marshaling. The OTD may assign unmarshaled segments and composites to a pool that is ready to be freed from memory by the Java Virtual Machine software. Once these segments or composites are freed from memory, they become unparsed. If the element within the segment or composite is accessed again, the OTD reparses the segment or composite.

By default, HIPAA OTDs set no limit of parsed segments or composites held in memory. You can specify a limit for parsed and freed segments or composites by using the following methods at the OTD root levels:

You can use these methods to set and control the runtime memory use of the unmarshaling process.