Apache Tomcat 6.0.39

Class MailSessionFactory

  extended by org.apache.naming.factory.MailSessionFactory
All Implemented Interfaces:

public class MailSessionFactory
extends java.lang.Object
implements javax.naming.spi.ObjectFactory

Factory class that creates a JNDI named JavaMail Session factory, which can be used for managing inbound and outbound electronic mail messages via JavaMail APIs. All messaging environment properties described in the JavaMail Specification may be passed to the Session factory; however the following properties are the most commonly used:

This factory can be configured in a <DefaultContext> or <Context> element in your conf/server.xml configuration file. An example of factory configuration is:

 <Resource name="mail/smtp" auth="CONTAINER"
 <ResourceParams name="mail/smtp">

$Id: MailSessionFactory.java 939511 2010-04-29 23:48:20Z kkolinko $
Craig R. McClanahan

Field Summary
protected static java.lang.String factoryType
          The Java type for which this factory knows how to create objects.
Constructor Summary
Method Summary
 java.lang.Object getObjectInstance(java.lang.Object refObj, javax.naming.Name name, javax.naming.Context context, java.util.Hashtable env)
          Create and return an object instance based on the specified characteristics.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected static final java.lang.String factoryType
The Java type for which this factory knows how to create objects.

See Also:
Constant Field Values
Constructor Detail


public MailSessionFactory()
Method Detail


public java.lang.Object getObjectInstance(java.lang.Object refObj,
                                          javax.naming.Name name,
                                          javax.naming.Context context,
                                          java.util.Hashtable env)
                                   throws java.lang.Exception
Create and return an object instance based on the specified characteristics.

Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
refObj - Reference information containing our parameters, or null if there are no parameters
name - The name of this object, relative to context, or null if there is no name
context - The context to which name is relative, or null if name is relative to the default initial context
env - Environment variables, or null if there are none
java.lang.Exception - if an error occurs during object creation

Apache Tomcat 6.0.39

Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.