Creating Asynchronous Methods in EJB 3.1

Posted by cindo on Oracle Blogs See other posts from Oracle Blogs or by cindo
Published on Tue, 18 Sep 2012 20:19:42 +0000 Indexed on 2012/09/19 3:46 UTC
Read the original article Hit count: 270

Filed under:

OBE of the Month: Creating Asynchronous Methods
in EJB 3.1


This OBE covers creating an EJB 3.1 application that demonstrates the use of the @Asynchronous annotation in an Enterprise Java Bean (EJB) class or specific method.

In this tutorial, you will create a Java EE 6 Web Application and add the following components to it - a Stateless Session Bean with two asynchronous methods. You define a Servlet to call the asynchronous methods and to keep track of the invocation and completion times to demonstrate the asynchronous nature of the method calls. The index.jsp will contain a form with a submit button, Run allowing you to execute the application. The form will submit to the Servlet which invokes the asynchronous methods defined in the session bean and the response is re-directed to response.jsp. Information about the asynchronous handling procedure is displayed to users. From this information, users will notice that the invoker thread and the called asynchronous thread are working concurrently.

Check out this new OBE on the Oracle Learning Library: Creating Asynchronous Methods in EJB 3.1. This OBE is part of the new EJB 3.1 New Features Series.

Related OBE’s that might interest you:

Creating a No-Interface View Session Bean and Packaging in a WAR File

Creating and Accessing a Session Bean in a  Web Application

© Oracle Blogs or respective owner

Related posts about /Oracle