public class ApplicationEventListeningMessageProducer
extends org.springframework.integration.endpoint.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
Constructor and Description |
---|
ApplicationEventListeningMessageProducer() |
Modifier and Type | Method and Description |
---|---|
protected void |
doStart() |
protected void |
doStop() |
java.lang.String |
getComponentType() |
int |
getOrder() |
void |
onApplicationEvent(org.springframework.context.ApplicationEvent event) |
protected void |
onInit() |
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.
|
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
doStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
afterPropertiesSet, getApplicationContext, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setMessageBuilderFactory, toString
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
.eventTypes
- The event types.ApplicationEventMulticaster.addApplicationListener(org.springframework.context.ApplicationListener<?>)
,
supportsEventType(java.lang.Class<? extends org.springframework.context.ApplicationEvent>)
public java.lang.String getComponentType()
getComponentType
in interface org.springframework.integration.support.context.NamedComponent
getComponentType
in class org.springframework.integration.context.IntegrationObjectSupport
protected void onInit()
onInit
in class org.springframework.integration.endpoint.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()
doStart
in class org.springframework.integration.endpoint.MessageProducerSupport
protected void doStop()
doStop
in class org.springframework.integration.endpoint.MessageProducerSupport