Package org.opennms.javamail
Class JavaMailer2.LoggingTransportListener
- java.lang.Object
-
- org.opennms.javamail.JavaMailer2.LoggingTransportListener
-
- All Implemented Interfaces:
java.util.EventListener
,javax.mail.event.TransportListener
- Enclosing class:
- JavaMailer2
public static class JavaMailer2.LoggingTransportListener extends java.lang.Object implements javax.mail.event.TransportListener
-
-
Constructor Summary
Constructors Constructor Description LoggingTransportListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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(javax.mail.event.TransportEvent event)
void
messageNotDelivered(javax.mail.event.TransportEvent event)
void
messagePartiallyDelivered(javax.mail.event.TransportEvent event)
-
-
-
Method Detail
-
messageDelivered
public void messageDelivered(javax.mail.event.TransportEvent event)
- Specified by:
messageDelivered
in interfacejavax.mail.event.TransportListener
-
messageNotDelivered
public void messageNotDelivered(javax.mail.event.TransportEvent event)
- Specified by:
messageNotDelivered
in interfacejavax.mail.event.TransportListener
-
messagePartiallyDelivered
public void messagePartiallyDelivered(javax.mail.event.TransportEvent event)
- Specified by:
messagePartiallyDelivered
in interfacejavax.mail.event.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
-
-