Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform
by Mark Hapner, Rich Burridge, Rahul Sharma, Joseph Fialli, Kim Haase
33.1. Overview and Related Methods and Interfaces
An ObjectMessage object is used to send a message that contains a serializable object in the Java programming language (“Java object”). It inherits from the Message interface and adds a body containing a single reference to an object. Only Serializable Java objects can be used.
If a collection of Java objects must be sent, one of the Collection classes provided since version 1.2 of the J2SE SDK can be used.
When a client receives an ObjectMessage, it is in read-only mode. If a client attempts to write to the message at this point, a MessageNotWriteableException is thrown. If clearBody is called, the message can now be both read from and written to.
The related methods and interfaces are
Session.createObjectMessage() ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access