CompositeMessageConverter converters = null;
try {
converters = converterFactory.newInstance(contentType);
}
catch (ConversionException e) {
throw new ModuleConfigurationException(e.getMessage() +
"(" +
module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString
+ ")");
}
Class<?> dataType = MessageConverterUtils.getJavaTypeForContentType(contentType,
sm.getApplicationContext().getClassLoader());
if (dataType == null) {
throw new ModuleConfigurationException("Content type is not supported for " +
module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString);
}
else {
channel.setDatatypes(dataType);
channel.setMessageConverter(converters);
}
}
catch (Throwable t) {
throw new ModuleConfigurationException(t.getMessage(), t);
}
}