Java Code Examples for com.alibaba.dubbo.remoting.exchange.ExchangeServer#close()

The following examples show how to use com.alibaba.dubbo.remoting.exchange.ExchangeServer#close() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThriftProtocol.java    From dubbo-2.6.5 with Apache License 2.0 6 votes vote down vote up
@Override
public void destroy() {

    super.destroy();

    for (String key : new ArrayList<String>(serverMap.keySet())) {

        ExchangeServer server = serverMap.remove(key);

        if (server != null) {
            try {
                if (logger.isInfoEnabled()) {
                    logger.info("Close dubbo server: " + server.getLocalAddress());
                }
                server.close(ConfigUtils.getServerShutdownTimeout());
            } catch (Throwable t) {
                logger.warn(t.getMessage(), t);
            }
        } // ~ end of if ( server != null )

    } // ~ end of loop serverMap

}
 
Example 2
Source File: ThriftProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {

        super.destroy();

        for (String key : new ArrayList<String>(serverMap.keySet())) {

            ExchangeServer server = serverMap.remove(key);

            if (server != null) {
                try {
                    if (logger.isInfoEnabled()) {
                        logger.info("Close dubbo server: " + server.getLocalAddress());
                    }
                    server.close(getServerShutdownTimeout());
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }
            } // ~ end of if ( server != null )

        } // ~ end of loop serverMap

    }
 
Example 3
Source File: ThriftProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {

        super.destroy();

        for (String key : new ArrayList<String>(serverMap.keySet())) {

            ExchangeServer server = serverMap.remove(key);

            if (server != null) {
                try {
                    if (logger.isInfoEnabled()) {
                        logger.info("Close dubbo server: " + server.getLocalAddress());
                    }
                    server.close(getServerShutdownTimeout());
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }
            } // ~ end of if ( server != null )

        } // ~ end of loop serverMap

    }
 
Example 4
Source File: ThriftProtocol.java    From dubbox-hystrix with Apache License 2.0 6 votes vote down vote up
public void destroy() {

        super.destroy();

        for (String key : new ArrayList<String>(serverMap.keySet())) {

            ExchangeServer server = serverMap.remove(key);

            if (server != null) {
                try {
                    if (logger.isInfoEnabled()) {
                        logger.info("Close dubbo server: " + server.getLocalAddress());
                    }
                    server.close(getServerShutdownTimeout());
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }
            } // ~ end of if ( server != null )

        } // ~ end of loop serverMap

    }
 
Example 5
Source File: ThriftProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {

        super.destroy();

        for (String key : new ArrayList<String>(serverMap.keySet())) {

            ExchangeServer server = serverMap.remove(key);

            if (server != null) {
                try {
                    if (logger.isInfoEnabled()) {
                        logger.info("Close dubbo server: " + server.getLocalAddress());
                    }
                    server.close(getServerShutdownTimeout());
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }
            } // ~ end of if ( server != null )

        } // ~ end of loop serverMap

    }
 
Example 6
Source File: ThriftProtocol.java    From dubbox with Apache License 2.0 6 votes vote down vote up
public void destroy() {

        super.destroy();

        for (String key : new ArrayList<String>(serverMap.keySet())) {

            ExchangeServer server = serverMap.remove(key);

            if (server != null) {
                try {
                    if (logger.isInfoEnabled()) {
                        logger.info("Close dubbo server: " + server.getLocalAddress());
                    }
                    server.close(getServerShutdownTimeout());
                } catch (Throwable t) {
                    logger.warn(t.getMessage(), t);
                }
            } // ~ end of if ( server != null )

        } // ~ end of loop serverMap

    }
 
Example 7
Source File: ProtocolUtils.java    From dubbo-2.6.5 with Apache License 2.0 5 votes vote down vote up
public static void closeAll() {
    DubboProtocol.getDubboProtocol().destroy();
    Collection<ExchangeServer> servers = DubboProtocol.getDubboProtocol().getServers();
    for (ExchangeServer server : servers) {
        server.close();
    }
}
 
Example 8
Source File: ProtocolUtils.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public static void closeAll() {
    DubboProtocol.getDubboProtocol().destroy();
    Collection<ExchangeServer> servers = DubboProtocol.getDubboProtocol().getServers();
    for (ExchangeServer server : servers) {
        server.close();
    }
}
 
Example 9
Source File: ProtocolUtils.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
public static void closeAll() {
    DubboProtocol.getDubboProtocol().destroy();
    Collection<ExchangeServer> servers = DubboProtocol.getDubboProtocol().getServers();
    for (ExchangeServer server : servers) {
        server.close();
    }
}
 
Example 10
Source File: ProtocolUtils.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
public static void closeAll() {
    DubboProtocol.getDubboProtocol().destroy();
    Collection<ExchangeServer> servers = DubboProtocol.getDubboProtocol().getServers();
    for (ExchangeServer server : servers) {
        server.close();
    }
}
 
Example 11
Source File: ProtocolUtils.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public static void closeAll() {
    DubboProtocol.getDubboProtocol().destroy();
    Collection<ExchangeServer> servers = DubboProtocol.getDubboProtocol().getServers();
    for (ExchangeServer server : servers) {
        server.close();
    }
}
 
Example 12
Source File: ProtocolUtils.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public static void closeAll() {
    DubboProtocol.getDubboProtocol().destroy();
    Collection<ExchangeServer> servers = DubboProtocol.getDubboProtocol().getServers();
    for (ExchangeServer server : servers) {
        server.close();
    }
}