public class HandlerMethodReturnValueHandlerComposite extends ObjectSE implements AsyncHandlerMethodReturnValueHandler
修飾子と型 | フィールドと説明 |
---|---|
static Log | defaultLogger フォールバックロガーでラップするためのパブリック。 |
コンストラクターと説明 |
---|
HandlerMethodReturnValueHandlerComposite() |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public static final Log defaultLogger
public HandlerMethodReturnValueHandlerComposite()
public void setLogger(Log logger)
logger
- 使用するロガー public Log getLogger()
public ListSE<HandlerMethodReturnValueHandler> getReturnValueHandlers()
public void clear()
public HandlerMethodReturnValueHandlerComposite addHandler(HandlerMethodReturnValueHandler returnValueHandler)
HandlerMethodReturnValueHandler
を追加します。public HandlerMethodReturnValueHandlerComposite addHandlers(@Nullable ListSE<? extends HandlerMethodReturnValueHandler> handlers)
HandlerMethodReturnValueHandlers
を追加します。public boolean supportsReturnType(MethodParameter returnType)
HandlerMethodReturnValueHandler
HandlerMethodReturnValueHandler
の supportsReturnType
returnType
- チェックするメソッドの戻り値の型 true
。それ以外の場合は false
public void handleReturnValue(@Nullable ObjectSE returnValue, MethodParameter returnType, Message<?> message) throws ExceptionSE
HandlerMethodReturnValueHandler
HandlerMethodReturnValueHandler
の handleReturnValue
returnValue
- ハンドラーメソッドから返された値 returnType
- 戻り値の型。この型は以前に HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
に渡されていて、true
を返している必要があります。message
- このメソッドが呼び出される原因となったメッセージ ExceptionSE
- 戻り値の処理がエラーになる場合 public boolean isAsyncReturnValue(ObjectSE returnValue, MethodParameter returnType)
AsyncHandlerMethodReturnValueHandler
true
を返す場合、次に AsyncHandlerMethodReturnValueHandler.toListenableFuture(java.lang.Object, org.springframework.core.MethodParameter)
が呼び出されます。false
を返す場合、HandlerMethodReturnValueHandler.handleReturnValue(java.lang.Object, org.springframework.core.MethodParameter, org.springframework.messaging.Message<?>)
が呼び出されます。 注意 : このメソッドは、HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
が呼び出され、true
が返された後にのみ呼び出されます。
AsyncHandlerMethodReturnValueHandler
の isAsyncReturnValue
returnValue
- ハンドラーメソッドから返された値 returnType
- 戻り値の型 true
@Nullable public ListenableFuture<?> toListenableFuture(ObjectSE returnValue, MethodParameter returnType)
AsyncHandlerMethodReturnValueHandler
ListenableFuture
に適合させます。実装では、SettableListenableFuture
のインスタンスを返すことを検討する必要があります。その後、ListenableFuture が成功またはエラーで完了すると、戻り値の処理が続行されます。 注意 : このメソッドは、HandlerMethodReturnValueHandler.supportsReturnType(org.springframework.core.MethodParameter)
が呼び出され、true
が返された後にのみ呼び出されます。
AsyncHandlerMethodReturnValueHandler
の toListenableFuture
returnValue
- ハンドラーメソッドから返された値 returnType
- 戻り値の型 null
。この場合、それ以上の処理は実行されません。