public abstract class AbstractMessageBrokerConfiguration extends ObjectSE implements ApplicationContextAware
clientInboundChannel(org.springframework.core.task.TaskExecutor) および clientOutboundChannel(org.springframework.core.task.TaskExecutor) は、リモートクライアントとの間のメッセージを、次のようないくつかのメッセージハンドラーに配信します。
simpAnnotationMethodMessageHandler(org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.simp.SimpMessagingTemplate, org.springframework.messaging.converter.CompositeMessageConverter)simpleBrokerMessageHandler(org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.simp.user.UserDestinationResolver)stompBrokerRelayMessageHandler(org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.simp.user.UserDestinationMessageHandler, org.springframework.messaging.MessageHandler, org.springframework.messaging.simp.user.UserDestinationResolver)userDestinationMessageHandler(org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.simp.user.UserDestinationResolver)brokerChannel(org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.core.task.TaskExecutor) は、アプリケーション内からそれぞれのメッセージハンドラーにメッセージを配信します。brokerMessagingTemplate(org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.support.AbstractSubscribableChannel, org.springframework.messaging.converter.CompositeMessageConverter) は、メッセージを送信するために任意のアプリケーションコンポーネントに挿入できます。
サブクラスは、クライアントの受信 / 送信チャネル(WebSocket 上の STOMP など)との間でメッセージをフィードする構成の部分を担当します。
| 修飾子 | コンストラクターと説明 |
|---|---|
protected | AbstractMessageBrokerConfiguration()protected コンストラクター。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSEprotected AbstractMessageBrokerConfiguration()
public void setApplicationContext(@Nullable ApplicationContext applicationContext)
ApplicationContextAware 通常の Bean プロパティの設定後、ただし InitializingBean.afterPropertiesSet() またはカスタム init メソッドなどの init コールバックの前に呼び出されます。ResourceLoaderAware.setResourceLoader(org.springframework.core.io.ResourceLoader)、ApplicationEventPublisherAware.setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher) および MessageSourceAware の後に呼び出されます(該当する場合)。
ApplicationContextAware の setApplicationContext applicationContext - このオブジェクトによって使用される ApplicationContext オブジェクト BeanInitializationException@Nullable public ApplicationContext getApplicationContext()
@Bean public AbstractSubscribableChannel clientInboundChannel(@Qualifier(value="clientInboundChannelExecutor") TaskExecutor executor)
@Bean public TaskExecutor clientInboundChannelExecutor()
protected final ChannelRegistration getClientInboundChannelRegistration()
protected void configureClientInboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel clientOutboundChannel(@Qualifier(value="clientOutboundChannelExecutor") TaskExecutor executor)
@Bean public TaskExecutor clientOutboundChannelExecutor()
protected final ChannelRegistration getClientOutboundChannelRegistration()
protected void configureClientOutboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel brokerChannel(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, @Qualifier(value="brokerChannelExecutor") TaskExecutor executor)
@Bean public TaskExecutor brokerChannelExecutor(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel)
protected final MessageBrokerRegistry getBrokerRegistry(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel)
configureMessageBroker(MessageBrokerRegistry) による 1 回限りの作成と初期化を保証する MessageBrokerRegistry のアクセサー。protected void configureMessageBroker(MessageBrokerRegistry registry)
MessageBrokerRegistry インスタンスを介してメッセージブローカ構成をカスタマイズするためのサブクラスのフック。@Nullable public final PathMatcher getPathMatcher(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel)
@Bean public SimpAnnotationMethodMessageHandler simpAnnotationMethodMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpMessagingTemplate brokerMessagingTemplate, CompositeMessageConverter brokerMessageConverter)
protected SimpAnnotationMethodMessageHandler createAnnotationMethodMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpMessagingTemplate brokerMessagingTemplate)
SimpAnnotationMethodMessageHandler のカスタムサブクラスにプラグインするための protected メソッド。protected void addArgumentResolvers(ListSE<HandlerMethodArgumentResolver> argumentResolvers)
protected void addReturnValueHandlers(ListSE<HandlerMethodReturnValueHandler> returnValueHandlers)
@Bean @Nullable public AbstractBrokerMessageHandler simpleBrokerMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver)
@Bean @Nullable public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationMessageHandler userDestinationMessageHandler, @Nullable MessageHandler userRegistryMessageHandler, UserDestinationResolver userDestinationResolver)
@Bean public UserDestinationMessageHandler userDestinationMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, AbstractSubscribableChannel brokerChannel, UserDestinationResolver userDestinationResolver)
@Bean @Nullable public MessageHandler userRegistryMessageHandler(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, SimpUserRegistry userRegistry, SimpMessagingTemplate brokerMessagingTemplate, @Qualifier(value="messageBrokerTaskScheduler") TaskScheduler scheduler)
@Bean(name={"messageBrokerTaskScheduler","messageBrokerSockJsTaskScheduler"}) public TaskScheduler messageBrokerTaskScheduler()
@Bean public SimpMessagingTemplate brokerMessagingTemplate(AbstractSubscribableChannel brokerChannel, AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel, CompositeMessageConverter brokerMessageConverter)
@Bean public CompositeMessageConverter brokerMessageConverter()
protected MappingJackson2MessageConverter createJacksonConverter()
protected boolean configureMessageConverters(ListSE<MessageConverter> messageConverters)
messageConverters - コンバーターを追加するリスト、最初は空 true、コンバーターを追加しない場合は false @Bean public UserDestinationResolver userDestinationResolver(SimpUserRegistry userRegistry, AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel)
@Bean public SimpUserRegistry userRegistry(AbstractSubscribableChannel clientInboundChannel, AbstractSubscribableChannel clientOutboundChannel)
@DeprecatedSE @Nullable protected SimpUserRegistry createLocalUserRegistry()
createLocalUserRegistry(Integer) に変更 protected abstract SimpUserRegistry createLocalUserRegistry(@Nullable IntegerSE order)
order - SmartApplicationListener として使用する順序。protected Validator simpValidator()
@Payload メソッドの引数を検証するための Validator インスタンスを返します。順番に、このメソッドは Validator インスタンスを取得しようとします。
OptionalValidatorFactoryBean を作成する前に、JSR-303 実装の存在についてクラスパスを確認します