org.objectweb.jonas.mail.factory
Class JavaMail

java.lang.Object
  extended by org.objectweb.jonas.mail.factory.JavaMail
All Implemented Interfaces:
java.io.Serializable, javax.naming.Referenceable
Direct Known Subclasses:
JavaMailMimePartDS, JavaMailSession

public abstract class JavaMail
extends java.lang.Object
implements java.io.Serializable, javax.naming.Referenceable

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) 03/04/01 : JavaMail extends ReconfigDispatcher in order to send reconfiguration Notifications to ReconfigManager 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
See Also:
Serialized Form

Constructor Summary
JavaMail(java.lang.String factoryName, java.lang.String name, java.util.Properties mailProperties)
          Constructor of a JavaMail Object with the given name and properties.
 
Method Summary
 java.lang.String getFactoryName()
          Return the name of this mail factory
static org.objectweb.util.monolog.api.Logger getLogger()
           
 java.util.Properties getMailSessionProperties()
           
 java.lang.String getName()
          Return the jndi name of this object
abstract  javax.naming.Reference getReference()
          Retrieves the Reference of the object.
abstract  java.lang.String getType()
          Return the type of the factory
static void setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void setMailSessionProperties(java.util.Properties mailSessionProperties)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMail

public JavaMail(java.lang.String factoryName,
                java.lang.String name,
                java.util.Properties mailProperties)
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 java.lang.String getName()
Return the jndi name of this object

Returns:
the jndi name

getFactoryName

public java.lang.String getFactoryName()
Return the name of this mail factory

Returns:
name of this mail factory.

getType

public abstract java.lang.String getType()
Return the type of the factory

Returns:
the type of the mail factory

getReference

public abstract javax.naming.Reference getReference()
                                             throws javax.naming.NamingException
Retrieves the Reference of the object. The Reference contains the factory used to create this object and the optional parameters used to configure the factory.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
the non-null Reference of the object.
Throws:
javax.naming.NamingException - if a naming exception was encountered while retrieving the reference.

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 java.util.Properties getMailSessionProperties()
Returns:
Returns the mailSessionProperties.

setMailSessionProperties

public void setMailSessionProperties(java.util.Properties mailSessionProperties)
Parameters:
mailSessionProperties - The mailSessionProperties to set.