* @param theMessage a JMS Message from which to obtain data
* @return a Transportable containing data from the given Message
*/
protected Transportable toTransportable(Message theMessage) throws TransportException {
if ( !(theMessage instanceof TextMessage)) {
throw new TransportException("This implementation expects getMessage() to return "
+ " a TextMessage. Override this method if another message type is to be used");
}
Transportable result = null;
try {
String text = ((TextMessage) theMessage).getText();
result = new TransportableImpl(text);
result.getMetadata().putAll(getCommonMetadata());
} catch (JMSException e) {
throw new TransportException(e);
}
return result;
}