J2EE.6.11 JavaMail 1.1 Requirements


The JavaMail API allows for access to e-mail messages contained in message stores, and for the creation and sending of e-mail messages using a message transport. Specific support is included for Internet standard MIME messages. Access to message stores and transports is through protocol providers supporting specific store and transport protocols. The JavaMail API specification does not require any specific protocol providers, but the JavaMail reference implementation includes an IMAP message store provider and an SMTP message transport provider.

Configuration of the JavaMail API is typically done by setting properties in a Properties object that is used to create a javax.mail.Session object using a static factory method. To allow the J2EE platform to configure and manage JavaMail API sessions, an application component that uses the JavaMail API should request a Session object using JNDI, and should list its need for a Session object in its deployment descriptor using a resource-ref element. A JavaMail API Session object should be considered a resource factory, as described in Section J2EE.5.4, "Resource Factory References." This specification requires that the J2EE platform support javax.mail.Session objects as resource factories, as described in that section.

The J2EE platform requires that a message transport be provided that is capable of handling addresses of type javax.mail.internet.InternetAddress and messages of type javax.mail.internet.MimeMessage . The default message transport must be properly configured to send such messages using the send method of the javax.mail.Transport class. Any authentication needed by the default transport must be handled without need for the application to provide a javax.mail.Authenti cator or to explicitly connect to the transport and supply authentication information.

This specification does not require that a J2EE product support any message store protocols.

Note that the JavaMail API creates threads to deliver notifications of Store , Folder , and Transport events. The use of these notification facilities may be limited by the restrictions on the use of threads in various containers. In EJB containers, for instance, it is typically not possible to create threads.

The JavaMail API uses the JavaBeans Activation Framework API to support various MIME data types. The JavaMail API must include javax.activation.DataContentHandlers for the following MIME data types, corresponding to the Java programming language type indicated in Table J2EE.6-4.

Table J2EE.6-4. JavaMail API MIME Data Type to Java Type Mappings

MIME Type

Java Type

text/plain

java.lang.String

multipart/*

javax.mail.internet.MimeMultipart

message/rfc822

javax.mail.internet.MimeMessage

The JavaMail 1.1 API specification is available at http://java.sun.com/products/javamail.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net