クラス DefaultSubscriptionRegistry
java.lang.ObjectSE
org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry
org.springframework.messaging.simp.broker.DefaultSubscriptionRegistry
- 実装されているすべてのインターフェース:
SubscriptionRegistry
サブスクリプションをメモリに格納し、一致する宛先に
PathMatcher を使用する SubscriptionRegistry の実装。このクラスは、宛先一致に加えてメッセージをフィルターで除外するためにヘッダーに対して評価される Spring Expression Language (SpEL) 式を使用したサブスクリプションメッセージのオプションのセレクターヘッダーもサポートします。Spring Framework 6.1 では、SpEL サポートはデフォルトで無効になっていますが、セレクターヘッダー名を設定することで有効にできます。
- 導入:
- 4.0
- 作成者:
- Rossen Stoyanchev, Sebastien Deleuze, Juergen Hoeller, Sam Brannen
フィールドのサマリー
フィールドクラス org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry から継承されたフィールド
loggerコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected voidaddSubscriptionInternal(StringSE sessionId, StringSE subscriptionId, StringSE destination, Message<?> message) protected MultiValueMap<StringSE,StringSE> findSubscriptionsInternal(StringSE destination, Message<?> message) int解決された宛先キャッシュの最大エントリ数を返します。設定されたPathMatcherを返します。セレクターヘッダーの名前を返します。protected voidremoveSubscriptionInternal(StringSE sessionId, StringSE subscriptionId, Message<?> message) voidsetCacheLimit(int cacheLimit) 解決された宛先キャッシュの最大エントリ数を指定します。voidsetPathMatcher(PathMatcher pathMatcher) 使用するPathMatcherを指定します。voidsetSelectorHeaderName(StringSE selectorHeaderName) サブスクリプションに一致するメッセージをフィルター処理するために、サブスクリプションメッセージに含めることができるヘッダーの名前を構成します。voidunregisterAllSubscriptions(StringSE sessionId) 指定された sessionId に関連付けられているすべてのサブスクリプションを削除します。クラス org.springframework.messaging.simp.broker.AbstractSubscriptionRegistry から継承されたメソッド
findSubscriptions, registerSubscription, unregisterSubscription
フィールドの詳細
DEFAULT_CACHE_LIMIT
public static final int DEFAULT_CACHE_LIMIT宛先キャッシュのデフォルトの最大エントリ数: 1024。- 関連事項:
コンストラクターの詳細
DefaultSubscriptionRegistry
public DefaultSubscriptionRegistry()
メソッドの詳細
setPathMatcher
使用するPathMatcherを指定します。getPathMatcher
設定されたPathMatcherを返します。setCacheLimit
public void setCacheLimit(int cacheLimit) 解決された宛先キャッシュの最大エントリ数を指定します。デフォルトは 1024 です。getCacheLimit
public int getCacheLimit()解決された宛先キャッシュの最大エントリ数を返します。setSelectorHeaderName
サブスクリプションに一致するメッセージをフィルター処理するために、サブスクリプションメッセージに含めることができるヘッダーの名前を構成します。ヘッダー値は、サブスクリプションに一致するメッセージのヘッダーに適用される Spring Expression Language (SpEL) ブール式であることが想定されます。
例:
headers.foo == 'bar'
デフォルトでは、セレクターヘッダー名は
nullに設定されており、この機能は無効になっています。これを"selector"または別の名前に設定して、セレクターヘッダーのサポートを有効にすることができます。- パラメーター:
selectorHeaderName- セレクターヘッダーに使用する名前、またはセレクターヘッダーのサポートを無効にする場合はnullまたは空白- 導入:
- 4.2
getSelectorHeaderName
セレクターヘッダーの名前を返します。- 導入:
- 4.2
- 関連事項:
addSubscriptionInternal
protected void addSubscriptionInternal(StringSE sessionId, StringSE subscriptionId, StringSE destination, Message<?> message) - 次で指定:
- クラス
AbstractSubscriptionRegistryのaddSubscriptionInternal
removeSubscriptionInternal
unregisterAllSubscriptions
インターフェースからコピーされた説明:SubscriptionRegistry指定された sessionId に関連付けられているすべてのサブスクリプションを削除します。findSubscriptionsInternal
protected MultiValueMap<StringSE,StringSE> findSubscriptionsInternal(StringSE destination, Message<?> message)