org.springframework.integration.adapter.event
Class ApplicationEventSource

java.lang.Object
  extended by org.springframework.integration.channel.ChannelPublisher
      extended by org.springframework.integration.adapter.event.ApplicationEventSource
All Implemented Interfaces:
java.util.EventListener, org.springframework.context.ApplicationListener

public class ApplicationEventSource
extends ChannelPublisher
implements org.springframework.context.ApplicationListener

A message source for passing Spring ApplicationEvents within messages.

Author:
Mark Fisher

Field Summary
private  java.util.List<java.lang.Class<? extends org.springframework.context.ApplicationEvent>> eventTypes
           
 
Constructor Summary
ApplicationEventSource(MessageChannel channel)
           
 
Method Summary
 void onApplicationEvent(org.springframework.context.ApplicationEvent event)
           
private  boolean sendMessage(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.channel.ChannelPublisher
getChannel, publish, setChannel, setTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventTypes

private java.util.List<java.lang.Class<? extends org.springframework.context.ApplicationEvent>> eventTypes
Constructor Detail

ApplicationEventSource

public ApplicationEventSource(MessageChannel channel)
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

sendMessage

private boolean sendMessage(org.springframework.context.ApplicationEvent event)