Developing client code that calls EJB asynchronous methods

You can use the sample code within this topic to develop client code that calls EJB asynchronous methods.

Before you begin

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;
   }
}

About this task

Procedure


指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:15
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tejb_clientcode
檔名:tejb_clientcode.html