public class ApplicationEventListeningMessageProducer
extends org.springframework.integration.endpoint.ExpressionMessageProducerSupport
implements org.springframework.context.event.GenericApplicationListener
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,
ExpressionMessageProducerSupportlifecycleCondition, lifecycleLockEXPRESSION_PARSER, logger| 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<?>... eventTypes)
Set the list of event types (classes that extend ApplicationEvent) that
this adapter should send to the message channel.
|
boolean |
supportsEventType(org.springframework.core.ResolvableType eventType) |
boolean |
supportsSourceType(java.lang.Class<?> sourceType) |
evaluatePayloadExpression, setIntegrationEvaluationContext, setPayloadExpression, setPayloadExpressionStringafterSingletonsInstantiated, buildErrorMessage, getErrorChannel, getErrorMessageAttributes, getMessagingTemplate, getOutputChannel, sendErrorMessageIfNecessary, sendMessage, setErrorChannel, setErrorChannelName, setErrorMessageStrategy, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrackdestroy, doStop, getPhase, getRole, isAutoStartup, isRunning, setAutoStartup, setPhase, setRole, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, isInitialized, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringpublic ApplicationEventListeningMessageProducer()
public final void setEventTypes(java.lang.Class<?>... 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(org.springframework.core.ResolvableType)public java.lang.String getComponentType()
getComponentType in interface org.springframework.integration.support.context.NamedComponentgetComponentType in class org.springframework.integration.context.IntegrationObjectSupportprotected void onInit()
onInit in class org.springframework.integration.endpoint.ExpressionMessageProducerSupportpublic void onApplicationEvent(org.springframework.context.ApplicationEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.ApplicationEvent>public boolean supportsEventType(org.springframework.core.ResolvableType eventType)
supportsEventType in interface org.springframework.context.event.GenericApplicationListenerpublic boolean supportsSourceType(java.lang.Class<?> sourceType)
supportsSourceType in interface org.springframework.context.event.GenericApplicationListenerpublic int getOrder()
getOrder in interface org.springframework.context.event.GenericApplicationListenergetOrder in interface org.springframework.core.Orderedprotected void doStart()
doStart in class org.springframework.integration.endpoint.MessageProducerSupportprotected void doStop()
doStop in class org.springframework.integration.endpoint.MessageProducerSupport