クラス AbstractMessageBrokerConfiguration
- 実装されているすべてのインターフェース:
Aware, ApplicationContextAware
- 既知の直属サブクラス
WebSocketMessageBrokerConfigurationSupport
clientInboundChannel(Executor) および clientOutboundChannel(Executor) は、リモートクライアントとの間のメッセージを、次のようないくつかのメッセージハンドラーに配信します。
simpAnnotationMethodMessageHandler(AbstractSubscribableChannel, AbstractSubscribableChannel, SimpMessagingTemplate, CompositeMessageConverter)simpleBrokerMessageHandler(AbstractSubscribableChannel, AbstractSubscribableChannel, AbstractSubscribableChannel, UserDestinationResolver)stompBrokerRelayMessageHandler(AbstractSubscribableChannel, AbstractSubscribableChannel, AbstractSubscribableChannel, UserDestinationMessageHandler, MessageHandler, UserDestinationResolver)userDestinationMessageHandler(AbstractSubscribableChannel, AbstractSubscribableChannel, AbstractSubscribableChannel, UserDestinationResolver)
brokerChannel(AbstractSubscribableChannel, AbstractSubscribableChannel, Executor) は、アプリケーション内からそれぞれのメッセージハンドラーにメッセージを配信します。brokerMessagingTemplate(AbstractSubscribableChannel, AbstractSubscribableChannel, AbstractSubscribableChannel, CompositeMessageConverter) は、メッセージを送信するために任意のアプリケーションコンポーネントに挿入できます。
サブクラスは、クライアントの受信 / 送信チャネル (たとえば、WebSocket 経由の STOMP) との間でメッセージをやり取りする構成の部分を担当します。
- 導入:
- 4.0
- 作成者:
- Rossen Stoyanchev, Brian Clozel, Sebastien Deleuze
コンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected voidaddArgumentResolvers(ListSE<HandlerMethodArgumentResolver> argumentResolvers) protected voidaddReturnValueHandlers(ListSE<HandlerMethodReturnValueHandler> returnValueHandlers) brokerChannel(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, ExecutorSE executor) brokerChannelExecutor(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) brokerMessagingTemplate(AbstractSubscribableChannel brokerChannel, AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, CompositeMessageConverter brokerMessageConverter) clientInboundChannel(ExecutorSE executor) clientOutboundChannel(ExecutorSE executor) protected voidconfigureClientInboundChannel(ChannelRegistration registration) WebSocket クライアントからの受信メッセージのメッセージチャネルをカスタマイズするためのサブクラスのフック。protected voidconfigureClientOutboundChannel(ChannelRegistration registration) アプリケーションまたはメッセージブローカーから WebSocket クライアントへのメッセージのメッセージチャネルをカスタマイズするためのサブクラスのフック。protected voidconfigureMessageBroker(MessageBrokerRegistry registry) 提供されたMessageBrokerRegistryインスタンスを介してメッセージブローカ構成をカスタマイズするためのサブクラスのフック。protected booleanconfigureMessageConverters(ListSE<MessageConverter> messageConverters) このメソッドをオーバーライドして、カスタムメッセージコンバーターを追加します。protected SimpAnnotationMethodMessageHandlercreateAnnotationMethodMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpMessagingTemplate brokerMessagingTemplate) SimpAnnotationMethodMessageHandlerのカスタムサブクラスにプラグインするための protected メソッド。protected MappingJackson2MessageConverterJackson 2.x JSON コンバーターをカスタマイズできるようにします。protected JacksonJsonMessageConverterJackson 3.x JSON コンバーターをカスタマイズできるようにします。protected abstract SimpUserRegistryローカルユーザーへのアクセスを提供するユーザーレジストリを作成します。protected final MessageBrokerRegistrygetBrokerRegistry(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) configureMessageBroker(MessageBrokerRegistry)による 1 回限りの作成と初期化を保証するMessageBrokerRegistryのアクセサー。protected final ChannelRegistrationprotected final ChannelRegistrationfinal @Nullable PathMatchergetPathMatcher(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) 他の構成クラスからのアクセスのために、構成された PatchMatcher へのアクセスを提供します。protected final intgetPhase()このメソッドをオーバーライドして、カスタムValidatorを提供します。protected intvoidsetApplicationContext(@Nullable ApplicationContext applicationContext) このオブジェクトが実行される ApplicationContext を設定します。simpAnnotationMethodMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpMessagingTemplate brokerMessagingTemplate, CompositeMessageConverter brokerMessageConverter) simpleBrokerMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver) protected Validator@Payloadメソッドの引数を検証するためのValidatorインスタンスを返します。stompBrokerRelayMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationMessageHandler userDestinationMessageHandler, @Nullable MessageHandler userRegistryMessageHandler, UserDestinationResolver userDestinationResolver) userDestinationMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver) userDestinationResolver(SimpUserRegistry userRegistry, AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) userRegistry(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) userRegistryMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpUserRegistry userRegistry, SimpMessagingTemplate brokerMessagingTemplate, TaskScheduler scheduler)
コンストラクターの詳細
AbstractMessageBrokerConfiguration
protected AbstractMessageBrokerConfiguration()protected コンストラクター。
メソッドの詳細
setApplicationContext
インターフェースからコピーされた説明:ApplicationContextAwareこのオブジェクトが実行される ApplicationContext を設定します。通常、この呼び出しはオブジェクトの初期化に使用されます。通常の Bean プロパティの設定後、ただし
InitializingBean.afterPropertiesSet()またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(ResourceLoader)、ApplicationEventPublisherAware.setApplicationEventPublisher(ApplicationEventPublisher)およびMessageSourceAwareの後に呼び出されます(該当する場合)。- 次で指定:
- インターフェース
ApplicationContextAwareのsetApplicationContext - パラメーター:
applicationContext- このオブジェクトによって使用される ApplicationContext オブジェクト- 関連事項:
getApplicationContext
clientInboundChannel
@Bean public AbstractSubscribableChannel clientInboundChannel(@Qualifier("clientInboundChannelExecutor") ExecutorSE executor) clientInboundChannelExecutor
getClientInboundChannelRegistration
getPhase
protected final int getPhase()initPhase
protected int initPhase()configureClientInboundChannel
WebSocket クライアントからの受信メッセージのメッセージチャネルをカスタマイズするためのサブクラスのフック。clientOutboundChannel
@Bean public AbstractSubscribableChannel clientOutboundChannel(@Qualifier("clientOutboundChannelExecutor") ExecutorSE executor) clientOutboundChannelExecutor
getClientOutboundChannelRegistration
configureClientOutboundChannel
アプリケーションまたはメッセージブローカーから WebSocket クライアントへのメッセージのメッセージチャネルをカスタマイズするためのサブクラスのフック。brokerChannel
@Bean public AbstractSubscribableChannel brokerChannel(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, @Qualifier("brokerChannelExecutor") ExecutorSE executor) brokerChannelExecutor
@Bean public ExecutorSE brokerChannelExecutor(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) getBrokerRegistry
protected final MessageBrokerRegistry getBrokerRegistry(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) configureMessageBroker(MessageBrokerRegistry)による 1 回限りの作成と初期化を保証するMessageBrokerRegistryのアクセサー。configureMessageBroker
提供されたMessageBrokerRegistryインスタンスを介してメッセージブローカ構成をカスタマイズするためのサブクラスのフック。getPathMatcher
public final @Nullable PathMatcher getPathMatcher(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) 他の構成クラスからのアクセスのために、構成された PatchMatcher へのアクセスを提供します。simpAnnotationMethodMessageHandler
@Bean public SimpAnnotationMethodMessageHandler simpAnnotationMethodMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpMessagingTemplate brokerMessagingTemplate, CompositeMessageConverter brokerMessageConverter) createAnnotationMethodMessageHandler
protected SimpAnnotationMethodMessageHandler createAnnotationMethodMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpMessagingTemplate brokerMessagingTemplate) SimpAnnotationMethodMessageHandlerのカスタムサブクラスにプラグインするための protected メソッド。- 導入:
- 5.3.2
addArgumentResolvers
addReturnValueHandlers
simpleBrokerMessageHandler
@Bean public @Nullable AbstractBrokerMessageHandler simpleBrokerMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver) stompBrokerRelayMessageHandler
@Bean public @Nullable AbstractBrokerMessageHandler stompBrokerRelayMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationMessageHandler userDestinationMessageHandler, @Nullable MessageHandler userRegistryMessageHandler, UserDestinationResolver userDestinationResolver) userDestinationMessageHandler
@Bean public UserDestinationMessageHandler userDestinationMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver) userRegistryMessageHandler
@Bean public @Nullable MessageHandler userRegistryMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpUserRegistry userRegistry, SimpMessagingTemplate brokerMessagingTemplate, @Qualifier("messageBrokerTaskScheduler") TaskScheduler scheduler) messageBrokerTaskScheduler
@Bean(name={"messageBrokerTaskScheduler","messageBrokerSockJsTaskScheduler"}) public TaskScheduler messageBrokerTaskScheduler()brokerMessagingTemplate
@Bean public SimpMessagingTemplate brokerMessagingTemplate(AbstractSubscribableChannel brokerChannel, AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, CompositeMessageConverter brokerMessageConverter) brokerMessageConverter
createJacksonJsonConverter
Jackson 3.x JSON コンバーターをカスタマイズできるようにします。createJacksonConverter
Jackson 2.x JSON コンバーターをカスタマイズできるようにします。configureMessageConverters
このメソッドをオーバーライドして、カスタムメッセージコンバーターを追加します。- パラメーター:
messageConverters- コンバーターを追加するリスト、最初は空- 戻り値:
- デフォルトのメッセージコンバーターをリストに追加する場合は
true、コンバーターを追加しない場合はfalse
userDestinationResolver
@Bean public UserDestinationResolver userDestinationResolver(SimpUserRegistry userRegistry, AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) userRegistry
@Bean public SimpUserRegistry userRegistry(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel) createLocalUserRegistry
ローカルユーザーへのアクセスを提供するユーザーレジストリを作成します。- パラメーター:
order-SmartApplicationListenerとして使用する順序。- 導入:
- 5.1
simpValidator
@Payloadメソッドの引数を検証するためのValidatorインスタンスを返します。順番に、このメソッドは Validator インスタンスを取得しようとします。
- 最初に getValidator() に委譲する
- 何も返されない場合は、MVC 構成によって作成された、よく知られている名前 "mvcValidator" を持つ既存のインスタンスを取得します。
- 何も返されない場合は、
OptionalValidatorFactoryBeanを作成する前に、JSR-303 実装の存在についてクラスパスを確認します - 何もしない Validator インスタンスを返す
getValidator