public class ApplicationEventListeningMessageProducer extends ExpressionMessageProducerSupport implements org.springframework.context.event.SmartApplicationListener
ApplicationListener
and
passes Spring ApplicationEvents
within messages.
If a payloadExpression
is provided, it will be evaluated against
the ApplicationEvent instance to create the Message payload. Otherwise, the event itself will be the payload.ApplicationEventMulticaster
,
ExpressionMessageProducerSupport
logger
Constructor and Description |
---|
ApplicationEventListeningMessageProducer() |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart()
Takes no action by default.
|
protected void |
doStop()
Takes no action by default.
|
java.lang.String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
int |
getOrder() |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setEventTypes(java.lang.Class<? extends org.springframework.context.ApplicationEvent>... eventTypes)
Set the list of event types (classes that extend ApplicationEvent) that
this adapter should send to the message channel.
|
void |
setPhase(int phase) |
boolean |
supportsEventType(java.lang.Class<? extends org.springframework.context.ApplicationEvent> eventType) |
boolean |
supportsSourceType(java.lang.Class<?> sourceType) |
evaluatePayloadExpression, setIntegrationEvaluationContext, setPayloadExpression
sendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrack
getPhase, isAutoStartup, isRunning, setAutoStartup, setTaskScheduler, start, stop, stop
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public ApplicationEventListeningMessageProducer()
public void setEventTypes(java.lang.Class<? extends org.springframework.context.ApplicationEvent>... eventTypes)
ApplicationListener
with the ApplicationEventMulticaster
which clears the listener cache. The cache will be
refreshed on the next appropriate ApplicationEvent
.ApplicationEventMulticaster.addApplicationListener(org.springframework.context.ApplicationListener)
,
supportsEventType(java.lang.Class<? extends org.springframework.context.ApplicationEvent>)
public void setPhase(int phase)
setPhase
in class AbstractEndpoint
public java.lang.String getComponentType()
IntegrationObjectSupport
getComponentType
in interface NamedComponent
getComponentType
in class IntegrationObjectSupport
protected void onInit()
IntegrationObjectSupport
onInit
in class ExpressionMessageProducerSupport
public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>
public boolean supportsEventType(java.lang.Class<? extends org.springframework.context.ApplicationEvent> eventType)
supportsEventType
in interface org.springframework.context.event.SmartApplicationListener
public boolean supportsSourceType(java.lang.Class<?> sourceType)
supportsSourceType
in interface org.springframework.context.event.SmartApplicationListener
public int getOrder()
getOrder
in interface org.springframework.core.Ordered
protected void doStart()
MessageProducerSupport
doStart
in class MessageProducerSupport
protected void doStop()
MessageProducerSupport
doStop
in class MessageProducerSupport