Package org.glassfish.grizzly.utils
Class CompletionHandlerAdapter<A,B>
- java.lang.Object
-
- org.glassfish.grizzly.utils.CompletionHandlerAdapter<A,B>
-
- All Implemented Interfaces:
CompletionHandler<B>
- Direct Known Subclasses:
SSLStreamWriter.HandshakeCompletionHandler
public class CompletionHandlerAdapter<A,B> extends Object implements CompletionHandler<B>
- Author:
- Alexey Stashok
-
-
Constructor Summary
Constructors Constructor Description CompletionHandlerAdapter(FutureImpl<A> future)CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler)CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B,A> adapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Aadapt(B result)voidcancelled()The operation was cancelled.voidcompleted(B result)The operation was completed.voidfailed(Throwable throwable)The operation was failed.voidupdated(B result)The callback method may be called, when there is some progress in operation execution, but it is still not completed
-
-
-
Constructor Detail
-
CompletionHandlerAdapter
public CompletionHandlerAdapter(FutureImpl<A> future)
-
CompletionHandlerAdapter
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler)
-
CompletionHandlerAdapter
public CompletionHandlerAdapter(FutureImpl<A> future, CompletionHandler<A> completionHandler, GenericAdapter<B,A> adapter)
-
-
Method Detail
-
cancelled
public void cancelled()
Description copied from interface:CompletionHandlerThe operation was cancelled.- Specified by:
cancelledin interfaceCompletionHandler<A>
-
failed
public void failed(Throwable throwable)
Description copied from interface:CompletionHandlerThe operation was failed.- Specified by:
failedin interfaceCompletionHandler<A>- Parameters:
throwable- error, which occurred during operation execution
-
completed
public void completed(B result)
Description copied from interface:CompletionHandlerThe operation was completed.- Specified by:
completedin interfaceCompletionHandler<A>- Parameters:
result- the operation result Please note, for performance reasons the result object might be recycled after returning from the completed method. So it's not guaranteed that using of the result object is safe outside this method's scope.
-
updated
public void updated(B result)
Description copied from interface:CompletionHandlerThe callback method may be called, when there is some progress in operation execution, but it is still not completed- Specified by:
updatedin interfaceCompletionHandler<A>- Parameters:
result- the current result Please note, for performance reasons the result object might be recycled after returning from the updated method. So it's not guaranteed that using of the result object is safe outside this method's scope.
-
-