FileDocCategorySizeDatePackage
AsyncResult.javaAPI DocApache Axis 1.43042Sat Apr 22 18:57:28 BST 2006org.apache.axis.client.async

AsyncResult

public class AsyncResult extends Object implements Runnable, IAsyncResult
Access the results of the Async call
author
Davanum Srinivas (dims@yahoo.com)

Fields Summary
private Thread
thread
Field thread
private Object
response
Field response
private Throwable
exception
Field exception
private AsyncCall
ac
Field ac
private QName
opName
Field opName
private Object[]
params
Field params
private Status
status
Field status
Constructors Summary
public AsyncResult(AsyncCall ac, QName opName, Object[] params)
Constructor AsyncResult

param
ac
param
opName
param
params


                         
           
        this.ac = ac;
        this.opName = opName;
        this.params = params;

        if (opName == null) {
            this.opName = ac.getCall().getOperationName();
        }

        thread = new Thread(this);
        thread.setDaemon(true);
        thread.start();
    
Methods Summary
public voidabort()
Method abort

        thread.interrupt();
        status = Status.INTERRUPTED;
    
public java.lang.ThrowablegetException()
Method getException

return

        return exception;
    
public java.lang.ObjectgetResponse()
Method getResponse

return

        return response;
    
public StatusgetStatus()
Method getStatus

return

        return status;
    
public voidrun()
Method run

        try {
            response = ac.getCall().invoke(opName, params);
            status = Status.COMPLETED;
        } catch (Throwable e) {
            exception = e;
            status = Status.EXCEPTION;
        } finally {
            IAsyncCallback callback = ac.getCallback();
            if (callback != null) {
                callback.onCompletion(this);
            }
        }
    
public voidwaitFor(long timeout)
Method waitFor

param
timeout
throws
InterruptedException

        thread.wait(timeout);