Class NoOpAsyncResult
- java.lang.Object
-
- org.apache.qpid.protonj2.client.futures.NoOpAsyncResult
-
- All Implemented Interfaces:
AsyncResult<java.lang.Void>
public class NoOpAsyncResult extends java.lang.Object implements AsyncResult<java.lang.Void>
Simple NoOp implementation used when the result of the operation does not matter.
-
-
Field Summary
Fields Modifier and Type Field Description static NoOpAsyncResultINSTANCEA singleton instance of the NoOpAsyncResult for use in client operation.
-
Constructor Summary
Constructors Constructor Description NoOpAsyncResult()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete(java.lang.Void result)If the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.voidfailed(ClientException result)If the operation fails this method is invoked with the Exception that caused the failure.booleanisComplete()Returns true if the AsyncResult has completed.
-
-
-
Field Detail
-
INSTANCE
public static final NoOpAsyncResult INSTANCE
A singleton instance of the NoOpAsyncResult for use in client operation.
-
-
Method Detail
-
failed
public void failed(ClientException result)
Description copied from interface:AsyncResultIf the operation fails this method is invoked with the Exception that caused the failure.- Specified by:
failedin interfaceAsyncResult<java.lang.Void>- Parameters:
result- The error that resulted in this asynchronous operation failing.
-
complete
public void complete(java.lang.Void result)
Description copied from interface:AsyncResultIf the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.- Specified by:
completein interfaceAsyncResult<java.lang.Void>- Parameters:
result- the object that completes the future.
-
isComplete
public boolean isComplete()
Description copied from interface:AsyncResultReturns true if the AsyncResult has completed. The task is considered complete regardless if it succeeded or failed.- Specified by:
isCompletein interfaceAsyncResult<java.lang.Void>- Returns:
- returns true if the asynchronous operation has completed.
-
-