/** * @param original * MimeMessageSource * @throws MessagingException */ public MimeMessageCopyOnWriteProxy(MimeMessageSource original) throws MessagingException { this(new MimeMessageWrapper(original), true); }
/** * Check the number of references over the MimeMessage and clone it if * needed before returning the reference * * @throws MessagingException * exception */ protected synchronized MimeMessage getWrappedMessageForWriting() throws MessagingException { if (refCount.getReferenceCount() > 1) { refCount.decrementReferenceCount(); refCount = new MessageReferenceTracker(new MimeMessageWrapper(refCount.getWrapped())); } return refCount.getWrapped(); }