类 DefaultMailErrorHandler
- java.lang.Object
- org.springframework.batch.item.mail.DefaultMailErrorHandler
- 所有已实现的接口:
MailErrorHandler
public class DefaultMailErrorHandler extends java.lang.Object implements MailErrorHandler
ThisMailErrorHandler
implementation simply rethrows the exception it receives.- 从以下版本开始:
- 2.1
- 作者:
- Dan Garrette, Dave Syer
构造器概要
构造器 构造器 说明 DefaultMailErrorHandler()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
handle(org.springframework.mail.MailMessage message, java.lang.Exception exception)
Wraps the input exception with a runtimeMailException
.void
setMaxMessageLength(int maxMessageLength)
The limit for the size of message that will be copied to the exception message.
构造器详细资料
DefaultMailErrorHandler
public DefaultMailErrorHandler()
方法详细资料
setMaxMessageLength
public void setMaxMessageLength(int maxMessageLength)
The limit for the size of message that will be copied to the exception message. Output will be truncated beyond that. Default value is 1024.- 参数:
maxMessageLength
- the maximum message length
handle
public void handle(org.springframework.mail.MailMessage message, java.lang.Exception exception) throws org.springframework.mail.MailException
Wraps the input exception with a runtimeMailException
. The exception message will contain the failed message (using toString).- 指定者:
handle
在接口中MailErrorHandler
- 参数:
message
- a failed messageexception
- a MessagingException- 抛出:
org.springframework.mail.MailException
- a translation of the Exception- 另请参阅:
MailErrorHandler.handle(MailMessage, Exception)