|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* Copyright 2002-2023 the original author or authors. |
|
|
|
* Copyright 2002-2024 the original author or authors. |
|
|
|
* |
|
|
|
* |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License"); |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
* you may not use this file except in compliance with the License. |
|
|
|
@ -200,7 +200,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod { |
|
|
|
* actually invoking the controller method. This is useful when processing |
|
|
|
* actually invoking the controller method. This is useful when processing |
|
|
|
* async return values (e.g. Callable, DeferredResult, ListenableFuture). |
|
|
|
* async return values (e.g. Callable, DeferredResult, ListenableFuture). |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
ServletInvocableHandlerMethod wrapConcurrentResult(Object result) { |
|
|
|
ServletInvocableHandlerMethod wrapConcurrentResult(@Nullable Object result) { |
|
|
|
return new ConcurrentResultHandlerMethod(result, new ConcurrentResultMethodParameter(result)); |
|
|
|
return new ConcurrentResultHandlerMethod(result, new ConcurrentResultMethodParameter(result)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -215,7 +215,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod { |
|
|
|
|
|
|
|
|
|
|
|
private final MethodParameter returnType; |
|
|
|
private final MethodParameter returnType; |
|
|
|
|
|
|
|
|
|
|
|
public ConcurrentResultHandlerMethod(final Object result, ConcurrentResultMethodParameter returnType) { |
|
|
|
public ConcurrentResultHandlerMethod(@Nullable Object result, ConcurrentResultMethodParameter returnType) { |
|
|
|
super((Callable<Object>) () -> { |
|
|
|
super((Callable<Object>) () -> { |
|
|
|
if (result instanceof Exception exception) { |
|
|
|
if (result instanceof Exception exception) { |
|
|
|
throw exception; |
|
|
|
throw exception; |
|
|
|
@ -279,7 +279,7 @@ public class ServletInvocableHandlerMethod extends InvocableHandlerMethod { |
|
|
|
|
|
|
|
|
|
|
|
private final ResolvableType returnType; |
|
|
|
private final ResolvableType returnType; |
|
|
|
|
|
|
|
|
|
|
|
public ConcurrentResultMethodParameter(Object returnValue) { |
|
|
|
public ConcurrentResultMethodParameter(@Nullable Object returnValue) { |
|
|
|
super(-1); |
|
|
|
super(-1); |
|
|
|
this.returnValue = returnValue; |
|
|
|
this.returnValue = returnValue; |
|
|
|
this.returnType = (returnValue instanceof CollectedValuesList cvList ? |
|
|
|
this.returnType = (returnValue instanceof CollectedValuesList cvList ? |
|
|
|
|