public abstract class AbstractMessageBrokerConfiguration extends ObjectSE implements ApplicationContextAware
clientInboundChannel()
および clientOutboundChannel()
は、リモートクライアントとの間のメッセージを、次のようないくつかのメッセージハンドラーに配信します。
simpAnnotationMethodMessageHandler()
simpleBrokerMessageHandler()
stompBrokerRelayMessageHandler()
userDestinationMessageHandler()
brokerChannel()
は、アプリケーション内からそれぞれのメッセージハンドラーにメッセージを配信します。brokerMessagingTemplate()
は、任意のアプリケーションコンポーネントに挿入してメッセージを送信できます。
サブクラスは、クライアントの受信 / 送信チャネル(WebSocket 上の STOMP など)との間でメッセージをフィードする構成の部分を担当します。
修飾子 | コンストラクターと説明 |
---|---|
protected | AbstractMessageBrokerConfiguration() protected コンストラクター。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
protected 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()
@Bean public ThreadPoolTaskExecutor clientInboundChannelExecutor()
protected final ChannelRegistration getClientInboundChannelRegistration()
protected void configureClientInboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel clientOutboundChannel()
@Bean public ThreadPoolTaskExecutor clientOutboundChannelExecutor()
protected final ChannelRegistration getClientOutboundChannelRegistration()
protected void configureClientOutboundChannel(ChannelRegistration registration)
@Bean public AbstractSubscribableChannel brokerChannel()
@Bean public ThreadPoolTaskExecutor brokerChannelExecutor()
protected final MessageBrokerRegistry getBrokerRegistry()
configureMessageBroker(MessageBrokerRegistry)
による 1 回限りの作成と初期化を保証する MessageBrokerRegistry
のアクセサー。protected void configureMessageBroker(MessageBrokerRegistry registry)
MessageBrokerRegistry
インスタンスを介してメッセージブローカ構成をカスタマイズするためのサブクラスのフック。@Nullable public final PathMatcher getPathMatcher()
@Bean public SimpAnnotationMethodMessageHandler simpAnnotationMethodMessageHandler()
protected SimpAnnotationMethodMessageHandler createAnnotationMethodMessageHandler()
SimpAnnotationMethodMessageHandler
のカスタムサブクラスにプラグインするための protected メソッド。protected void addArgumentResolvers(ListSE<HandlerMethodArgumentResolver> argumentResolvers)
protected void addReturnValueHandlers(ListSE<HandlerMethodReturnValueHandler> returnValueHandlers)
@Bean @Nullable public AbstractBrokerMessageHandler simpleBrokerMessageHandler()
@Bean @Nullable public AbstractBrokerMessageHandler stompBrokerRelayMessageHandler()
@Bean public UserDestinationMessageHandler userDestinationMessageHandler()
@Bean @Nullable public MessageHandler userRegistryMessageHandler()
@Bean(name={"messageBrokerTaskScheduler","messageBrokerSockJsTaskScheduler"}) public ThreadPoolTaskScheduler messageBrokerTaskScheduler()
@Bean public SimpMessagingTemplate brokerMessagingTemplate()
@Bean public CompositeMessageConverter brokerMessageConverter()
protected MappingJackson2MessageConverter createJacksonConverter()
protected boolean configureMessageConverters(ListSE<MessageConverter> messageConverters)
messageConverters
- コンバーターを追加するリスト、最初は空 true
、コンバーターを追加しない場合は false
@Bean public UserDestinationResolver userDestinationResolver()
@Bean public SimpUserRegistry userRegistry()
@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 実装の存在についてクラスパスを確認します