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 void
doStart()
Prepare the underlying SDK processor client and start it for subscribing.protected abstract void
doStop()
Stop the underlying SDK processor client.Return the bean name.int
getPhase()
boolean
isActive()
Whether this listener container has been started, no matter whether it is stopped later.boolean
void
setBeanName
(String beanName) void
start()
void
stop()
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.azure.spring.messaging.listener.MessageListenerContainer
getContainerProperties, setupMessageListener
Methods 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:
stop
in interfaceorg.springframework.context.SmartLifecycle
-
start
public void start()- Specified by:
start
in interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stop
in interfaceorg.springframework.context.Lifecycle
-
isRunning
public boolean isRunning()- Specified by:
isRunning
in interfaceorg.springframework.context.Lifecycle
-
getBeanName
Return the bean name.- Returns:
- the bean name.
-
setBeanName
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
getPhase
public int getPhase()- Specified by:
getPhase
in interfaceorg.springframework.context.Phased
- Specified by:
getPhase
in 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.
-