From 112c88f0fc360d93e5aa29e6d909dc44afb76966 Mon Sep 17 00:00:00 2001 From: jfclere Date: Mon, 6 Apr 2009 16:40:12 +0000 Subject: [PATCH] Arrange the code according to Rainer's comments. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@762411 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/cluster/HeartbeatListener.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/cluster/HeartbeatListener.java b/java/org/apache/catalina/cluster/HeartbeatListener.java index b2449d925..eb16275d9 100644 --- a/java/org/apache/catalina/cluster/HeartbeatListener.java +++ b/java/org/apache/catalina/cluster/HeartbeatListener.java @@ -46,7 +46,7 @@ import org.apache.tomcat.util.modeler.Registry; public class HeartbeatListener implements LifecycleListener, ContainerListener { - public static Log log = LogFactory.getLog(HeartbeatListener.class); + private static Log log = LogFactory.getLog(HeartbeatListener.class); /* To allow to select the connector */ int port = 0; @@ -59,9 +59,14 @@ public class HeartbeatListener InetAddress group = null; String ip = "224.0.1.105"; /* Multicast IP */ int multiport = 23364; /* Multicast Port */ + int ttl = 16; public void setGroup(String ip) { this.ip = ip; } + public String getGroup() { return ip; } public void setMultiport(int multiport) { this.multiport = multiport; } + public int getMultiport() { return multiport; } + public void setTtl(int ttl) { this.ttl = ttl; } + public int getTtl() { return ttl; } private CollectedInfo coll = null; @@ -83,10 +88,8 @@ public class HeartbeatListener return; } } -// * *msg_format = "v=%u&ready=%u&busy=%u"; (message to send). -// v = version (1) -// ready & ready are read from the scoreboard in httpd. -// Endpoint ( getCurrentThreadsBusy ) ( getMaxThreads ) + + /* Read busy and ready */ if (coll == null) { try { coll = new CollectedInfo(host, port); @@ -116,7 +119,6 @@ public class HeartbeatListener s.send(data); } catch (Exception ex) { log.error("Unable to send colllected load information: " + ex); - System.out.println(ex); s.close(); s = null; } -- 2.11.0