Author: pferraro
Date: 2008-10-31 16:17:03 -0400 (Fri, 31 Oct 2008)
New Revision: 2039
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/ClusterListener.java
Log:
Add constructor to allow JBoss AS to define a non-clustered listener.
Modified: trunk/mod_cluster/src/main/java/org/jboss/modcluster/ClusterListener.java
===================================================================
--- trunk/mod_cluster/src/main/java/org/jboss/modcluster/ClusterListener.java 2008-10-31
20:16:19 UTC (rev 2038)
+++ trunk/mod_cluster/src/main/java/org/jboss/modcluster/ClusterListener.java 2008-10-31
20:17:03 UTC (rev 2039)
@@ -22,9 +22,6 @@
package org.jboss.modcluster;
-import java.util.List;
-import java.util.Map;
-
import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;
@@ -42,11 +39,12 @@
import org.apache.tomcat.util.modeler.Registry;
import org.jboss.logging.Logger;
import org.jboss.modcluster.config.ModClusterConfig;
+import org.jboss.modcluster.load.LoadBalanceFactorProvider;
import org.jboss.modcluster.mcmp.MCMPHandler;
import org.jboss.modcluster.mcmp.MCMPRequest;
import org.jboss.modcluster.mcmp.MCMPUtils;
-import org.jboss.modcluster.mcmp.ResetRequestSource;
import org.jboss.modcluster.mcmp.impl.DefaultMCMPHandler;
+import org.jboss.modcluster.mcmp.impl.ResetRequestSourceImpl;
/**
* This listener communicates with a front end mod_cluster enabled proxy to
@@ -54,7 +52,7 @@
* deployed.
*/
public class ClusterListener extends ModClusterConfig
- implements LifecycleListener, ContainerListener, ResetRequestSource
+ implements LifecycleListener, ContainerListener
{
static
{
@@ -92,16 +90,21 @@
public ClusterListener()
{
- this.mcmpHandler = new DefaultMCMPHandler(this, this);
+ this(null);
+ }
+
+ public ClusterListener(LoadBalanceFactorProvider loadBalanceFactorProvider)
+ {
+ this.mcmpHandler = new DefaultMCMPHandler(this, new ResetRequestSourceImpl(this,
this));
- JBossWebEventHandler eventHandler = new DefaultJBossWebEventHandler(this, this,
this, this.mcmpHandler, this);
+ JBossWebEventHandler eventHandler = new DefaultJBossWebEventHandler(this, this,
this, this.mcmpHandler, (loadBalanceFactorProvider != null) ? loadBalanceFactorProvider :
this);
BasicClusterListener listener = new BasicClusterListener(eventHandler);
this.lifecycleListener = listener;
this.containerListener = listener;
}
-
+
protected ClusterListener(MCMPHandler mcmpHandler, LifecycleListener
lifecycleListener, ContainerListener containerListener)
{
this.mcmpHandler = mcmpHandler;
@@ -109,16 +112,6 @@
this.containerListener = containerListener;
}
- // ---------------------------------------------------- ResetRequestSource
-
- /**
- * Reset configuration for a particular proxy following an error.
- */
- public List<MCMPRequest> getResetRequests(Map<String,
ResetRequestSource.EngineStatus> response)
- {
- return MCMPUtils.getResetRequests(response, ServerFactory.getServer(), this,
this);
- }
-
//----------------------------------------------------------------- Public
/**
@@ -140,6 +133,7 @@
{
return this.mcmpHandler.getProxyConfiguration();
}
+
/**
* Retrieves the full proxy info message.
*
@@ -151,7 +145,6 @@
return this.mcmpHandler.getProxyInfo();
}
-
/**
* Reset a DOWN connection to the proxy up to ERROR, where the configuration will
* be refreshed. To be used through JMX or similar.
Show replies by date