[jboss-cvs] JBossAS SVN: r76213 - in trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster: ha and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Jul 24 22:37:14 EDT 2008
Author: bstansberry at jboss.com
Date: 2008-07-24 22:37:13 -0400 (Thu, 24 Jul 2008)
New Revision: 76213
Modified:
trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterService.java
trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandler.java
trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java
Log:
[JBAS-5659] Fixes to get clean cluster startup/shutdown
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-25 02:35:56 UTC (rev 76212)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ModClusterService.java 2008-07-25 02:37:13 UTC (rev 76213)
@@ -31,10 +31,14 @@
import java.util.Map;
import java.util.Set;
+import javax.management.Notification;
+
import org.apache.catalina.Context;
import org.apache.catalina.Engine;
import org.apache.catalina.Server;
import org.apache.catalina.util.StringManager;
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.beans.metadata.api.model.FromContext;
import org.jboss.ha.framework.interfaces.ClusterNode;
import org.jboss.ha.framework.interfaces.DistributedReplicantManager;
import org.jboss.ha.framework.interfaces.HAPartition;
@@ -136,6 +140,7 @@
this.resetRequestSource = new HASingletonAwareResetRequestSource(config, config, partition, ClusteredMCMPHandler.HA_SERVICE_NAME);
this.localHandler = new DefaultMCMPHandler(config, this.resetRequestSource, false);
+ 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);
@@ -347,6 +352,15 @@
this.resetRequestSource.setMasterNode(false);
}
+ @Override
+ @Inject(fromContext = FromContext.NAME)
+ public void setServiceHAName(String haName)
+ {
+ super.setServiceHAName(haName);
+ this.clusteredHandler.setHAServiceName(getServiceHAName());
+ }
+
+
// -------------------------------------------------------------- Protected
/**
@@ -488,7 +502,9 @@
{
statuses.put(cn, new PeerMCMPDiscoveryStatus(cn, mcssgrr.getStates(), latestEvent));
- resetRequests.addAll(mcssgrr.getResetRequests());
+ List<MCMPRequest> toAdd = mcssgrr.getResetRequests();
+ if (toAdd != null)
+ resetRequests.addAll(toAdd);
ModClusterServiceDRMEntry removed = nonresponsive.remove(cn);
if (removed != null)
@@ -624,7 +640,7 @@
/**
* This is the object that gets invoked on via reflection by HAPartition.
*/
- private class RpcHandler
+ public class RpcHandler
{
private final ModClusterService coord = ModClusterService.this;
private final GroupRpcResponse SUCCESS =
@@ -635,6 +651,11 @@
{
this.coord.stopOldMaster(domain);
}
+
+ public void _receiveRemoteNotification(Notification notification)
+ {
+ this.coord._receiveRemoteNotification(notification);
+ }
public InetAddressGroupRpcResponse getLocalAddress() throws IOException
{
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandler.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandler.java 2008-07-25 02:35:56 UTC (rev 76212)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/ha/ClusteredMCMPHandler.java 2008-07-25 02:37:13 UTC (rev 76213)
@@ -35,7 +35,7 @@
*/
public interface ClusteredMCMPHandler extends MCMPHandler
{
- public static final String HA_SERVICE_NAME = "ModCluster";
+ public static final String HA_SERVICE_NAME = "ModClusterService";
List<MCMPServerDiscoveryEvent> getPendingDiscoveryEvents();
void discoveryEventsReceived(MCMPServerDiscoveryEvent lastReceived);
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-07-25 02:35:56 UTC (rev 76212)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/modcluster/mcmp/impl/DefaultMCMPHandler.java 2008-07-25 02:37:13 UTC (rev 76213)
@@ -32,6 +32,7 @@
import java.net.UnknownHostException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -328,10 +329,15 @@
removeProxies.add(proxy);
}
+ @SuppressWarnings("unchecked")
public synchronized Set<MCMPServerState> getProxyStates()
{
- Set<MCMPServerState> result = new HashSet<MCMPServerState>(proxies.length);
- for (Proxy proxy : proxies)
+ Proxy[] local = this.proxies;
+ if (local == null)
+ return java.util.Collections.EMPTY_SET;
+
+ Set<MCMPServerState> result = new HashSet<MCMPServerState>(local.length);
+ for (Proxy proxy : local)
{
result.add(proxy);
}
More information about the jboss-cvs-commits
mailing list