org.springframework.integration.mail
Class MailSendingMessageHandler

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.handler.AbstractMessageHandler
          extended by org.springframework.integration.mail.MailSendingMessageHandler
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, NamedComponent, Orderable, MessageHandler, TrackableComponent

public class MailSendingMessageHandler
extends AbstractMessageHandler

A MessageHandler implementation for sending mail.

If the Message is an instance of MailMessage, it will be passed as-is. If the Message payload is a byte array, it will be passed as an attachment, and in that case, the MailHeaders.ATTACHMENT_FILENAME header is required. Otherwise, a String type is expected, and its content will be used as the text within a SimpleMailMessage.

See Also:
MailHeaders

Field Summary
 
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
MailSendingMessageHandler(JavaMailSender mailSender)
          Create a MailSendingMessageConsumer.
 
Method Summary
protected  void handleMessageInternal(Message<?> message)
           
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
getComponentType, getOrder, handleMessage, setOrder, setShouldTrack
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName
 

Constructor Detail

MailSendingMessageHandler

public MailSendingMessageHandler(JavaMailSender mailSender)
Create a MailSendingMessageConsumer.

Parameters:
mailSender - the JavaMailSender instance to which this adapter will delegate.
Method Detail

handleMessageInternal

protected final void handleMessageInternal(Message<?> message)
Specified by:
handleMessageInternal in class AbstractMessageHandler