DUBBO-71 Graceful shutdown-半关闭状态

git-svn-id: http://code.alibabatech.com/svn/dubbo/trunk@335 1a56cb94-b969-4eaa-88fa-be21384802f2
This commit is contained in:
chao.liuc 2011-11-16 02:31:02 +00:00
parent 49831bdf4c
commit 1038a11dad
1 changed files with 4 additions and 7 deletions

View File

@ -103,13 +103,10 @@ public class DubboInvoker<T> extends AbstractInvoker<T> {
public boolean isAvailable() {
if (!super.isAvailable())
return false;
if (clients.length ==1){
return clients[0].isConnected();
} else {
for (ExchangeClient client : clients){
if (client.isConnected()){
return true;
}
for (ExchangeClient client : clients){
//cannot write == not Available ?
if (client.isConnected() && !client.hasAttribute(Constants.CHANNEL_CANNOTWRITE_KEY)){
return true;
}
}
return false;