public class ApplicationEventListeningMessageProducer extends ExpressionMessageProducerSupport implements 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, loggerHIGHEST_PRECEDENCE, LOWEST_PRECEDENCE| 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.
|
String |
getComponentType()
Subclasses may implement this method to provide component type information.
|
int |
getOrder() |
void |
onApplicationEvent(ApplicationEvent event) |
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
setEventTypes(Class<?>... eventTypes)
Set the list of event types (classes that extend ApplicationEvent) that
this adapter should send to the message channel.
|
boolean |
supportsEventType(ResolvableType eventType) |
boolean |
supportsSourceType(Class<?> sourceType) |
evaluatePayloadExpression, setIntegrationEvaluationContext, setPayloadExpression, setPayloadExpressionStringafterSingletonsInstantiated, getErrorChannel, getMessagingTemplate, getOutputChannel, sendMessage, setErrorChannel, setErrorChannelName, setOutputChannel, setOutputChannelName, setSendTimeout, setShouldTrackdoStop, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stopafterPropertiesSet, extractTypeIfPossible, getApplicationContext, getApplicationContextId, getBeanFactory, getChannelResolver, getComponentName, getConversionService, getExpression, getIntegrationProperties, getIntegrationProperty, getMessageBuilderFactory, getTaskScheduler, setApplicationContext, setBeanFactory, setBeanName, setChannelResolver, setComponentName, setConversionService, setMessageBuilderFactory, setPrimaryExpression, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComponentNamepublic ApplicationEventListeningMessageProducer()
public final void setEventTypes(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 String getComponentType()
IntegrationObjectSupportgetComponentType in interface NamedComponentgetComponentType in class IntegrationObjectSupportprotected void onInit()
IntegrationObjectSupportonInit in class ExpressionMessageProducerSupportpublic void onApplicationEvent(ApplicationEvent event)
onApplicationEvent in interface ApplicationListener<ApplicationEvent>public boolean supportsEventType(ResolvableType eventType)
supportsEventType in interface GenericApplicationListenerpublic boolean supportsSourceType(Class<?> sourceType)
supportsSourceType in interface GenericApplicationListenerprotected void doStart()
MessageProducerSupportdoStart in class MessageProducerSupportprotected void doStop()
MessageProducerSupportdoStop in class MessageProducerSupport