if (type.equals(Payload.OBJECT_BODY))
theBody = new ObjectBodyImpl((BodyImpl) msg.getBody());
if (type.equals(Payload.MAP_BODY))
theBody = new MapBodyImpl((BodyImpl) msg.getBody());
if (theBody != null)
{
((MessageImpl) msg).replaceBody((BodyImpl) theBody);