List of usage examples for org.springframework.integration.ip.tcp.connection TcpConnectionInterceptor getListener
@Nullable TcpListener getListener();
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 w w . j a v a 2 s .c o 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(); }
From source file:org.springframework.integration.ip.tcp.connection.AbstractTcpConnection.java
/** * @param listener the listener to set//from w w w . j a va 2s. c om */ public void registerListener(TcpListener listener) { this.listener = listener; // Determine the actual listener for this connection if (!(this.listener instanceof TcpConnectionInterceptor)) { this.actualListener = this.listener; } else { TcpConnectionInterceptor outerInterceptor = (TcpConnectionInterceptor) this.listener; while (outerInterceptor.getListener() instanceof TcpConnectionInterceptor) { outerInterceptor = (TcpConnectionInterceptor) outerInterceptor.getListener(); } this.actualListener = outerInterceptor.getListener(); } }