org.ow2.jonas.mail.internal.factory
Class AbstractJavaMail

java.lang.Object
  extended by org.ow2.jonas.mail.internal.factory.AbstractJavaMail
All Implemented Interfaces:
Referenceable, JavaMail
Direct Known Subclasses:
JavaMailMimePartDS, JavaMailSession

public abstract class AbstractJavaMail
extends Object
implements JavaMail

This class implements JOnAS mail factory objects. It gets the properties from mail factory properties file and build a properties object for the Session.

Author:
Florent Benoit, Ludovic Bert Contributor(s): Adriana Danes : Refactor code: rename the management methods (use straightforward names, as they are to be used in a Management Console) Markus Karg : Change the JOnAS mail factory initialisation strategy in order to allow any initialisation parameters for a javax.mail.Session object (not only a known set pf initialisation parameters as before). Adriana Danes : 03/11/20 : J2EEManagement conformance - replaces old JMail class

Constructor Summary
AbstractJavaMail(String factoryName, String name, Properties mailProperties, MailService mailService)
          Constructor of a JavaMail Object with the given name and properties.
 
Method Summary
 Properties getAuthenticationProperties()
          Retrieves the authentication properties of this object.
 String getFactoryName()
          Return the name of this mail factory.
static org.objectweb.util.monolog.api.Logger getLogger()
           
 MailService getMailService()
           
 Properties getMailSessionProperties()
           
 String getName()
          Return the jndi name of this object.
 Properties getSessionProperties()
          Retrieves the session properties of this object.
 void setAuthenticationProperties(Properties props)
          Set the authentication properties.
static void setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void setMailSessionProperties(Properties mailSessionProperties)
           
 void setName(String name)
          Set the jndi name of this object.
 void setSessionProperties(Properties props)
          Set the session properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.ow2.jonas.mail.factory.JavaMail
getType
 
Methods inherited from interface javax.naming.Referenceable
getReference
 

Constructor Detail

AbstractJavaMail

public AbstractJavaMail(String factoryName,
                        String name,
                        Properties mailProperties,
                        MailService mailService)
Constructor of a JavaMail Object with the given name and properties.

Parameters:
factoryName - the name of the factory.
name - the jndi name.
mailProperties - properties for configuring and manageing this object.
Method Detail

getName

public String getName()
Description copied from interface: JavaMail
Return the jndi name of this object.

Specified by:
getName in interface JavaMail
Returns:
the jndi name

setName

public void setName(String name)
Set the jndi name of this object.

Specified by:
setName in interface JavaMail
Parameters:
name - the jndi name

getFactoryName

public String getFactoryName()
Description copied from interface: JavaMail
Return the name of this mail factory.

Specified by:
getFactoryName in interface JavaMail
Returns:
name of this mail factory.

getSessionProperties

public Properties getSessionProperties()
Retrieves the session properties of this object.

Specified by:
getSessionProperties in interface JavaMail
Returns:
the session properties of this object.

setSessionProperties

public void setSessionProperties(Properties props)
Set the session properties.

Specified by:
setSessionProperties in interface JavaMail
Parameters:
props - the session properties.

getAuthenticationProperties

public Properties getAuthenticationProperties()
Retrieves the authentication properties of this object.

Specified by:
getAuthenticationProperties in interface JavaMail
Returns:
the authentication properties of this object.

setAuthenticationProperties

public void setAuthenticationProperties(Properties props)
Set the authentication properties.

Specified by:
setAuthenticationProperties in interface JavaMail
Parameters:
props - the authentication properties.

getLogger

public static org.objectweb.util.monolog.api.Logger getLogger()
Returns:
Returns the logger.

setLogger

public static void setLogger(org.objectweb.util.monolog.api.Logger logger)
Parameters:
logger - The logger to set.

getMailSessionProperties

public Properties getMailSessionProperties()
Specified by:
getMailSessionProperties in interface JavaMail
Returns:
Returns the mailSessionProperties.

setMailSessionProperties

public void setMailSessionProperties(Properties mailSessionProperties)
Specified by:
setMailSessionProperties in interface JavaMail
Parameters:
mailSessionProperties - The mailSessionProperties to set.

getMailService

public MailService getMailService()


Copyright © 2010 OW2 Consortium. All Rights Reserved.