Sun B2B Suite UN/EDIFACT OTD Library User Guide

On Demand Parsing

For performance enhancement reasons, the unmarshal() method does not unmarshal the entire message. Instead, it does the following:

This 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 in the Collaboration using a getxxx() method. The OTD may assigned unmarshaled segments and composites to a pool that is ready to be freed from memory by the Java Virtual Machine (JVM). Once these segments or composites are freed from memory, they become unparsed. If the element within segment or composite is accessed again, the OTD reparses the segment or composite.

By default, UN/EDIFACT OTDs set no limit of parsed segments or composites held in memory. You can specify a limit for parsed and freed segments or composited 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.