[Jboss-cvs] JBossAS SVN: r55982 - branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 16 09:11:08 EDT 2006


Author: adrian at jboss.org
Date: 2006-08-16 09:11:06 -0400 (Wed, 16 Aug 2006)
New Revision: 55982

Added:
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/OnlyUnregisterAction.java
Modified:
   branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContextActions.java
Log:
To be compatible with the old ServiceController, we
also need to MBeanServer.unregisterMBean(), during remove() even if
we didn't register the MBean ourselves.

Added: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/OnlyUnregisterAction.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/OnlyUnregisterAction.java	2006-08-16 11:51:59 UTC (rev 55981)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/OnlyUnregisterAction.java	2006-08-16 13:11:06 UTC (rev 55982)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.system.microcontainer;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.system.ServiceCreator;
+
+/**
+ * Only unregister action
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class OnlyUnregisterAction extends ServiceControllerContextAction
+{
+   public void installAction(ServiceControllerContext context) throws Throwable
+   {
+   }
+
+   public void uninstallAction(ServiceControllerContext context)
+   {
+      MBeanServer server = context.getServiceController().getMBeanServer();
+      ObjectName objectName = context.getObjectName();
+      ServiceCreator.uninstall(server, objectName);
+      context.setTarget(null);
+   }
+}

Modified: branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContextActions.java
===================================================================
--- branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContextActions.java	2006-08-16 11:51:59 UTC (rev 55981)
+++ branches/MC_VDF_WORK/system-jmx/src/main/org/jboss/system/microcontainer/ServiceControllerContextActions.java	2006-08-16 13:11:06 UTC (rev 55982)
@@ -72,6 +72,7 @@
       if (lifecycleOnly == null)
       {
          Map<ControllerState, ControllerContextAction> actions = new HashMap<ControllerState, ControllerContextAction>();
+         actions.put(ControllerState.INSTANTIATED, new OnlyUnregisterAction());
          actions.put(ControllerState.CREATE, new CreateDestroyLifecycleAction());
          actions.put(ControllerState.START, new StartStopLifecycleAction());
          lifecycleOnly = new ServiceControllerContextActions(actions);




More information about the jboss-cvs-commits mailing list