Network Deployment (Distributed operating systems), v8.0 > Develop and deploying applications > Develop EJB applications > Develop session beans > Configure EJB 3.1 session bean methods to be asynchronous


Develop client code that calls EJB asynchronous methods

We can use the sample code within this topic to develop client code that calls EJB asynchronous methods. This task assumes that the following interface and bean implementation classes exist:

public interface AcmeRemoteInterface {
   void fireAndForgetMethod ();
   Future
<Integer> methodWithResults() throws AcmeException1, AcmeException2;
}
@Stateless
@Remote(AcmeRemoteInterface.class)
@Asynchronous
public class AcmeAsyncBean {
   public void fireAndForgetMethod () {
      // do non-critical work


   public Integer methodWithResults() {
      Integer result;
      // do work, and then return results
      return result;

}


Procedure


EJB 3.1 asynchronous methods
EJB container work manager for asynchronous methods
Bean implementation programming model for EJB asynchronous methods
Configure EJB 3.1 session bean methods to be asynchronous

+

Search Tips   |   Advanced Search