クラス 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 void
addSubscriptionInternal
(StringSE sessionId, StringSE subscriptionId, StringSE destination, Message<?> message) protected MultiValueMap<StringSE,
StringSE> findSubscriptionsInternal
(StringSE destination, Message<?> message) int
解決された宛先キャッシュの最大エントリ数を返します。設定されたPathMatcher
を返します。セレクターヘッダーの名前を返します。protected void
removeSubscriptionInternal
(StringSE sessionId, StringSE subscriptionId, Message<?> message) void
setCacheLimit
(int cacheLimit) 解決された宛先キャッシュの最大エントリ数を指定します。void
setPathMatcher
(PathMatcher pathMatcher) 使用するPathMatcher
を指定します。void
setSelectorHeaderName
(StringSE selectorHeaderName) サブスクリプションに一致するメッセージをフィルター処理するために、サブスクリプションメッセージに含めることができるヘッダーの名前を構成します。void
unregisterAllSubscriptions
(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)