クラス 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
ネストされたクラスの要約
クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたネストクラス / インターフェース
MessagingGatewaySupport.ConvertingMessagingTemplateインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたネストクラス / インターフェース
IntegrationManagement.ManagementOverridesフィールドのサマリー
クラス org.springframework.integration.http.inbound.BaseHttpInboundEndpoint から継承されたフィールド
activeCount, JAXB_PRESENT, NON_READABLE_BODY_HTTP_METHODS, ROME_TOOLS_PRESENTクラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたフィールド
messagingTemplateクラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたフィールド
lifecycleLockクラス org.springframework.integration.context.IntegrationObjectSupport から継承されたフィールド
EXPRESSION_PARSER, loggerインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたフィールド
METER_PREFIX, RECEIVE_COUNTER_NAME, SEND_TIMER_NAMEインターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明final voidhandleRequest(HttpServletRequestEE servletRequest, HttpServletResponseEE servletResponse) メッセージを生成してリクエストチャネルに送信することにより、HTTP リクエストを処理します。voidsetConvertExceptions(boolean convertExceptions) メッセージ処理例外の変換と書き込みを試行する必要があるかどうかを判断するためのフラグ(デフォルトは false、この場合、単に再スローされます)。クラス org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport から継承されたメソッド
doHandleRequest, extractRequestBody, getMessageConverters, onInit, prepareRequest, prepareRequestEntity, setMergeWithDefaultConverters, setMessageConverters, setMultipartResolver, setStatusCodeIfNeeded, setupResponseAndConvertReplyクラス org.springframework.integration.http.inbound.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クラス org.springframework.integration.gateway.MessagingGatewaySupport から継承されたメソッド
buildErrorMessage, buildSendTimer, destroy, doStart, doStop, getErrorChannel, getErrorMessageAttributes, getErrorMessageStrategy, getManagedName, getManagedType, getOverrides, getReplyChannel, getRequestChannel, 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クラス org.springframework.integration.endpoint.AbstractEndpoint から継承されたメソッド
doStop, getPhase, getRole, isActive, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, start, stop, stopクラス org.springframework.integration.context.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クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, wait, waitSE, waitSEインターフェース org.springframework.integration.support.management.IntegrationManagement から継承されたメソッド
getThisAsインターフェース org.springframework.integration.support.context.NamedComponent から継承されたメソッド
getBeanName, getComponentNameインターフェース org.springframework.context.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