Class AbstractMessageListenerContainer
java.lang.Object
com.azure.spring.messaging.listener.AbstractMessageListenerContainer
- All Implemented Interfaces:
MessageListenerContainer,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public abstract class AbstractMessageListenerContainer
extends Object
implements MessageListenerContainer, org.springframework.beans.factory.BeanNameAware
The base implementation for the
MessageListenerContainer.-
Field Summary
FieldsFields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voiddoStart()Prepare the underlying SDK processor client and start it for subscribing.protected abstract voiddoStop()Stop the underlying SDK processor client.Return the bean name.intgetPhase()booleanisActive()Whether this listener container has been started, no matter whether it is stopped later.booleanvoidsetBeanName(String beanName) voidstart()voidstop()voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.spring.messaging.listener.MessageListenerContainer
getContainerProperties, setupMessageListenerMethods inherited from interface org.springframework.context.SmartLifecycle
isAutoStartup
-
Field Details
-
lifecycleMonitor
Life cycle monitor.
-
-
Constructor Details
-
AbstractMessageListenerContainer
public AbstractMessageListenerContainer()
-
-
Method Details
-
doStart
protected abstract void doStart()Prepare the underlying SDK processor client and start it for subscribing. -
doStop
protected abstract void doStop()Stop the underlying SDK processor client. -
stop
- Specified by:
stopin 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
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
getBeanName
Return the bean name.- Returns:
- the bean name.
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
isActive
public boolean isActive()Whether this listener container has been started, no matter whether it is stopped later.- Returns:
- whether this container is active.
-