Class HttpComponentHttpRequestTaskAbortStrategy

java.lang.Object
org.hawaiiframework.async.http.HttpComponentHttpRequestTaskAbortStrategy
All Implemented Interfaces:
TaskAbortStrategy

public class HttpComponentHttpRequestTaskAbortStrategy extends Object implements TaskAbortStrategy
Strategy to abort and Http Components HTTP request.

These requests are used by (for instance) Spring's RestTemplate.

Since:
2.0.0
  • Constructor Details

    • HttpComponentHttpRequestTaskAbortStrategy

      public HttpComponentHttpRequestTaskAbortStrategy(@NonNull org.apache.hc.client5.http.classic.methods.HttpUriRequest request)
      Construct a new instance with the request we may have to abort.
      Parameters:
      request - The request about to be executed (which we have to guard).
  • Method Details

    • invoke

      public boolean invoke()
      Description copied from interface: TaskAbortStrategy
      Invoke the strategy in order to abort the task (that registered this abort strategy).
      Specified by:
      invoke in interface TaskAbortStrategy
      Returns:
      true if the task has been aborted.