Java Platform, Enterprise Edition: The Java EE Tutorial. Oracle - web version
The Java EE Tutorial. Oracle - pdf
This two aplications is demonstration of implementation asynchronous business methods in Enterprise Session Beans and call it from a web client
-
async-war module - is a web aplication that contains a stateless session bean and a JavaServer Faces interface. The MailerBean stateless session bean defines an asynchronus method, sendMessage, which uses the JavaMail API to send an email an specified email address
-
async-smtpd module - is a Java SE program auxiliary, thet simulate an SMTP server. This program listen on TCP port 3025 for SMTP request and prints the email messages to the standard output console
-
running a module async-smtpd project, Run as --> Java Aplication in your IDE. In the output console tab show the results and future messages
-
In order to compile the async-war example you have to update the resource name of JavaMail in class MailerBean
*in case of servidor WildFly as specified in the Management Console (Configuration > Subsystems > Mail > default > Attributes).
-
deploy module async-war on your aplication server, open URL https://localhost:8080/async-war/ and enter a email in a form and press "Send email"