Class PulsarListenerAnnotationBeanPostProcessor<V>
java.lang.Object
org.springframework.pulsar.annotation.PulsarListenerAnnotationBeanPostProcessor<V>
- Type Parameters:
V- the payload type.
- All Implemented Interfaces:
Aware,BeanPostProcessor,InitializingBean,SmartInitializingSingleton,ApplicationContextAware,Ordered
public class PulsarListenerAnnotationBeanPostProcessor<V>
extends Object
implements BeanPostProcessor, Ordered, ApplicationContextAware, InitializingBean, SmartInitializingSingleton
Bean post-processor that registers methods annotated with
PulsarListener to be
invoked by a Pulsar message listener container created under the covers by a
PulsarListenerContainerFactory according to the parameters of the annotation.
Annotated methods can use flexible arguments as defined by PulsarListener.
This post-processor is automatically registered by the EnablePulsar annotation.
Auto-detect any PulsarListenerConfigurer instances in the container, allowing
for customization of the registry to be used, the default container factory or for
fine-grained control over endpoints registration. See EnablePulsar Javadoc for
complete usage details.
- Author:
- Soby Chacko, Chris Bono, Alexander Preuß
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe bean name of the defaultPulsarListenerContainerFactory.Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidprotected voidintgetOrder()protected StringnoBeanFoundMessage(Object target, String listenerBeanName, String requestedBeanName, Class<?> expectedClass) postProcessAfterInitialization(Object bean, String beanName) postProcessBeforeInitialization(Object bean, String beanName) protected voidprocessListener(MethodPulsarListenerEndpoint<?> endpoint, PulsarListener PulsarListener, Object bean, String beanName, String[] topics, String topicPattern) protected voidprocessPulsarListener(PulsarListener pulsarListener, Method method, Object bean, String beanName) voidsetApplicationContext(ApplicationContext applicationContext) voidsetBeanFactory(BeanFactory beanFactory)
-
Field Details
-
DEFAULT_PULSAR_LISTENER_CONTAINER_FACTORY_BEAN_NAME
The bean name of the defaultPulsarListenerContainerFactory.- See Also:
-
-
Constructor Details
-
PulsarListenerAnnotationBeanPostProcessor
public PulsarListenerAnnotationBeanPostProcessor()
-
-
Method Details
-
getOrder
public int getOrder() -
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceInitializingBean
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated()- Specified by:
afterSingletonsInstantiatedin interfaceSmartInitializingSingleton
-
postProcessBeforeInitialization
- Specified by:
postProcessBeforeInitializationin interfaceBeanPostProcessor- Throws:
BeansException
-
postProcessAfterInitialization
- Specified by:
postProcessAfterInitializationin interfaceBeanPostProcessor- Throws:
BeansException
-
processPulsarListener
protected void processPulsarListener(PulsarListener pulsarListener, Method method, Object bean, String beanName) -
processListener
protected void processListener(MethodPulsarListenerEndpoint<?> endpoint, PulsarListener PulsarListener, Object bean, String beanName, String[] topics, String topicPattern) -
assertBeanFactory
protected void assertBeanFactory() -
noBeanFoundMessage
-
setApplicationContext
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-
setBeanFactory
-