クラス RabbitListenerEndpointRegistry
java.lang.ObjectSE
org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistry
- 実装されたすべてのインターフェース:
EventListenerSE
、Aware
、DisposableBean
、ApplicationContextAware
、ApplicationListener<ContextRefreshedEvent>
、Lifecycle
、Phased
、SmartLifecycle
public class RabbitListenerEndpointRegistry
extends ObjectSE
implements DisposableBean, SmartLifecycle, ApplicationContextAware, ApplicationListener<ContextRefreshedEvent>
登録されたエンドポイントに必要な
MessageListenerContainer
インスタンスを作成します。また、特にアプリケーションコンテキストのライフサイクル内で、リスナーコンテナーのライフサイクルを管理します。 手動で作成された MessageListenerContainer
とは異なり、レジストリによって管理されるリスナーコンテナーは、アプリケーションコンテキストでは Bean ではなく、オートワイヤーの候補にもなりません。管理目的でこのレジストリのリスナーコンテナーにアクセスする必要がある場合は、getListenerContainers()
を使用します。特定のメッセージリスナーコンテナーにアクセスする必要がある場合は、エンドポイントの ID を指定して getListenerContainer(String)
を使用します。
- 導入:
- 1.4
- 作成者:
- Stephane Nicoll, Juergen Hoeller, Artem Bilan, Gary Russell
- 関連事項:
フィールドサマリー
フィールドインターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASE
コンストラクターのサマリー
コンストラクターメソッドのサマリー
修飾子と型メソッド説明protected MessageListenerContainer
createListenerContainer
(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) 指定されたファクトリを使用して、新しいMessageListenerContainer
を作成して開始します。void
destroy()
指定された ID を持つMessageListenerContainer
またはそのようなコンテナーが存在しない場合はnull
を返します。マネージドMessageListenerContainer
インスタンスの ID を返します。int
getPhase()
boolean
boolean
void
void
registerListenerContainer
(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) 指定されたRabbitListenerEndpoint
のメッセージリスナーコンテナーを作成します。void
registerListenerContainer
(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory, boolean startImmediately) 指定されたRabbitListenerEndpoint
のメッセージリスナーコンテナーを作成します。void
setApplicationContext
(ApplicationContext applicationContext) void
start()
void
stop()
void
stop
(RunnableSE callback) レジストリからリスナーコンテナーを削除します。クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.context.ApplicationListener から継承されたメソッド
supportsAsyncExecution
フィールドの詳細
logger
コンストラクターの詳細
RabbitListenerEndpointRegistry
public RabbitListenerEndpointRegistry()
メソッドの詳細
setApplicationContext
- 次で指定:
- インターフェース
ApplicationContextAware
のsetApplicationContext
- 例外:
BeansException
getListenerContainer
指定された ID を持つMessageListenerContainer
またはそのようなコンテナーが存在しない場合はnull
を返します。- パラメーター:
id
- コンテナーの ID- 戻り値:
- コンテナー、またはその ID のコンテナーが存在しない場合は
null
- 関連事項:
getListenerContainerIds
マネージドMessageListenerContainer
インスタンスの ID を返します。- 戻り値:
- ID。
- 導入:
- 1.5.2
- 関連事項:
getListenerContainers
- 戻り値:
- 管理対象の
MessageListenerContainer
インスタンス。
registerListenerContainer
public void registerListenerContainer(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) 指定されたRabbitListenerEndpoint
のメッセージリスナーコンテナーを作成します。これにより、構成に関してそのエンドポイントを尊重するために必要なインフラストラクチャが作成されます。
- パラメーター:
endpoint
- 追加するエンドポイントfactory
- 使用するリスナーファクトリ- 関連事項:
registerListenerContainer
public void registerListenerContainer(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory, boolean startImmediately) 指定されたRabbitListenerEndpoint
のメッセージリスナーコンテナーを作成します。これにより、構成に関してそのエンドポイントを尊重するために必要なインフラストラクチャが作成されます。
startImmediately
フラグは、コンテナーをすぐに開始する必要があるかどうかを決定します。- パラメーター:
endpoint
- 追加するエンドポイント。factory
- 使用するRabbitListenerContainerFactory
。startImmediately
- 必要に応じてすぐにコンテナーを開始します- 関連事項:
createListenerContainer
protected MessageListenerContainer createListenerContainer(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) 指定されたファクトリを使用して、新しいMessageListenerContainer
を作成して開始します。- パラメーター:
endpoint
-MessageListenerContainer
を作成するためのエンドポイント。factory
- 使用するRabbitListenerContainerFactory
。- 戻り値:
MessageListenerContainer
unregisterListenerContainer
レジストリからリスナーコンテナーを削除します。- パラメーター:
id
- コンテナー ID。- 戻り値:
- ID に一致する登録がない場合は null。
- 導入:
- 2.0.6
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean
のdestroy
getPhase
public int getPhase()- 次で指定:
- インターフェース
Phased
のgetPhase
- 次で指定:
- インターフェース
SmartLifecycle
のgetPhase
isAutoStartup
public boolean isAutoStartup()- 次で指定:
- インターフェース
SmartLifecycle
のisAutoStartup
start
public void start()stop
public void stop()stop
- 次で指定:
- インターフェース
SmartLifecycle
のstop
isRunning
public boolean isRunning()onApplicationEvent
- 次で指定:
- インターフェース
ApplicationListener<ContextRefreshedEvent>
のonApplicationEvent