Author: pferraro
Date: 2008-09-11 13:39:06 -0400 (Thu, 11 Sep 2008)
New Revision: 1814
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
Log:
init needs to be volatile
Modified:
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java
===================================================================
---
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2008-09-11
17:37:33 UTC (rev 1813)
+++
trunk/mod_cluster/src/main/java/org/jboss/modcluster/DefaultJBossWebEventHandler.java 2008-09-11
17:39:06 UTC (rev 1814)
@@ -66,7 +66,7 @@
private final LoadBalanceFactorProvider loadBalanceFactorProvider;
private final AdvertiseListenerFactory listenerFactory;
- private boolean init;
+ private volatile boolean init;
private AdvertiseListener advertiseListener;
@@ -119,9 +119,23 @@
public synchronized void shutdown()
{
- this.stopListener();
- this.mcmpHandler.shutdown();
this.init = false;
+
+ if (this.advertiseListener != null)
+ {
+ try
+ {
+ this.advertiseListener.destroy();
+ }
+ catch (IOException e)
+ {
+ log.error(this.sm.getString("modcluster.error.stopListener"), e);
+ }
+
+ this.advertiseListener = null;
+ }
+
+ this.mcmpHandler.shutdown();
}
/**
@@ -288,23 +302,4 @@
throw new
IllegalStateException(this.sm.getString("modcluster.error.uninitialized"));
}
}
-
- /**
- * Stop the advertise listener.
- */
- private void stopListener()
- {
- if (this.advertiseListener != null)
- {
- try
- {
- this.advertiseListener.destroy();
- }
- catch (IOException e)
- {
- log.error(this.sm.getString("modcluster.error.stopListener"), e);
- }
- this.advertiseListener = null;
- }
- }
}
Show replies by date