Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » naming » factory » [javadoc | source]
org.apache.naming.factory
public class: MailSessionFactory [javadoc | source]
java.lang.Object
   org.apache.naming.factory.MailSessionFactory

All Implemented Interfaces:
    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"
type="javax.mail.Session"/>
<ResourceParams name="mail/smtp">
<parameter>
<name>factory</name>
<value>org.apache.naming.factory.MailSessionFactory</value>
</parameter>
<parameter>
<name>mail.smtp.host</name>
<value>mail.mycompany.com</value>
</parameter>
</ResourceParams>
Field Summary
protected static final  String factoryType    The Java type for which this factory knows how to create objects. 
Method from org.apache.naming.factory.MailSessionFactory Summary:
getObjectInstance
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.naming.factory.MailSessionFactory Detail:
 public Object getObjectInstance(Object refObj,
    Name name,
    Context context,
    Hashtable env) throws Exception 
    Create and return an object instance based on the specified characteristics.