Class GenericReaderEndpointRegistry<C extends PulsarMessageReaderContainer,E extends PulsarReaderEndpoint<C>>
java.lang.Object
org.springframework.pulsar.config.GenericReaderEndpointRegistry<C,E>
- Type Parameters:
C- container typeE- endpoint type
- All Implemented Interfaces:
EventListener,org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,PulsarReaderContainerRegistry
- Direct Known Subclasses:
PulsarReaderEndpointRegistry
public class GenericReaderEndpointRegistry<C extends PulsarMessageReaderContainer,E extends PulsarReaderEndpoint<C>>
extends Object
implements PulsarReaderContainerRegistry, org.springframework.beans.factory.DisposableBean, org.springframework.context.SmartLifecycle, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
Creates the necessary container instances for the registered
endpoints. Also manages the lifecycle of the reader
containers, in particular within the lifecycle of the application context.
Contrary to containers created manually, reader listener containers managed by registry
are not beans in the application context and are not candidates for autowiring. Use
getReaderContainers() ()} if you need to access this registry's reader
listener containers for management purposes. If you need to access to a specific reader
listener container, use getReaderContainer(String) with the id of the
endpoint.
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CcreateReaderContainer(E endpoint, ReaderContainerFactory<? extends C, E> factory) voiddestroy()intgetPhase()booleanbooleanvoidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) voidregisterReaderContainer(E endpoint, ReaderContainerFactory<? extends C, E> factory) voidregisterReaderContainer(E endpoint, ReaderContainerFactory<? extends C, E> factory, boolean startImmediately) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) voidstart()voidstop()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
GenericReaderEndpointRegistry
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getReaderContainer
- Specified by:
getReaderContainerin interfacePulsarReaderContainerRegistry
-
getReaderContainerIds
- Specified by:
getReaderContainerIdsin interfacePulsarReaderContainerRegistry
-
getReaderContainers
- Specified by:
getReaderContainersin interfacePulsarReaderContainerRegistry
-
getAllReaderContainers
- Specified by:
getAllReaderContainersin interfacePulsarReaderContainerRegistry
-
registerReaderContainer
-
registerReaderContainer
public void registerReaderContainer(E endpoint, ReaderContainerFactory<? extends C, E> factory, boolean startImmediately) -
createReaderContainer
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
onApplicationEvent
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<C extends PulsarMessageReaderContainer>
-