org.objectweb.jonas.mail.factory
Class JavaMailSession

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

public class JavaMailSession
extends JavaMail

This class provides a way for referencing mail session.

Author:
Florent Benoit, Ludovic Bert
See Also:
Serialized Form

Constructor Summary
JavaMailSession(java.lang.String factoryName, java.lang.String name, java.util.Properties mailProperties)
          Constructor of a JMailSession Object.
 
Method Summary
 javax.naming.Reference getReference()
          Retrieves the Reference of the javax.mail.Session object.
 java.lang.String getType()
          Return the type of the factory
 
Methods inherited from class org.objectweb.jonas.mail.factory.JavaMail
getFactoryName, getLogger, getMailSessionProperties, getName, setLogger, setMailSessionProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMailSession

public JavaMailSession(java.lang.String factoryName,
                       java.lang.String name,
                       java.util.Properties mailProperties)
Constructor of a JMailSession Object.

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

getType

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

Specified by:
getType in class JavaMail
Returns:
the type of the mail factory

getReference

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

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