org.opennms.netmgt.utils
Class JavaMailer.LoggingTransportListener

java.lang.Object
  extended by org.opennms.netmgt.utils.JavaMailer.LoggingTransportListener
All Implemented Interfaces:
EventListener, TransportListener
Enclosing class:
JavaMailer

public static class JavaMailer.LoggingTransportListener
extends Object
implements TransportListener


Constructor Summary
JavaMailer.LoggingTransportListener(Category category)
           
 
Method Summary
 void assertAllMessagesDelivered()
          We sleep up to ten times for 10ms, checking to see if anything has been received because the notifications are done by a separate thread.
 boolean hasAnythingBeenReceived()
           
 void messageDelivered(TransportEvent event)
           
 void messageNotDelivered(TransportEvent event)
           
 void messagePartiallyDelivered(TransportEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMailer.LoggingTransportListener

public JavaMailer.LoggingTransportListener(Category category)
Method Detail

messageDelivered

public void messageDelivered(TransportEvent event)
Specified by:
messageDelivered in interface TransportListener

messageNotDelivered

public void messageNotDelivered(TransportEvent event)
Specified by:
messageNotDelivered in interface TransportListener

messagePartiallyDelivered

public void messagePartiallyDelivered(TransportEvent event)
Specified by:
messagePartiallyDelivered in interface TransportListener

hasAnythingBeenReceived

public boolean hasAnythingBeenReceived()

assertAllMessagesDelivered

public void assertAllMessagesDelivered()
                                throws JavaMailerException
We sleep up to ten times for 10ms, checking to see if anything has been received because the notifications are done by a separate thread. We also wait another 50ms after we see the first notification come in, just to see if anything else trickles in. This isn't perfect, but it's somewhat of a shot in the dark to hope that we catch most things, to try to catch as many errors as possible so we can fairly reliably report if anything had problems.

Throws:
JavaMailerException


Copyright © 2009. All Rights Reserved.