Example usage for org.springframework.integration.ip.tcp.connection AbstractConnectionFactory registerSender

List of usage examples for org.springframework.integration.ip.tcp.connection AbstractConnectionFactory registerSender

Introduction

In this page you can find the example usage for org.springframework.integration.ip.tcp.connection AbstractConnectionFactory registerSender.

Prototype

public void registerSender(TcpSender senderToRegister) 

Source Link

Document

Registers a TcpSender; for server sockets, used to provide connection information so a sender can be used to reply to incoming messages.

Usage

From source file:org.springframework.integration.ip.tcp.TcpSendingMessageHandler.java

/**
 * Sets the client or server connection factory; for this (an outbound adapter), if
 * the factory is a server connection factory, the sockets are owned by a receiving
 * channel adapter and this adapter is used to send replies.
 * /*from w ww  .j  a v a 2 s  . c  om*/
 * @param connectionFactory the connectionFactory to set
 */
public void setConnectionFactory(AbstractConnectionFactory connectionFactory) {
    if (connectionFactory instanceof AbstractClientConnectionFactory) {
        this.clientConnectionFactory = connectionFactory;
    } else {
        this.serverConnectionFactory = connectionFactory;
        connectionFactory.registerSender(this);
    }
}