Example usage for org.springframework.integration.ip.tcp.connection TcpConnection incrementAndGetConnectionSequence

List of usage examples for org.springframework.integration.ip.tcp.connection TcpConnection incrementAndGetConnectionSequence

Introduction

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

Prototype

long incrementAndGetConnectionSequence();

Source Link

Usage

From source file:org.springframework.integration.ip.tcp.connection.TcpMessageMapper.java

protected final void addStandardHeaders(TcpConnection connection, MessageBuilder<?> messageBuilder) {
    String connectionId = connection.getConnectionId();
    messageBuilder.setHeader(IpHeaders.HOSTNAME, connection.getHostName())
            .setHeader(IpHeaders.IP_ADDRESS, connection.getHostAddress())
            .setHeader(IpHeaders.REMOTE_PORT, connection.getPort())
            .setHeader(IpHeaders.CONNECTION_ID, connectionId);
    if (this.applySequence) {
        messageBuilder.setCorrelationId(connectionId)
                .setSequenceNumber((int) connection.incrementAndGetConnectionSequence());
    }//from  w ww  .  j  a  v  a  2  s .c  o m
}