[jboss-cvs] JBossAS SVN: r76282 - trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 28 00:24:08 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-07-28 00:24:08 -0400 (Mon, 28 Jul 2008)
New Revision: 76282
Modified:
trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterService.java
trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterServiceMBean.java
Log:
[JBAS-5659] Fix startup initialization of proxies
[JBAS-5798] Add proxy-related methods to mbean interface
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterService.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterService.java 2008-07-28 04:23:13 UTC (rev 76281)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterService.java 2008-07-28 04:24:08 UTC (rev 76282)
@@ -140,8 +140,8 @@
setHAPartition(partition);
this.resetRequestSource = new HASingletonAwareResetRequestSource(config, config, partition, ClusteredMCMPHandler.HA_SERVICE_NAME);
- this.localHandler = new DefaultMCMPHandler(config, this.resetRequestSource, false);
- this.localHandler.init();
+ this.localHandler = new DefaultMCMPHandler(config, this.resetRequestSource);
+// this.localHandler.init();
this.clusteredHandler = new ClusteredMCMPHandlerImpl(this.localHandler, partition, ClusteredMCMPHandler.HA_SERVICE_NAME);
this.loadManager = loadFactorProvider;
this.eventHandlerDelegate = new DefaultJBossWebEventHandler(config, config, clusteredHandler, loadFactorProvider);
@@ -153,7 +153,7 @@
this.drmEntry = new ModClusterServiceDRMEntry(partition.getClusterNode(), null);
- this.rpcHandler = new RpcHandler();
+ this.rpcHandler = new RpcHandler();
}
/**
@@ -206,8 +206,41 @@
this.rpcHandler = new RpcHandler();
}
+ // -------------------------------------------------- ModClusterServiceMBean
+
+ public void addProxy(String host, int port)
+ {
+ this.clusteredHandler.addProxy(host, port);
+ }
+
+
+ public void removeProxy(String host, int port)
+ {
+ this.clusteredHandler.removeProxy(host, port);
+ }
+
+
+ public String getProxyConfiguration()
+ {
+ return this.clusteredHandler.getProxyConfiguration();
+ }
+
+
+ public void refresh()
+ {
+ this.clusteredHandler.markProxiesInError();
+ }
+
+
+ public void reset()
+ {
+ this.clusteredHandler.reset();
+ }
+
+
// ---------------------------------------------------- JBossWebEventHandler
+
public void init()
{
// Use the standard logic
@@ -793,19 +826,6 @@
}
}
- public GroupRpcResponse refresh()
- {
- if (this.coord.isMasterNode())
- {
- this.coord.localHandler.refresh();
- return SUCCESS;
- }
- else
- {
- return null;
- }
- }
-
public GroupRpcResponse reset()
{
if (this.coord.isMasterNode())
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterServiceMBean.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterServiceMBean.java 2008-07-28 04:23:13 UTC (rev 76281)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterServiceMBean.java 2008-07-28 04:24:08 UTC (rev 76282)
@@ -23,12 +23,61 @@
package org.jboss.web.tomcat.service.modcluster;
import org.jboss.ha.jmx.HAServiceMBean;
+import org.jboss.web.tomcat.service.modcluster.mcmp.MCMPRequestType;
+import org.jboss.web.tomcat.service.modcluster.mcmp.MCMPServerState;
/**
+ * StandardMBean interface for {@link ModClusterService}.
+ *
* @author Brian Stansberry
- *
*/
public interface ModClusterServiceMBean extends HAServiceMBean
-{
+{
+ /**
+ * Add a proxy to the list of those with which this handler communicates.
+ * Communication does not begin until the next call to {@link #status()}.
+ *
+ * @param host the hostname of the proxy; a string suitable for passing to
+ * <code>InetAddress.getByHost(...)</code>
+ * @param port the port on which the proxy listens for MCMP requests
+ */
+ void addProxy(String host, int port);
+
+ /**
+ * Remove a proxy from the list of those with which this handler communicates.
+ * Communication does not end until the next call to {@link #status()}.
+ *
+ * @param host the hostname of the proxy; a string suitable for passing to
+ * <code>InetAddress.getByHost(...)</code>
+ * @param port the port on which the proxy listens for MCMP requests
+ */
+ void removeProxy(String host, int port);
+
+ /**
+ * Reset any proxies whose status is {@link MCMPServerState#DOWN DOWN} up to
+ * {@link MCMPServerState#ERROR ERROR}, where the configuration will
+ * be refreshed.
+ */
+ void reset();
+
+ /**
+ * FIXME. This is the same as markProxiesInError().
+ *
+ * Reset any proxies whose status is {@link MCMPServerState#OK OK} down to
+ * {@link MCMPServerState#ERROR ERROR}, which will trigger a refresh of
+ * their configuration. To be used through JMX or similar.
+ */
+ void refresh();
+
+ /**
+ * Sends a {@link MCMPRequestType#DUMP DUMP} request to all proxies,
+ * concatentating their responses into a single string.
+ *
+ * TODO wouldn't a List<String> be better? Let the caller concatenate if
+ * so desired.
+ *
+ * @return the configuration information from all the accessible proxies.
+ */
+ String getProxyConfiguration();
}
More information about the jboss-cvs-commits
mailing list