toolbox.mail
Class MailManagerImpl

Package class diagram package MailManagerImpl
java.lang.Object
  extended by toolbox.mail.MailManagerImpl
All Implemented Interfaces:
MailManager

public class MailManagerImpl
extends java.lang.Object
implements MailManager

Default MailManager implementation.


Constructor Summary
MailManagerImpl()
          Default constructor.
 
Method Summary
 void destroy()
          Destroy this manager by destroying the member SessionManager and SMTPMailer.
 javax.mail.Session getSession()
          Return a Session using the member SessionManager instance.
 SMTPMailer getSMTPMailer()
          Return the member SMTPMailer instance.
 void init(java.lang.String name, XMLProperties xmlProps)
          Initialise this manager instance by creating a SessionManager and SMTPMailer instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailManagerImpl

public MailManagerImpl()
Default constructor.

Method Detail

init

public void init(java.lang.String name,
                 XMLProperties xmlProps)
          throws MailException
Initialise this manager instance by creating a SessionManager and SMTPMailer instance.

Specified by:
init in interface MailManager
Parameters:
name - String containing a name to identify this manager.
xmlProps - XML configuration properties.
Throws:
MailException - if the manager cannot be initialised.

getSMTPMailer

public SMTPMailer getSMTPMailer()
                         throws MailException
Return the member SMTPMailer instance.

Specified by:
getSMTPMailer in interface MailManager
Returns:
SMTPMailer instance.
Throws:
MailException

getSession

public javax.mail.Session getSession()
                              throws MailException
Return a Session using the member SessionManager instance.

Specified by:
getSession in interface MailManager
Returns:
Session instance.
Throws:
MailException

destroy

public void destroy()
             throws MailException
Destroy this manager by destroying the member SessionManager and SMTPMailer.

Specified by:
destroy in interface MailManager
Throws:
MailException