Author: remy.maucherat(a)jboss.com
Date: 2008-06-12 10:20:09 -0400 (Thu, 12 Jun 2008)
New Revision: 667
Modified:
trunk/java/org/jboss/web/cluster/ClusterListener.java
trunk/java/org/jboss/web/cluster/LocalStrings.properties
trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml
Log:
- Add fields to configure the advertise listener.
Modified: trunk/java/org/jboss/web/cluster/ClusterListener.java
===================================================================
--- trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-06-12 14:11:25 UTC (rev
666)
+++ trunk/java/org/jboss/web/cluster/ClusterListener.java 2008-06-12 14:20:09 UTC (rev
667)
@@ -31,6 +31,7 @@
import java.io.OutputStreamWriter;
import java.net.InetAddress;
import java.net.Socket;
+import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -170,6 +171,30 @@
/**
+ * Advertise group.
+ */
+ protected String advertiseGroupAddress = null;
+ public String getAdvertiseGroupAddress() { return advertiseGroupAddress; }
+ public void setAdvertiseGroupAddress(String advertiseGroupAddress) {
this.advertiseGroupAddress = advertiseGroupAddress; }
+
+
+ /**
+ * Advertise port.
+ */
+ protected int advertisePort = -1;
+ public int getAdvertisePort() { return advertisePort; }
+ public void setAdvertisePort(int advertisePort) { this.advertisePort = advertisePort;
}
+
+
+ /**
+ * Advertise security key.
+ */
+ protected String advertiseSecurityKey = null;
+ public String getAdvertiseSecurityKey() { return advertiseSecurityKey; }
+ public void setAdvertiseSecurityKey(String advertiseSecurityKey) {
this.advertiseSecurityKey = advertiseSecurityKey; }
+
+
+ /**
* Proxy list, format "address:port,address:port".
*/
protected String proxyList = null;
@@ -710,10 +735,22 @@
*/
protected void startListener() {
listener = new AdvertiseListener(this);
+ if (advertiseGroupAddress != null) {
+ listener.setGroupAddress(advertiseGroupAddress);
+ }
+ if (advertisePort > 0) {
+ listener.setAdvertisePort(advertisePort);
+ }
try {
+ if (advertiseSecurityKey != null) {
+ listener.setSecurityKey(advertiseSecurityKey);
+ }
listener.start();
} catch (IOException e) {
- log.info(sm.getString("clusterListener.error.startListener"), e);
+ log.error(sm.getString("clusterListener.error.startListener"), e);
+ } catch (NoSuchAlgorithmException e) {
+ // Should never happen
+ log.error(sm.getString("clusterListener.error.startListener"), e);
}
}
@@ -726,7 +763,7 @@
try {
listener.destroy();
} catch (IOException e) {
- log.info(sm.getString("clusterListener.error.stopListener"),
e);
+ log.error(sm.getString("clusterListener.error.stopListener"),
e);
}
listener = null;
}
Modified: trunk/java/org/jboss/web/cluster/LocalStrings.properties
===================================================================
--- trunk/java/org/jboss/web/cluster/LocalStrings.properties 2008-06-12 14:11:25 UTC (rev
666)
+++ trunk/java/org/jboss/web/cluster/LocalStrings.properties 2008-06-12 14:20:09 UTC (rev
667)
@@ -19,4 +19,6 @@
clusterListener.error.nullAttribute=Value for attribute {0} cannot be null
clusterListener.error.other=Error [{2}: {3}] sending command {0} to proxy {1},
configuration will be reset
clusterListener.error.parse=Error parsing response header for command {0}
+clusterListener.error.startListener=Error starting advertise listener
+clusterListener.error.stopListener=Error stopping advertise listener
clusterListener.error.syntax=Unrecoverable syntax error [{2}: {3}] sending command {0} to
proxy {1}
Modified: trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml
===================================================================
--- trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml 2008-06-12 14:11:25 UTC (rev
666)
+++ trunk/java/org/jboss/web/cluster/mbeans-descriptors.xml 2008-06-12 14:20:09 UTC (rev
667)
@@ -29,6 +29,22 @@
description="Connection timeout for communication with the
proxy"
type="int"/>
+ <attribute name="advertise"
+ description="Enable autodiscovery of httpd servers"
+ type="boolean"/>
+
+ <attribute name="advertiseGroupAddress"
+ description="Multicast address for discovery"
+ type="java.lang.String"/>
+
+ <attribute name="advertisePort"
+ description="Multicast port for discovery"
+ type="int"/>
+
+ <attribute name="advertiseSecurityKey"
+ description="Security key for discovery"
+ type="java.lang.String"/>
+
<attribute name="domain"
description="Domain parameter, which allows tying a jvmRoute to a
particular domain"
type="java.lang.String"/>
Show replies by date