Home

OLL Mobile

FAQ

Creating Asynchronous Methods in EJB 3.1

    • Rating:

General Information

  • This example demonstrates the use of the EJB 3.1 @Asynchronous annotation in an EJB class or specific method.  In EJB 3.1, session beans support asynchronous method invocations. Bean methods annotated with @Asynchronous are invoked asynchronously. When a client invokes methods with the @Asynchronous annotation, the container immediately returns control to the client and invokes the method in a different thread. The method may return a future object to allow the client to check on the status of the method invocation, and retrieve result values that are asynchronously produced. EJB 3.1 supports this feature by using Future, which is part of standard java concurrency. Future represents the result of an asynchronous computation.

    Release Date: 06-Sep-12

    Duration: 45 minutes

    Credited To: Anjana Shenoy

    No Flash Plugin Needed

Reviews

  • krzysztof.korzeniewski

    03-Jan-14

    The purpose/reason of AsyncResult remains unrevealed. Also the reason for StringBuilder in the Bean is kept a secret unit Servlet is created. And lastly, the calculation parameters could be provided in index.jsp form, instead being harcoded in Servlet. Nevertheless, good enough to understand the concept of @Asynchronous.

Associated Products

Visit the Full Site | About Oracle | Contact Us | Terms of Use