Example usage for org.springframework.integration.ip AbstractInternetProtocolReceivingChannelAdapter isListening

List of usage examples for org.springframework.integration.ip AbstractInternetProtocolReceivingChannelAdapter isListening

Introduction

In this page you can find the example usage for org.springframework.integration.ip AbstractInternetProtocolReceivingChannelAdapter isListening.

Prototype

public boolean isListening() 

Source Link

Usage

From source file:org.springframework.integration.ip.util.SocketTestUtils.java

public static void waitListening(AbstractInternetProtocolReceivingChannelAdapter adapter) throws Exception {
    int n = 0;/*from   w  w  w.  j  a  v  a2 s  .c o m*/
    while (!adapter.isListening()) {
        Thread.sleep(100);
        if (n++ > 100) {
            throw new Exception("Gateway failed to listen");
        }
    }

}