org.springframework.integration.event
Class ApplicationEventInboundChannelAdapter

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.endpoint.AbstractEndpoint
          extended by org.springframework.integration.endpoint.MessageProducerSupport
              extended by org.springframework.integration.event.ApplicationEventInboundChannelAdapter
All Implemented Interfaces:
java.util.EventListener, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationListener, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

public class ApplicationEventInboundChannelAdapter
extends MessageProducerSupport
implements org.springframework.context.ApplicationListener

An inbound Channel Adapter that passes Spring ApplicationEvents within messages.

Author:
Mark Fisher

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Constructor Summary
ApplicationEventInboundChannelAdapter()
           
 
Method Summary
protected  void doStart()
          Subclasses must implement this method with the start behavior.
protected  void doStop()
          Subclasses must implement this method with the stop behavior.
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
 void setEventTypes(java.util.List<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.
 
Methods inherited from class org.springframework.integration.endpoint.MessageProducerSupport
onInit, sendMessage, setOutputChannel, setSendTimeout
 
Methods inherited from class org.springframework.integration.endpoint.AbstractEndpoint
afterPropertiesSet, getPhase, isAutoStartup, isRunning, setAutoStartup, setPhase, setTaskScheduler, start, stop, stop
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
getBeanFactory, getBeanName, getChannelResolver, getTaskScheduler, setBeanFactory, setBeanName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ApplicationEventInboundChannelAdapter

public ApplicationEventInboundChannelAdapter()
Method Detail

setEventTypes

public void setEventTypes(java.util.List<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. By default, all event types will be sent.


onApplicationEvent

public void onApplicationEvent(org.springframework.context.ApplicationEvent event)
Specified by:
onApplicationEvent in interface org.springframework.context.ApplicationListener

doStart

protected void doStart()
Description copied from class: AbstractEndpoint
Subclasses must implement this method with the start behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.

Specified by:
doStart in class AbstractEndpoint

doStop

protected void doStop()
Description copied from class: AbstractEndpoint
Subclasses must implement this method with the stop behavior. This method will be invoked while holding the AbstractEndpoint.lifecycleLock.

Specified by:
doStop in class AbstractEndpoint