org.camunda.bpm.cycle.service.mail
Class DefaultMailSessionProvider

java.lang.Object
  extended by org.camunda.bpm.cycle.service.mail.DefaultMailSessionProvider
All Implemented Interfaces:
MailSessionProvider

@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.

Author:
Daniel Meyer

Constructor Summary
DefaultMailSessionProvider()
           
 
Method Summary
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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultMailSessionProvider

public DefaultMailSessionProvider()
Method Detail

lookupMailSession

public javax.mail.Session lookupMailSession()
Description copied from interface: MailSessionProvider
Looks up the mail session using the configured name in CycleConfiguration.getMailSessionName().

Specified by:
lookupMailSession in interface MailSessionProvider
Returns:
the mail Session

performLookup

protected javax.mail.Session performLookup(String mailSessionName)

tryAutoDetectMailSession

protected javax.mail.Session tryAutoDetectMailSession()

getKnownDefaultMailSessionNames

protected String[] getKnownDefaultMailSessionNames()

sendMail

public void sendMail(javax.mail.Message msg,
                     javax.mail.Session session)
Description copied from interface: MailSessionProvider
Ends the message using a transport at the discretion of the MailSessionProvider.

Specified by:
sendMail in interface MailSessionProvider


Copyright © 2014 camunda services GmbH. All rights reserved.