Developing applications that use the Asynchronous Invocation API on Liberty
You can use the Asynchronous Invocation API to transfer events that require processing in the context of a Session Initiation Protocol (SIP) application session to any server in a cluster based on the related application session ID. The Asynchronous Invocation API transfers the event task to the correct server.
Before you begin
Read the API documentation for information on the following asynchronous work
classes:
- com.ibm.websphere.sip.AsynchronousWork
- com.ibm.websphere.sip.AsynchronousWorkListener
For more information about the API classes, see Interfaces de programación (API y SPI).
About this task
When running code outside of a SIP thread, application developers can use the Asynchronous Invocation API to create an object. They can then configure the server to run that object either on a different thread in the same container, or on a different server, if that is where the session exists.
The following example shows the class structure for the AsynchronousWork class, which
is the abstract base class that is extended when you use the
API.
public abstract class AsynchronousWork implements Serializable
{
private String sessionId;
public AsynchronousWork(String sessionId)
{
this.sessionId = sessionId;
....
}
public void dispatch (AsynchronousWorkListener listener)
{
....
}
public abstract Serializable doAsyncTask();
}