[jboss-cvs] JBossAS SVN: r58936 - branches/JBoss_4_0_3_SP1_JBAS-3808/tomcat/src/main/org/jboss/web/tomcat/tc5/session
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Dec 8 16:57:58 EST 2006
Author: bstansberry at jboss.com
Date: 2006-12-08 16:57:57 -0500 (Fri, 08 Dec 2006)
New Revision: 58936
Modified:
branches/JBoss_4_0_3_SP1_JBAS-3808/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java
Log:
Don't clear sessions before issuing a BEGIN_STOP_EVENT
Modified: branches/JBoss_4_0_3_SP1_JBAS-3808/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java
===================================================================
--- branches/JBoss_4_0_3_SP1_JBAS-3808/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java 2006-12-08 21:09:21 UTC (rev 58935)
+++ branches/JBoss_4_0_3_SP1_JBAS-3808/tomcat/src/main/org/jboss/web/tomcat/tc5/session/JBossCacheManager.java 2006-12-08 21:57:57 UTC (rev 58936)
@@ -253,14 +253,35 @@
public void stop() throws LifecycleException
{
+ if (!started_)
+ {
+ throw new IllegalStateException("Manager not started");
+ }
+
+ log_.debug("Stopping");
+
+ resetStats();
+
+ // Notify our interested LifecycleListeners
+ lifecycle_.fireLifecycleEvent(BEFORE_STOP_EVENT, this);
+
clearSessions();
- if (embedded_)
+
+ proxy_.stop();
+ tm = null;
+
+ started_ = false;
+
+ // Notify our interested LifecycleListeners
+ lifecycle_.fireLifecycleEvent(AFTER_STOP_EVENT, this);
+
+ try
{
- stopEmbedded();
+ unregisterMBeans();
}
- else
+ catch (Exception e)
{
- stopUnembedded();
+ log_.error("Could not unregister ManagerMBean from MBeanServer", e);
}
}
@@ -808,16 +829,6 @@
throw new LifecycleException(e);
}
}
-
- /**
- * Stop this Manager when running embedded in JBoss AS.
- */
- private void stopEmbedded() throws LifecycleException
- {
- super.stop();
- proxy_.stop();
- tm = null;
- }
// ----------------------------------------------- Lifecyle When Unembedded
@@ -937,39 +948,6 @@
}
/**
- * Stop this Manager when running in standalone Tomcat.
- */
- private void stopUnembedded()
- {
- resetStats();
-
- if (!started_)
- {
- throw new IllegalStateException("Manager not started");
- }
-
- // Notify our interested LifecycleListeners
- lifecycle_.fireLifecycleEvent(BEFORE_STOP_EVENT, this);
-
- proxy_.stop();
- tm = null;
-
- started_ = false;
-
- // Notify our interested LifecycleListeners
- lifecycle_.fireLifecycleEvent(AFTER_STOP_EVENT, this);
-
- try
- {
- unregisterMBeans();
- }
- catch (Exception e)
- {
- log_.error("Could not unregister ManagerMBean from MBeanServer", e);
- }
- }
-
- /**
* Register this Manager with JMX.
*/
private void registerMBeans()
@@ -1012,13 +990,14 @@
/**
* Unregister this Manager from the JMX server.
*/
- private void unregisterMBeans()
+ private void unregisterMBeans() throws Exception
{
- if (mserver_ != null)
+ MBeanServer server = getMBeanServer();
+ if (server != null)
{
try
{
- mserver_.unregisterMBean(objectName_);
+ server.unregisterMBean(objectName_);
}
catch (Exception e)
{
More information about the jboss-cvs-commits
mailing list