}
activeMessage = msg;
} else if (message instanceof ObjectMessage) {
ObjectMessage objMsg = (ObjectMessage)message;
ActiveMQObjectMessage msg = new ActiveMQObjectMessage();
msg.setConnection(connection);
msg.setObject(objMsg.getObject());
msg.storeContent();
activeMessage = msg;
} else if (message instanceof StreamMessage) {
StreamMessage streamMessage = (StreamMessage)message;
streamMessage.reset();
ActiveMQStreamMessage msg = new ActiveMQStreamMessage();
msg.setConnection(connection);
Object obj = null;
try {
while ((obj = streamMessage.readObject()) != null) {
msg.writeObject(obj);
}
} catch (MessageEOFException e) {
// if an end of message stream as expected
} catch (JMSException e) {
}
activeMessage = msg;
} else if (message instanceof TextMessage) {
TextMessage textMsg = (TextMessage)message;
ActiveMQTextMessage msg = new ActiveMQTextMessage();
msg.setConnection(connection);
msg.setText(textMsg.getText());
activeMessage = msg;
} else if (message instanceof BlobMessage) {
BlobMessage blobMessage = (BlobMessage)message;
ActiveMQBlobMessage msg = new ActiveMQBlobMessage();
msg.setConnection(connection);
msg.setBlobDownloader(new BlobDownloader(connection.getBlobTransferPolicy()));
try {
msg.setURL(blobMessage.getURL());
} catch (MalformedURLException e) {
}
activeMessage = msg;
} else {