protected MessageExchange createPart(URI pattern,
NormalizedMessage srcMessage,
Source content) throws Exception {
MessageExchange me = getExchangeFactory().createExchange(pattern);
NormalizedMessage in = me.createMessage();
in.setContent(content);
me.setMessage(in, "in");
if (forwardAttachments) {
Set names = srcMessage.getAttachmentNames();
for (Iterator iter = names.iterator(); iter.hasNext();) {
String name = (String) iter.next();
in.addAttachment(name, srcMessage.getAttachment(name));
}
}
if (forwardProperties) {
Set names = srcMessage.getPropertyNames();
for (Iterator iter = names.iterator(); iter.hasNext();) {
String name = (String) iter.next();
in.setProperty(name, srcMessage.getProperty(name));
}
}
return me;
}