title: How do you use XML/XSD to define JAXB abstract class and implement inheritance?
body: <p>Looking for a way to define a base XML schema to be re-used on additional schemas as XML messages that will be used for different JMS message payloads. The intent is to:</p>
  
  <ul>
  <li>XmlMessage - Define a base Message class that all messages will be sent as.</li>
  <li>Header - class that all messages will have containing meta data about the message</li>
  <li>Body - abstract class that each specific message implementation can use to define the messagee payolad of each individual message</li>
  </ul>
  
  <p>This approach will:</p>
  
  <ul>
  <li>Allow the JMS EJB to unmarshal incoming XML into the high level generic XmlMessage and then be able to evaluate the class type of the Body implementation to determine how to handle the message.</li>
  <li>Standardize the various message formats.</li>
  <li>Take advantage of JAXB to generate the Java classes to be used on both the client sending the message and the EJB processing the message.</li>
  <li>Take advantage of JAXB to marshal/unmarshal the XML in the message payload.</li>
  </ul>