if (attachments == null) {
attachments = new ArrayList<Attachment>();
out.setAttachments(attachments);
}
for (Map.Entry<String, DataHandler> entry : dataHandlers.entrySet()) {
Attachment att = new AttachmentImpl(entry.getKey(), entry.getValue());
attachments.add(att);
}
}
out.remove(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
}