クラス HttpRequestHandlingMessagingGateway
java.lang.ObjectSE
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.endpoint.AbstractEndpoint
org.springframework.integration.gateway.MessagingGatewaySupport
org.springframework.integration.http.inbound.BaseHttpInboundEndpoint
org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport
org.springframework.integration.http.inbound.HttpRequestHandlingMessagingGateway
- 実装済みのインターフェース一覧:
Aware, BeanFactoryAware, BeanNameAware, DisposableBean, InitializingBean, ApplicationContextAware, Lifecycle, Phased, SmartLifecycle, ComponentSourceAware, ExpressionCapable, OrderlyShutdownCapable, IntegrationPattern, NamedComponent, IntegrationInboundManagement, IntegrationManagement, ManageableLifecycle, ManageableSmartLifecycle, TrackableComponent, HttpRequestHandler
public class HttpRequestHandlingMessagingGateway
extends HttpRequestHandlingEndpointSupport
implements HttpRequestHandler
HTTP リクエストを処理する受信メッセージングゲートウェイ。アプリケーションコンテキストで Bean として構成し、サーブレットと Bean の両方が同じ名前を持つ
web.xml の単純な HttpRequestHandlerServlet から委譲することができます。BaseHttpInboundEndpoint.isExpectReply() プロパティが true に設定されている場合、レスポンスメッセージからレスポンスを生成できます。それ以外の場合、ゲートウェイは、単純なステータスベースのレスポンス(200 OK など)で単方向チャネルアダプターのロールを果たします。 デフォルトでサポートされているリクエストメソッドは GET と POST ですが、値のリストは RequestMapping.getMethods() プロパティで構成できます。GET リクエスト(またはサポートされている場合は HEAD または OPTIONS)から生成されたペイロードは、パラメーター値を含む MultiValueMap になります。本文を含むリクエスト(POST など)の場合、ペイロードの型は BaseHttpInboundEndpoint.setRequestPayloadTypeClass(Class) リクエストペイロード型によって決定されます。}。
HTTP リクエストがマルチパートであり、コンテキストで "multipartResolver" Bean が定義されている場合、デフォルトのメッセージコンバーターが上書きされていない限り、MultipartAwareFormHttpMessageConverter によって変換されます (ただし、マルチパート対応コンバーターのカスタマイズされたインスタンスを提供することもオプションです)。
デフォルトでは、いくつかの HttpMessageConverter がすでに構成されています。リストは、HttpRequestHandlingEndpointSupport.setMessageConverters(List) メソッドを呼び出すことでオーバーライドできます。
- 導入:
- 2.0
- 作成者:
- Mark Fisher, Oleg Zhurakousky, Artem Bilan, Gary Russell
ネストされたクラスの概要
クラス MessagingGatewaySupport から継承されたネストクラス / インターフェース
MessagingGatewaySupport.ConvertingMessagingTemplateインターフェース IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールド概要
クラス BaseHttpInboundEndpoint から継承されたフィールド
activeCount, JAXB_PRESENT, NON_READABLE_BODY_HTTP_METHODS, ROME_TOOLS_PRESENTクラス MessagingGatewaySupport から継承されたフィールド
messagingTemplateクラス AbstractEndpoint から継承されたフィールド
lifecycleLockクラス IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明final voidhandleRequest(HttpServletRequestEE servletRequest, HttpServletResponseEE servletResponse) メッセージを生成してリクエストチャネルに送信することにより、HTTP リクエストを処理します。voidsetConvertExceptions(boolean convertExceptions) メッセージ処理例外の変換と書き込みを試行する必要があるかどうかを判断するためのフラグ(デフォルトは false、この場合、単に再スローされます)。クラス HttpRequestHandlingEndpointSupport から継承されたメソッド
doHandleRequest, extractRequestBody, getMessageConverters, onInit, prepareRequest, prepareRequestEntity, setMergeWithDefaultConverters, setMessageConverters, setMultipartResolver, setStatusCodeIfNeeded, setupResponseAndConvertReplyクラス BaseHttpInboundEndpoint から継承されたメソッド
afterShutdown, beforeShutdown, createEvaluationContext, evaluateHttpStatus, getComponentType, getCrossOrigin, getExtractReplyPayload, getHeaderExpressions, getHeaderMapper, getIntegrationPatternType, getPayloadExpression, getRequestMapping, getRequestPayloadType, getStatusCodeExpression, getValidator, isExpectReply, isReadable, resolveHttpStatusFromHeaders, setCrossOrigin, setExtractReplyPayload, setHeaderExpressions, setHeaderMapper, setPayloadExpression, setRequestMapping, setRequestPayloadType, setRequestPayloadTypeClass, setStatusCodeExpression, setStatusCodeExpressionString, setValidator, validateクラス MessagingGatewaySupport から継承されたメソッド
buildErrorMessage, buildSendTimer, destroy, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, getRequestChannelName, isLoggingEnabled, isObserved, receive, receive, receiveMessage, receiveMessage, registerMetricsCaptor, registerObservationRegistry, registerReplyMessageCorrelatorIfNecessary, send, sendAndReceive, sendAndReceiveMessage, sendAndReceiveMessageReactive, sendTimer, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setErrorOnTimeout, setLoggingEnabled, setManagedName, setManagedType, setObservationConvention, setReceiverObservationConvention, setReplyChannel, setReplyChannelName, setReplyMapper, setReplyTimeout, setRequestChannel, setRequestChannelName, setRequestMapper, setRequestTimeout, setShouldTrackクラス AbstractEndpoint から継承されたメソッド
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopクラス IntegrationObjectSupport から継承されたメソッド
afterPropertiesSet, extractTypeIfPossible, generateId, getApplicationContext, getApplicationContextId, getBeanDescription, getBeanFactory, getBeanName, getChannelResolver, getComponentDescription, getComponentName, getComponentSource, getConversionService, getExpression, getIntegrationProperties, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentDescription, setComponentName, setComponentSource, setConversionService, setMessageBuilderFactory, setPrimaryExpression, setTaskScheduler, toStringクラス ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース IntegrationManagement から継承されたメソッド
getThisAsインターフェース NamedComponent から継承されたメソッド
getBeanName, getComponentNameインターフェース SmartLifecycle から継承されたメソッド
isPauseable
コンストラクターの詳細
HttpRequestHandlingMessagingGateway
public HttpRequestHandlingMessagingGateway()HttpRequestHandlingMessagingGateway
public HttpRequestHandlingMessagingGateway(boolean expectReply)
方法の詳細
setConvertExceptions
public void setConvertExceptions(boolean convertExceptions) メッセージ処理例外の変換と書き込みを試行するかどうかを決定するフラグ(デフォルトは false、この場合、単に再スローされます)。フラグが true で、メッセージコンバーターが例外を変換できない場合、新しい例外がスローされます。- パラメーター:
convertExceptions- 設定するフラグ
handleRequest
public final void handleRequest(HttpServletRequestEE servletRequest, HttpServletResponseEE servletResponse) throws IOExceptionSE メッセージを生成し、それをリクエストチャネルに送信することで、HTTP リクエストを処理します。このゲートウェイの 'expectReply' プロパティが true の場合、受信するとレスポンスメッセージからレスポンスも生成されます。そのレスポンスは、HttpMessageConverterによって書き込まれます。- 次で指定:
- インターフェース
HttpRequestHandler内のhandleRequest - 例外:
IOExceptionSE