com.yiji.framework.watcher.dubbo.health.DubboServerStatusHealthCheck Maven / Gradle / Ivy
/*
* www.yiji.com Inc.
* Copyright (c) 2014 All Rights Reserved
*/
/*
* 修订记录:
* [email protected] 2015-05-19 16:43 创建
*
*/
package com.yiji.framework.watcher.dubbo.health;
import java.util.Collection;
import com.alibaba.dubbo.remoting.exchange.ExchangeServer;
import com.alibaba.dubbo.rpc.protocol.dubbo.DubboProtocol;
/**
* @author [email protected]
*/
public class DubboServerStatusHealthCheck extends AbstractDubboHealthCheck {
@Override
protected Result check() throws Exception {
Collection servers = DubboProtocol.getDubboProtocol().getServers();
if (servers == null || servers.size() == 0) {
return Result.healthy("no exchangeServer found");
}
for (ExchangeServer server : servers) {
if (!server.isBound()) {
return Result.unhealthy("server is unbound");
}
}
return Result.healthy();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy