if (getAsyncStatus() == ASYNC_RUNNING) {
// TODO: we need to throw an error
// We can't have two async operations messing with this
// single Call object
}
Listener listener = (Listener)getProperty(AsyncCall.ASYNC_CALL_LISTENER);
if (listener == null) {
listener = new Listener() { // Create default RPC listener
public void invokeComplete() {
setAsyncStatus(ASYNC_READY);
}
public void onResponse(final MessageContext context)
throws java.rmi.RemoteException {