class ProducerOperationFilter implements Filter {

  @Override
  public CompletableFuture<Response> onFilter(Invocation invocation, FilterNode nextNode) {
    invocation.onBusinessMethodStart();

    SwaggerProducerOperation producerOperation = invocation.getOperationMeta().getSwaggerProducerOperation();
    Object instance = producerOperation.getProducerInstance();
    Method method = producerOperation.getProducerMethod();
    Object[] args = invocation.toProducerArguments();
    return invoke(invocation, instance, method, args)
        .thenApply(result -> convertResultToResponse(invocation, producerOperation, result))
        .whenComplete((response, throwable) -> whenComplete(invocation, throwable));
  }

}