Author: michiel Date: 2010-05-26 10:22:35 +0200 (Wed, 26 May 2010) New Revision: 42267
Modified: mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/EmailBuilder.java mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/SendMail.java Log: logging, indentation Modified: mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/EmailBuilder.java =================================================================== --- mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/EmailBuilder.java 2010-05-26 08:22:18 UTC (rev 42266) +++ mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/EmailBuilder.java 2010-05-26 08:22:35 UTC (rev 42267) @@ -89,7 +89,8 @@ /** * init */ - @Override public boolean init() { + @Override + public boolean init() { super.init (); String property = getInitParameter("expireTime"); @@ -142,7 +143,8 @@ return true; } - @Override public void shutdown() { + @Override + public void shutdown() { if (expireHandler != null) { try { expireHandler.getClass().getMethod("cancel", Boolean.TYPE).invoke(expireHandler, Boolean.TRUE); @@ -187,8 +189,8 @@ } { - addFunction(new NodeFunction/*<Void>*/("mail", MAIL_PARAMETERS, ReturnType.VOID) { - protected Boolean getFunctionValue(Node node, Parameters parameters) { + addFunction(new NodeFunction<Void>("mail", MAIL_PARAMETERS, ReturnType.VOID) { + protected Void getFunctionValue(Node node, Parameters parameters) { try { sendMail(node, parameters); } catch (javax.mail.MessagingException me) { @@ -198,7 +200,7 @@ } } ); - addFunction(new NodeFunction/*<Void>*/("startmail", MAIL_PARAMETERS, ReturnType.VOID) { + addFunction(new NodeFunction<Void>("startmail", MAIL_PARAMETERS, ReturnType.VOID) { protected Void getFunctionValue(final Node node, final Parameters parameters) { org.mmbase.util.ThreadPools.jobsExecutor.execute(new Runnable() { public void run() { @@ -218,7 +220,7 @@ // This is a silly function. // We could override setStringValue on 'type' itself. Perhaps that even already works. - addFunction(new NodeFunction/*<Void>*/("settype", MAIL_PARAMETERS, ReturnType.VOID) { + addFunction(new NodeFunction<Void>("settype", MAIL_PARAMETERS, ReturnType.VOID) { protected Void getFunctionValue(final Node node, Parameters parameters) { log.debug("We're in startmail - args: " + parameters); setType(node, parameters); Modified: mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/SendMail.java =================================================================== --- mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/SendMail.java 2010-05-26 08:22:18 UTC (rev 42266) +++ mmbase/branches/MMBase-1_9/applications/email/src/main/java/org/mmbase/applications/email/SendMail.java 2010-05-26 08:22:35 UTC (rev 42267) @@ -258,14 +258,16 @@ try { MimeMessage msg = constructMessage(from, onlyTo, headers); - if (mmpart == null) throw new NullPointerException(); + if (mmpart == null) { + throw new NullPointerException(); + } msg.setContent(mmpart); Transport.send(msg); EventManager.getInstance().propagateEvent(new EmailEvent.Sent(msg)); emailSent++; - log.debug("JMimeSendMail done."); + log.debug("JMimeSendMail to " + Arrays.asList(onlyTo) + " done."); return true; } catch (javax.mail.MessagingException e) { emailFailed++; @@ -474,8 +476,8 @@ MimeMessage msg = constructMessage(from, onlyTo, headers); msg.setText(data, mailEncoding); Transport.send(msg); + log.debug("SendMail to " + to + " done."); EventManager.getInstance().propagateEvent(new EmailEvent.Sent(msg)); - log.debug("SendMail done."); return true; } else { log.service("not sending mail to " + to + " because it does not match " + onlyToPattern); @@ -665,12 +667,12 @@ log.service("JMSendMail sending mail to " + to + " cc:" + cc + " bcc:" + bcc + " (node " + n.getNumber() + ")" + " from " + from + " (mime-type " + mimeType + ") using " + session); } Transport.send(msg, onlyto); + log.debug("JMSendMail to " + onlyto + " done."); EventManager.getInstance().propagateEvent(new EmailEvent.Sent(msg)); } else { - log.debug("nothing to do"); + log.debug("nothing to do for JSMSendMail"); } - log.debug("JMSendMail done."); } catch (javax.mail.MessagingException e) { log.error("JMSendMail failure: " + e.getMessage(), e); errors.append("\nMessaging: " + e.getMessage()); _______________________________________________ Cvs mailing list Cvs@lists.mmbase.org http://lists.mmbase.org/mailman/listinfo/cvs