com.consol.citrus.channel
Class MessageChannelSender

java.lang.Object
  extended by com.consol.citrus.channel.MessageChannelSender
All Implemented Interfaces:
MessageSender, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware
Direct Known Subclasses:
SyncMessageChannelSender

public class MessageChannelSender
extends Object
implements MessageSender, org.springframework.beans.factory.BeanFactoryAware

Publish message to a MessageChannel.

Author:
Christoph Christoph

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.consol.citrus.message.MessageSender
MessageSender.ErrorHandlingStrategy
 
Constructor Summary
MessageChannelSender()
           
 
Method Summary
 TestActor getActor()
          Gets the actor.
 org.springframework.integration.MessageChannel getChannel()
          Gets the channel.
 String getChannelName()
          Gets the channelName.
 org.springframework.integration.support.channel.ChannelResolver getChannelResolver()
          Gets the channelResolver.
protected  org.springframework.integration.MessageChannel getDestinationChannel()
          Get the destination channel depending on settings in this message sender.
protected  String getDestinationChannelName()
          Gets the channel name depending on what is set in this message sender.
 org.springframework.integration.core.MessagingTemplate getMessagingTemplate()
          Gets the messagingTemplate.
protected  org.springframework.integration.MessageChannel resolveChannelName(String channelName)
          Resolve the channel by name.
 void send(org.springframework.integration.Message<?> message)
          Sends the message.
 void setActor(TestActor actor)
          Sets the actor.
 void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
          Sets the bean factory for channel resolver.
 void setChannel(org.springframework.integration.MessageChannel channel)
          Set the message channel.
 void setChannelName(String channelName)
          Sets the destination channel name.
 void setChannelResolver(org.springframework.integration.support.channel.ChannelResolver channelResolver)
          Set the channel resolver.
 void setMessagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate)
          Sets the messaging template.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageChannelSender

public MessageChannelSender()
Method Detail

send

public void send(org.springframework.integration.Message<?> message)
Description copied from interface: MessageSender
Sends the message.

Specified by:
send in interface MessageSender
Parameters:
message - the message object to send.
Throws:
CitrusRuntimeException
See Also:
MessageSender.send(org.springframework.integration.Message)

getDestinationChannel

protected org.springframework.integration.MessageChannel getDestinationChannel()
Get the destination channel depending on settings in this message sender. Either a direct channel object is set or a channel name which will be resolved to a channel.

Returns:
the destination channel object.

getDestinationChannelName

protected String getDestinationChannelName()
Gets the channel name depending on what is set in this message sender. Either channel name is set directly or channel object is consulted for channel name.

Returns:
the channel name.

resolveChannelName

protected org.springframework.integration.MessageChannel resolveChannelName(String channelName)
Resolve the channel by name.

Parameters:
channelName - the name to resolve
Returns:
the MessageChannel object

setChannel

public void setChannel(org.springframework.integration.MessageChannel channel)
Set the message channel.

Parameters:
channel - the channel to set

setMessagingTemplate

public void setMessagingTemplate(org.springframework.integration.core.MessagingTemplate messagingTemplate)
Sets the messaging template.

Parameters:
messagingTemplate - the messagingTemplate to set

setBeanFactory

public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
                    throws org.springframework.beans.BeansException
Sets the bean factory for channel resolver.

Specified by:
setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
Throws:
org.springframework.beans.BeansException
See Also:
BeanFactoryAware.setBeanFactory(org.springframework.beans.factory.BeanFactory)

setChannelResolver

public void setChannelResolver(org.springframework.integration.support.channel.ChannelResolver channelResolver)
Set the channel resolver.

Parameters:
channelResolver - the channelResolver to set

setChannelName

public void setChannelName(String channelName)
Sets the destination channel name.

Parameters:
channelName - the channelName to set

getChannel

public org.springframework.integration.MessageChannel getChannel()
Gets the channel.

Returns:
the channel

getChannelName

public String getChannelName()
Gets the channelName.

Returns:
the channelName

getMessagingTemplate

public org.springframework.integration.core.MessagingTemplate getMessagingTemplate()
Gets the messagingTemplate.

Returns:
the messagingTemplate

getChannelResolver

public org.springframework.integration.support.channel.ChannelResolver getChannelResolver()
Gets the channelResolver.

Returns:
the channelResolver

getActor

public TestActor getActor()
Gets the actor.

Specified by:
getActor in interface MessageSender
Returns:
the actor the actor to get.

setActor

public void setActor(TestActor actor)
Sets the actor.

Parameters:
actor - the actor to set


Copyright © 2008-2013 ConSol* Consulting&Solutions GmbH. All Rights Reserved.