Author: jfrederic.clere(a)jboss.com
Date: 2009-01-27 09:28:55 -0500 (Tue, 27 Jan 2009)
New Revision: 2219
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
getProxyMessage() now returns null if no proxy answers are received...
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2009-01-27
09:47:21 UTC (rev 2218)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/mcmp/impl/DefaultMCMPHandler.java 2009-01-27
14:28:55 UTC (rev 2219)
@@ -339,7 +339,7 @@
private String getProxyMessage(MCMPRequest request)
{
- StringBuilder result = new StringBuilder();
+ StringBuilder result = null;
Lock lock = this.proxiesLock.readLock();
lock.lock();
@@ -349,15 +349,20 @@
for (int i = 0; i < this.proxies.size(); ++i)
{
Proxy proxy = this.proxies.get(i);
- result.append("Proxy[").append(i).append("]:
[").append(proxy.getAddress()).append(':').append(proxy.getPort()).append("]:
\r\n");
- result.append(this.sendRequest(request, proxy)).append("\r\n");
+ String string = this.sendRequest(request, proxy);
+ if (string != null) {
+ if (result == null)
+ result = new StringBuilder();
+ result.append("Proxy[").append(i).append("]:
[").append(proxy.getAddress()).append(':').append(proxy.getPort()).append("]:
\r\n");
+ result.append(string).append("\r\n");
+ }
}
}
finally
{
lock.unlock();
}
- return result.toString();
+ return (result == null) ? null : result.toString();
}
public InetAddress getLocalAddress() throws IOException
Show replies by date