Overview

Asynchronous method calls enable an application to invoke methods in parallel, to reduce the elapsed time taken to process the business transaction. Asynchronous method calls use the Jade messaging framework. For details, see Chapter 15, "Using the Messaging Framework".

The following steps are required in your logic to perform an asynchronous method call.

  1. Create an instance of the JadeMethodContext class.

  2. Set the object properties in your JadeMethodContext instance (for example, the workerAppName and timeout properties).

  3. Initiate the asynchronous method call, by using the invoke method of the JadeMethodContext class.

    At least one worker application must be running with a name matching the value of the workerAppName property.

  4. Continue processing until the results of the asynchronous method call must be harvested.

  5. Wait for the call to complete, by using the waitForMethods method of the Process class.

  6. Check for call errors (that is, exceptions).

  7. Examine the call result value.

The Process class provides the waitForMethods method, whose methodContextList parameter value consists of one or more JadeMethodContext instances or an instance of the ObjectArray class that contains only JadeMethodContext instances. The waitForMethods method suspends the process until one of the specified method contexts completes or times out.