}
public static CompositeData convert(Message message) throws OpenDataException {
OpenTypeFactory f = getFactory(message.getClass());
if (f == null) {
throw new OpenDataException("Cannot create a CompositeData for type: " + message.getClass().getName());
}
CompositeType ct = f.getCompositeType();
Map<String, Object> fields = f.getFields(message);
return new CompositeDataSupport(ct, fields);
}