org.axonframework.springmessaging.adapter
Class EventPublishingMessageChannelAdapter

java.lang.Object
  extended by org.axonframework.springmessaging.adapter.EventPublishingMessageChannelAdapter
All Implemented Interfaces:
org.springframework.messaging.MessageHandler

public class EventPublishingMessageChannelAdapter
extends Object
implements org.springframework.messaging.MessageHandler

Adapter class that publishes Events from a Spring Messaging Message Channel on the Event Bus. All events are expected to be contained in the payload of the Message instances.

Optionally, this adapter can be configured with a filter, which can block or accept messages based on their type.

Since:
2.3.1
Author:
Allard Buijze

Constructor Summary
EventPublishingMessageChannelAdapter(EventBus eventBus)
          Initialize the adapter to publish all incoming events to the given eventBus.
EventPublishingMessageChannelAdapter(EventBus eventBus, EventFilter filter)
          Initialize the adapter to publish all incoming events to the given eventBus if they accepted by the given filter.
 
Method Summary
 void handleMessage(org.springframework.messaging.Message<?> message)
          Handles the given message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventPublishingMessageChannelAdapter

public EventPublishingMessageChannelAdapter(EventBus eventBus)
Initialize the adapter to publish all incoming events to the given eventBus.

Parameters:
eventBus - The event bus to publish events on

EventPublishingMessageChannelAdapter

public EventPublishingMessageChannelAdapter(EventBus eventBus,
                                            EventFilter filter)
Initialize the adapter to publish all incoming events to the given eventBus if they accepted by the given filter.

Parameters:
eventBus - The event bus to publish events on.
filter - The filter that indicates which events to publish.
Method Detail

handleMessage

public void handleMessage(org.springframework.messaging.Message<?> message)
Handles the given message. If the filter refuses the message, it is ignored.

Specified by:
handleMessage in interface org.springframework.messaging.MessageHandler
Parameters:
message - The message containing the event to publish


Copyright © 2010-2016. All Rights Reserved.