Package org.apache.james.core

Examples of org.apache.james.core.MailImpl.dispose()


            if (recipientCollection != null) {
                recipientCollection.clear();
            }
            recipientCollection = null;
            if (mail != null) {
                mail.dispose();
            }
            mail = null;
            if (headersIn != null) {
                try {
                    headersIn.close();
View Full Code Here


            if (recipientCollection != null) {
                recipientCollection.clear();
            }
            recipientCollection = null;
            if (mail != null) {
                mail.dispose();
            }
            mail = null;
            if (headersIn != null) {
                try {
                    headersIn.close();
View Full Code Here

            if (recipientCollection != null) {
                recipientCollection.clear();
            }
            recipientCollection = null;
            if (mail != null) {
                mail.dispose();
            }
            mail = null;
            if (headersIn != null) {
                try {
                    headersIn.close();
View Full Code Here

                                        .append("using a different sender.");
                throw new MessagingException(logBuffer.toString());
            }
   
        } finally {
            newMail.dispose();
        }
       
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
        }
View Full Code Here

               
                newMail.setRecipients(recipientsToAddForward);
                newMail.setAttribute(MARKER, Boolean.TRUE);
                getMailetContext().sendMail(newMail);
            } finally {
                newMail.dispose();
            }
        }

        // If there are no recipients left, Ghost the message
        if (recipients.size() == 0) {
View Full Code Here

                                        .append("using a different sender.");
                throw new MessagingException(logBuffer.toString());
            }
   
        } finally {
            newMail.dispose();
        }
       
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
        }
View Full Code Here

            setIsReply(newMail, isReply(originalMail), originalMail);
   
            newMail.getMessage().saveChanges();
            getMailetContext().sendMail(newMail);
        } finally {
            newMail.dispose();
        }

        // ghosting the original mail
        if(!getPassThrough(originalMail)) {
            originalMail.setState(Mail.GHOST);
View Full Code Here

                        " was not found on this server.");
                throw new MessagingException(errorBuffer.toString());
            }
            userInbox.store(mail);
        } finally {
            mail.dispose();
        }
    }

    /**
     * Return a new mail id.
View Full Code Here

            if (recipientCollection != null) {
                recipientCollection.clear();
            }
            recipientCollection = null;
            if (mail != null) {
                mail.dispose();
            }
            mail = null;
            if (headersIn != null) {
                try {
                    headersIn.close();
View Full Code Here

            MimeMessage m1 = ((Mail) a.get(0)).getMessage();
            MimeMessage m2 = ((Mail) a.get(1)).getMessage();
            assertNotSame(m1,m2);
            assertEquals(m1.getSubject(),"new text 1");
            assertEquals(m2.getSubject(),"new text 2");
            m.dispose();
        } catch (MessagingException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.