Commit 3fce14a9 authored by Quxl's avatar Quxl

x

parent 58fa56b8
package com.egolm.pds.bean; package com.egolm.pds.bean;
public class MailObject { public class MailObject {
public String subject;
public String content; private String subject;
private String content;
public String getSubject() {
return subject;
}
public String getContent() {
return content;
}
public void setSubject(String subject) {
this.subject = subject;
}
public void setContent(String content) {
this.content = content;
}
} }
...@@ -28,8 +28,8 @@ public class EmailService { ...@@ -28,8 +28,8 @@ public class EmailService {
StringBuffer stackString = ThrowableUtil.toStackString(e); StringBuffer stackString = ThrowableUtil.toStackString(e);
String timeString = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss"); String timeString = DateUtil.format(new Date(), "yyyy-MM-dd HH:mm:ss");
MailObject emailObject = new MailObject(); MailObject emailObject = new MailObject();
emailObject.subject = subject; emailObject.setSubject(subject);
emailObject.content = timeString + "\r\n" + subject + "\r\n" + content + "\r\n" + stackString.toString(); emailObject.setContent(timeString + "\r\n" + subject + "\r\n" + content + "\r\n" + stackString.toString());
queue.add(emailObject); queue.add(emailObject);
} }
...@@ -39,7 +39,7 @@ public class EmailService { ...@@ -39,7 +39,7 @@ public class EmailService {
MailObject obj = null; MailObject obj = null;
try { try {
obj = queue.take(); obj = queue.take();
this.sendForsync(obj.subject, obj.content); this.sendForsync(obj.getSubject(), obj.getContent());
} catch (Throwable e) { } catch (Throwable e) {
log.error("", e); log.error("", e);
if(obj != null) { if(obj != null) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment