Document Reactive Method security requires Publisher return types

Fixes: gh-4988
This commit is contained in:
Rob Winch
2018-02-07 16:31:41 -06:00
parent ea3dd336aa
commit 964a14b224
5 changed files with 26 additions and 0 deletions

View File

@@ -64,6 +64,9 @@ public class PrePostAdviceReactiveMethodInterceptor implements MethodInterceptor
throws Throwable {
Method method = invocation.getMethod();
Class<?> returnType = method.getReturnType();
if (!Publisher.class.isAssignableFrom(returnType)) {
throw new IllegalStateException("The returnType " + returnType + " on " + method + " must return an instance of org.reactivestreams.Publisher (i.e. Mono / Flux) in order to support Reactor Context");
}
Class<?> targetClass = invocation.getThis().getClass();
Collection<ConfigAttribute> attributes = this.attributeSource
.getAttributes(method, targetClass);