Example usage for org.springframework.integration.ip.tcp.connection TcpConnectionInterceptor close

List of usage examples for org.springframework.integration.ip.tcp.connection TcpConnectionInterceptor close

Introduction

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

Prototype

void close();

Source Link

Document

Closes the connection.

Usage

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

/**
 * If we have been intercepted, propagate the close from the outermost interceptor;
 * otherwise, just call close()./*w  ww. j a  v a 2 s . co  m*/
 */
protected void closeConnection() {
    if (!(this.listener instanceof TcpConnectionInterceptor)) {
        close();
        return;
    }
    TcpConnectionInterceptor outerInterceptor = (TcpConnectionInterceptor) this.listener;
    while (outerInterceptor.getListener() instanceof TcpConnectionInterceptor) {
        outerInterceptor = (TcpConnectionInterceptor) outerInterceptor.getListener();
    }
    outerInterceptor.close();
}