if (type.equals(Payload.TEXT_BODY))
theBody = new TextBodyImpl((BodyImpl) msg.getBody());
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)