Class MailSessionFactory
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:
- mail.smtp.host - Hostname for outbound transport
     connections.  Defaults to localhostif not specified.
This factory can be configured in a
 <Context> element in your conf/server.xml
 configuration file.  An example of factory configuration is:
 <Resource name="mail/smtp"
           auth="CONTAINER"
           type="jakarta.mail.Session"
           mail.smtp.host="mail.mycompany.com"
           />
 - Author:
- Craig R. McClanahan
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final StringThe Java type for which this factory knows how to create objects.
- 
Constructor SummaryConstructors
- 
Method Summary
- 
Field Details- 
factoryTypeThe Java type for which this factory knows how to create objects.- See Also:
 
 
- 
- 
Constructor Details- 
MailSessionFactorypublic MailSessionFactory()
 
- 
- 
Method Details- 
getObjectInstancepublic Object getObjectInstance(Object refObj, Name name, Context context, Hashtable<?, ?> env) throws Exception- Specified by:
- getObjectInstancein interface- ObjectFactory
- Throws:
- Exception
 
 
-