4.9. Finding Class Code

The serialization hooks discussed thus far either customize how instances are serialized or customize what data is written in the standard class metadata format. The serialization specification also includes hooks for extending or replacing the class metadata format. The annotateClass and resolveClass methods of the object streams allow arbitrary per-class payloads to be added to a stream.

While there are no restrictions on the data included in a class annotation, the primary use for this mechanism is to help the receiver locate the correct class file if it is not available locally. The sender writes a URL string for each class, and the receiver uses the URL to instantiate a ClassLoader if it cannot find a local definition ...

Get Component Development for the Java™ Platform 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.