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,
ExpressionMessageProducerSupportlogger| 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, setPayloadExpressionsendMessage, setErrorChannel, setOutputChannel, setSendTimeout, setShouldTrackgetPhase, isAutoStartup, isRunning, setAutoStartup, setTaskScheduler, start, stop, stopafterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic 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 AbstractEndpointpublic java.lang.String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class IntegrationObjectSupportprotected void onInit()
IntegrationObjectSupportonInit in class ExpressionMessageProducerSupportpublic 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.SmartApplicationListenerpublic boolean supportsSourceType(java.lang.Class<?> sourceType)
supportsSourceType in interface org.springframework.context.event.SmartApplicationListenerpublic int getOrder()
getOrder in interface org.springframework.core.Orderedprotected void doStart()
MessageProducerSupportdoStart in class MessageProducerSupportprotected void doStop()
MessageProducerSupportdoStop in class MessageProducerSupport