public class UserRegistryMessageHandler extends ObjectSE implements MessageHandler, ApplicationListener<BrokerAvailabilityEvent>
MessageHandler
。 集約された情報は MultiServerUserRegistry
に保持されます。
コンストラクターと説明 |
---|
UserRegistryMessageHandler(MultiServerUserRegistry userRegistry, SimpMessagingTemplate brokerTemplate, StringSE broadcastDestination, TaskScheduler scheduler) コンストラクター。 |
修飾子と型 | メソッドと説明 |
---|---|
StringSE | getBroadcastDestination() UserRegistry 情報をブロードキャストするために構成された宛先を返します。 |
long | getRegistryExpirationPeriod() 構成されたレジストリの有効期限を返します。 |
void | handleMessage(Message<?> message) 指定されたメッセージを処理します。 |
void | onApplicationEvent(BrokerAvailabilityEvent event) アプリケーションイベントを処理します。 |
void | setRegistryExpirationPeriod(long milliseconds) リモートユーザーレジストリスナップショットが期限切れと見なされるまでの時間(ミリ秒単位)を構成します。 |
cloneSE, equalsSE, finalizeSE, getClassSE, hashCodeSE, notifySE, notifyAllSE, toStringSE, waitSE, waitSE, waitSE
public UserRegistryMessageHandler(MultiServerUserRegistry userRegistry, SimpMessagingTemplate brokerTemplate, StringSE broadcastDestination, TaskScheduler scheduler)
userRegistry
- ローカルおよびリモートユーザーレジストリ情報を含むレジストリ brokerTemplate
- ローカルレジストリ情報をブロードキャストするためのテンプレート broadcastDestination
- ブロードキャスト先 scheduler
- 使用するタスクスケジューラ public StringSE getBroadcastDestination()
public void setRegistryExpirationPeriod(long milliseconds)
デフォルトでは 20 秒に設定されています(20000 の値)。
milliseconds
- ミリ秒単位の有効期限 public long getRegistryExpirationPeriod()
public void onApplicationEvent(BrokerAvailabilityEvent event)
ApplicationListener
ApplicationListener<BrokerAvailabilityEvent>
の onApplicationEvent
event
- 応答するイベント public void handleMessage(Message<?> message) throws MessagingException
MessageHandler
MessageHandler
の handleMessage
message
- 処理するメッセージ MessagingException
- ハンドラーがメッセージの処理に失敗した場合