Marshalling

(Un)Marshalling is what will (read/)write a Java object to a communication format. It is commonly the part converting an object to a XML or JSON payload but can really be any format, including binary formats.

This conversion is normally synchronous in the implementation and can be costly depending on the model you use and the serializer that is activated. Compared with the servlet API, where you yourself serialize the payload you want to read/return, here, the task is done by the framework and is, therefore, a bit hidden.

A crucial point at this stage is to make sure that the manipulated object has almost no logic and is fast to initialize/read. If you don't respect this point, you may end up holding the HTTP stream for too long ...

Get Java EE 8 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.