org.apache.servicemix.components.email
Class MimeMailMarshaler

java.lang.Object
  extended by org.apache.servicemix.components.util.MarshalerSupport
      extended by org.apache.servicemix.components.email.MailMarshalerSupport
          extended by org.apache.servicemix.components.email.MimeMailMarshaler

public class MimeMailMarshaler
extends MailMarshalerSupport

The default marshaler from the NormalizedMessage to a Mime email using expressions for each field required on the email.

Version:
$Revision: 2153 $

Constructor Summary
MimeMailMarshaler()
           
 
Method Summary
protected  HashMap getAttachments(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
           
protected  Address[] getBcc(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
           
protected  Address[] getCc(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
           
protected  Address getFrom(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
           
protected  Address[] getReplyTo(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
           
protected  Address[] getTo(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
           
 void prepareExchange(javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage, MimeMessage mimeMessage)
          Populates the MessageExchange with values extracted from the mail message using expressions.
 void prepareMessage(MimeMessage mimeMessage, javax.jbi.messaging.MessageExchange exchange, javax.jbi.messaging.NormalizedMessage normalizedMessage)
          Populates the mime email message with values extracted from the message exchange using expressions.
 
Methods inherited from class org.apache.servicemix.components.email.MailMarshalerSupport
asAddress, asAddressArray, asDate, asStringOrStringArray, getAttachments, getBcc, getCc, getDateFormat, getFrom, getHtml, getHtml, getReplyTo, getSentDate, getSentDate, getSubject, getSubject, getText, getText, getTo, setAttachments, setBcc, setCc, setDateFormat, setFrom, setHtml, setReplyTo, setSentDate, setSubject, setText, setTo
 
Methods inherited from class org.apache.servicemix.components.util.MarshalerSupport
asString, getTransformer, setTransformer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeMailMarshaler

public MimeMailMarshaler()
Method Detail

prepareExchange

public void prepareExchange(javax.jbi.messaging.MessageExchange exchange,
                            javax.jbi.messaging.NormalizedMessage normalizedMessage,
                            MimeMessage mimeMessage)
                     throws MessagingException
Populates the MessageExchange with values extracted from the mail message using expressions.

Parameters:
exchange - the JBI message exchange
normalizedMessage - the normalized message from JBI
mimeMessage - the mime email
Throws:
MessagingException - if the message could not be constructed or there was an error creating an address

prepareMessage

public void prepareMessage(MimeMessage mimeMessage,
                           javax.jbi.messaging.MessageExchange exchange,
                           javax.jbi.messaging.NormalizedMessage normalizedMessage)
                    throws MessagingException
Populates the mime email message with values extracted from the message exchange using expressions.

Parameters:
mimeMessage - the mime email
exchange - the JBI message exchange
normalizedMessage - the normalized message from JBI
Throws:
MessagingException - if the message could not be constructed or there was an error creating an address

getFrom

protected Address getFrom(javax.jbi.messaging.MessageExchange exchange,
                          javax.jbi.messaging.NormalizedMessage normalizedMessage)
                   throws javax.jbi.messaging.MessagingException,
                          AddressException
Throws:
javax.jbi.messaging.MessagingException
AddressException

getTo

protected Address[] getTo(javax.jbi.messaging.MessageExchange exchange,
                          javax.jbi.messaging.NormalizedMessage normalizedMessage)
                   throws javax.jbi.messaging.MessagingException,
                          AddressException
Throws:
javax.jbi.messaging.MessagingException
AddressException

getCc

protected Address[] getCc(javax.jbi.messaging.MessageExchange exchange,
                          javax.jbi.messaging.NormalizedMessage normalizedMessage)
                   throws javax.jbi.messaging.MessagingException,
                          AddressException
Throws:
javax.jbi.messaging.MessagingException
AddressException

getBcc

protected Address[] getBcc(javax.jbi.messaging.MessageExchange exchange,
                           javax.jbi.messaging.NormalizedMessage normalizedMessage)
                    throws javax.jbi.messaging.MessagingException,
                           AddressException
Throws:
javax.jbi.messaging.MessagingException
AddressException

getReplyTo

protected Address[] getReplyTo(javax.jbi.messaging.MessageExchange exchange,
                               javax.jbi.messaging.NormalizedMessage normalizedMessage)
                        throws javax.jbi.messaging.MessagingException,
                               AddressException
Throws:
javax.jbi.messaging.MessagingException
AddressException

getAttachments

protected HashMap getAttachments(javax.jbi.messaging.MessageExchange exchange,
                                 javax.jbi.messaging.NormalizedMessage normalizedMessage)


Copyright © 2005-2010 The Apache Software Foundation. All Rights Reserved.