views:

39

answers:

1

If I use SMTPTransport (http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/SMTPTransport.html) as private static object for class that implements MessageDrivenBean and MessageListener, will it be thread safe or are there some possible error situations?

+1  A: 

It looks like SMTPTransport is a thread-safe object.
So, you should be able to use it from any thread. Though you should not be too optimistic about this. I've seen too few API which were ready to be used from different threads without problems :(

Oleg Sukhodolsky