@Component public class DefaultMailSessionProvider extends Object implements MailSessionProvider
Default implementation of the MailSessionProvider
SPI.
This implemenation looks up a mail session in JNDI using the name configured in CycleConfiguration.getMailSessionName()
.
If that name is null, a set of default mail session names is used in order to autodetect a mail session.
Constructor and Description |
---|
DefaultMailSessionProvider() |
Modifier and Type | Method and Description |
---|---|
protected String[] |
getKnownDefaultMailSessionNames() |
javax.mail.Session |
lookupMailSession()
Looks up the mail session using the configured name in
CycleConfiguration.getMailSessionName() . |
protected javax.mail.Session |
performLookup(String mailSessionName) |
void |
sendMail(javax.mail.Message msg,
javax.mail.Session session)
Ends the message using a transport at the discretion of the
MailSessionProvider . |
protected javax.mail.Session |
tryAutoDetectMailSession() |
public javax.mail.Session lookupMailSession()
MailSessionProvider
CycleConfiguration.getMailSessionName()
.lookupMailSession
in interface MailSessionProvider
Session
protected javax.mail.Session performLookup(String mailSessionName)
protected javax.mail.Session tryAutoDetectMailSession()
protected String[] getKnownDefaultMailSessionNames()
public void sendMail(javax.mail.Message msg, javax.mail.Session session)
MailSessionProvider
MailSessionProvider
.sendMail
in interface MailSessionProvider
Copyright © 2015. All rights reserved.