com.sun.xml.ws.client
Class AsyncResponseImpl<T>

java.lang.Object
  extended by java.util.concurrent.FutureTask<T>
      extended by com.sun.xml.ws.client.AsyncResponseImpl<T>
All Implemented Interfaces:
ResponseContextReceiver, Runnable, Future<T>, RunnableFuture<T>, Response<T>

public final class AsyncResponseImpl<T>
extends FutureTask<T>
implements Response<T>, ResponseContextReceiver

Response implementation. When Runnbale is executed, it just hands the request to Fiber and returns. When the Fiber finishes the execution, it sets response in the FutureTask


Constructor Summary
AsyncResponseImpl(Runnable runnable, AsyncHandler<T> handler)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 ResponseContext getContext()
           
 void run()
           
 void set(T v, Throwable t)
           
 void setCancelable(Cancelable cancelable)
           
 void setResponseContext(ResponseContext rc)
          Called upon the completion of the invocation to set a ResponseContext.
 
Methods inherited from class java.util.concurrent.FutureTask
done, get, get, isCancelled, isDone, runAndReset, set, setException
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Future
get, get, isCancelled, isDone
 

Constructor Detail

AsyncResponseImpl

public AsyncResponseImpl(Runnable runnable,
                         @Nullable
                         AsyncHandler<T> handler)
Parameters:
runnable - This Runnable is executed asynchronously.
handler - Optional AsyncHandler to invoke at the end of the processing. Can be null.
Method Detail

run

public void run()
Specified by:
run in interface Runnable
Specified by:
run in interface RunnableFuture<T>
Overrides:
run in class FutureTask<T>

getContext

public ResponseContext getContext()
Specified by:
getContext in interface Response<T>

setResponseContext

public void setResponseContext(ResponseContext rc)
Description copied from interface: ResponseContextReceiver
Called upon the completion of the invocation to set a ResponseContext.

This method is invoked even when the invocation fails.

Specified by:
setResponseContext in interface ResponseContextReceiver

set

public void set(T v,
                Throwable t)

setCancelable

public void setCancelable(Cancelable cancelable)

cancel

public boolean cancel(boolean mayInterruptIfRunning)
Specified by:
cancel in interface Future<T>
Overrides:
cancel in class FutureTask<T>


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.