[jboss-cvs] JBossAS SVN: r81063 - in trunk/management: src/main/org/jboss/management/j2ee/deployers and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 14 10:07:19 EST 2008


Author: dimitris at jboss.org
Date: 2008-11-14 10:07:19 -0500 (Fri, 14 Nov 2008)
New Revision: 81063

Modified:
   trunk/management/pom.xml
   trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomain.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomainMBean.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java
   trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
Log:
fix svn properties


Property changes on: trunk/management/pom.xml
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,193 +1,193 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import java.util.Collections;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.beans.metadata.api.annotations.Inject;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-
-/**
- * Abstract jsr77 deployer.
- *
- * @param <T> exact input type
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractJSR77Deployer<T> extends AbstractSimpleRealDeployer<T>
-{
-   private boolean requiresVFSDeployment;
-
-   private MBeanServer server;
-
-   protected AbstractJSR77Deployer(Class<T> input)
-   {
-      super(input);
-      setOutput(ObjectName.class);
-   }
-
-   /**
-    * Inject the mbean server.
-    *
-    * @param server the mbean server
-    */
-   @Inject(bean = "JMXKernel", property = "mbeanServer")
-   public void setServer(MBeanServer server)
-   {
-      this.server = server;
-   }
-
-   /**
-    * Set the requires vfs flag.
-    *
-    * @param requiresVFSDeployment the requires vfs flag
-    */
-   public void setRequiresVFSDeployment(boolean requiresVFSDeployment)
-   {
-      this.requiresVFSDeployment = requiresVFSDeployment;
-   }
-
-   /**
-    * Deploy jsr77 view.
-    *
-    * @param server the mbean server
-    * @param unit the deployment unit
-    * @param metaData the metadata
-    * @throws Throwable for any error
-    */
-   protected abstract void deployJsr77(MBeanServer server, DeploymentUnit unit, T metaData) throws Throwable;
-
-   /**
-    * Undeploy jsr77 view.
-    *
-    * @param server the mbean server
-    * @param unit the deployment unit
-    * @param metaData the metadata
-    */
-   protected abstract void undeployJsr77(MBeanServer server, DeploymentUnit unit, T metaData);
-
-   /**
-    * Put top level object name.
-    *
-    * @param unit the deployment unit
-    * @param attachmentName the attachment name
-    * @param name the object name
-    */
-   protected static void putObjectName(DeploymentUnit unit, String attachmentName, ObjectName name)
-   {
-      // something in org.jboss.management probably returned null, see log's debug for more info
-      if (name != null)
-         unit.addAttachment(attachmentName + "." + ObjectName.class.getSimpleName(), name, ObjectName.class);
-   }
-
-   /**
-    * Get object name from attachment.
-    *
-    * @param unit the deployment unit
-    * @param attachmentName the attachment name
-    * @return object name from attachment
-    */
-   protected static ObjectName getObjectName(DeploymentUnit unit, String attachmentName)
-   {
-      return unit.getAttachment(attachmentName + "." + ObjectName.class.getSimpleName(), ObjectName.class);
-   }
-
-   /**
-    * Remove object name from attachment.
-    *
-    * @param unit the deployment unit
-    * @param attachmentName the attachment name
-    * @return object name from attachment
-    */
-   protected static ObjectName removeObjectName(DeploymentUnit unit, String attachmentName)
-   {
-      return unit.removeAttachment(attachmentName + "." + ObjectName.class.getSimpleName(), ObjectName.class);
-   }
-
-   /**
-    * Extract root object name from parameters.
-    *
-    * @param server the mbean server
-    * @param unit the deployment unit
-    * @param metaData the metadata
-    * @return root's object name
-    * @throws IllegalArgumentException for any error
-    */
-   protected ObjectName extractRootObjectName(MBeanServer server, DeploymentUnit unit, T metaData)
-   {
-      try
-      {
-         // TODO - fake object name, this method should be made abstract!
-         return new ObjectName("jboss.service:type=" + metaData.getClass().getSimpleName() + ",unit=" + unit.getSimpleName());
-      }
-      catch (Throwable t)
-      {
-         throw new IllegalArgumentException("Cannot extract root ObjectName.", t);
-      }
-   }
-
-   /**
-    * Extract object names for components from parameters.
-    *
-    * @param server the mbean server
-    * @param unit the deployment unit
-    * @param metaData the metadata
-    * @return root's object name
-    * @throws IllegalArgumentException for any error
-    */
-   protected Iterable<ObjectName> extractComponentObjectNames(MBeanServer server, DeploymentUnit unit, T metaData)
-   {
-      // TODO - empty object names, this method should be made abstract!
-      return Collections.emptySet();
-   }
-
-   public void deploy(DeploymentUnit unit, T metaData) throws DeploymentException
-   {
-      if (server != null && unit instanceof VFSDeploymentUnit == requiresVFSDeployment)
-      {
-         try
-         {
-            deployJsr77(server, unit, metaData);
-         }
-         catch (Throwable t)
-         {
-            throw DeploymentException.rethrowAsDeploymentException("Cannot deploy jsr77.", t);
-         }
-      }
-      else if (log.isTraceEnabled())
-      {
-         log.trace("Missing mbean server or deployment unit type mismatch.");
-      }
-   }
-
-   public void undeploy(DeploymentUnit unit, T metaData)
-   {
-      if (server != null && unit instanceof VFSDeploymentUnit == requiresVFSDeployment)
-         undeployJsr77(server, unit, metaData);
-      else if (log.isTraceEnabled())
-         log.trace("Missing mbean server or deployment unit type mismatch.");
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import java.util.Collections;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.beans.metadata.api.annotations.Inject;
+import org.jboss.deployers.spi.DeploymentException;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+/**
+ * Abstract jsr77 deployer.
+ *
+ * @param <T> exact input type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractJSR77Deployer<T> extends AbstractSimpleRealDeployer<T>
+{
+   private boolean requiresVFSDeployment;
+
+   private MBeanServer server;
+
+   protected AbstractJSR77Deployer(Class<T> input)
+   {
+      super(input);
+      setOutput(ObjectName.class);
+   }
+
+   /**
+    * Inject the mbean server.
+    *
+    * @param server the mbean server
+    */
+   @Inject(bean = "JMXKernel", property = "mbeanServer")
+   public void setServer(MBeanServer server)
+   {
+      this.server = server;
+   }
+
+   /**
+    * Set the requires vfs flag.
+    *
+    * @param requiresVFSDeployment the requires vfs flag
+    */
+   public void setRequiresVFSDeployment(boolean requiresVFSDeployment)
+   {
+      this.requiresVFSDeployment = requiresVFSDeployment;
+   }
+
+   /**
+    * Deploy jsr77 view.
+    *
+    * @param server the mbean server
+    * @param unit the deployment unit
+    * @param metaData the metadata
+    * @throws Throwable for any error
+    */
+   protected abstract void deployJsr77(MBeanServer server, DeploymentUnit unit, T metaData) throws Throwable;
+
+   /**
+    * Undeploy jsr77 view.
+    *
+    * @param server the mbean server
+    * @param unit the deployment unit
+    * @param metaData the metadata
+    */
+   protected abstract void undeployJsr77(MBeanServer server, DeploymentUnit unit, T metaData);
+
+   /**
+    * Put top level object name.
+    *
+    * @param unit the deployment unit
+    * @param attachmentName the attachment name
+    * @param name the object name
+    */
+   protected static void putObjectName(DeploymentUnit unit, String attachmentName, ObjectName name)
+   {
+      // something in org.jboss.management probably returned null, see log's debug for more info
+      if (name != null)
+         unit.addAttachment(attachmentName + "." + ObjectName.class.getSimpleName(), name, ObjectName.class);
+   }
+
+   /**
+    * Get object name from attachment.
+    *
+    * @param unit the deployment unit
+    * @param attachmentName the attachment name
+    * @return object name from attachment
+    */
+   protected static ObjectName getObjectName(DeploymentUnit unit, String attachmentName)
+   {
+      return unit.getAttachment(attachmentName + "." + ObjectName.class.getSimpleName(), ObjectName.class);
+   }
+
+   /**
+    * Remove object name from attachment.
+    *
+    * @param unit the deployment unit
+    * @param attachmentName the attachment name
+    * @return object name from attachment
+    */
+   protected static ObjectName removeObjectName(DeploymentUnit unit, String attachmentName)
+   {
+      return unit.removeAttachment(attachmentName + "." + ObjectName.class.getSimpleName(), ObjectName.class);
+   }
+
+   /**
+    * Extract root object name from parameters.
+    *
+    * @param server the mbean server
+    * @param unit the deployment unit
+    * @param metaData the metadata
+    * @return root's object name
+    * @throws IllegalArgumentException for any error
+    */
+   protected ObjectName extractRootObjectName(MBeanServer server, DeploymentUnit unit, T metaData)
+   {
+      try
+      {
+         // TODO - fake object name, this method should be made abstract!
+         return new ObjectName("jboss.service:type=" + metaData.getClass().getSimpleName() + ",unit=" + unit.getSimpleName());
+      }
+      catch (Throwable t)
+      {
+         throw new IllegalArgumentException("Cannot extract root ObjectName.", t);
+      }
+   }
+
+   /**
+    * Extract object names for components from parameters.
+    *
+    * @param server the mbean server
+    * @param unit the deployment unit
+    * @param metaData the metadata
+    * @return root's object name
+    * @throws IllegalArgumentException for any error
+    */
+   protected Iterable<ObjectName> extractComponentObjectNames(MBeanServer server, DeploymentUnit unit, T metaData)
+   {
+      // TODO - empty object names, this method should be made abstract!
+      return Collections.emptySet();
+   }
+
+   public void deploy(DeploymentUnit unit, T metaData) throws DeploymentException
+   {
+      if (server != null && unit instanceof VFSDeploymentUnit == requiresVFSDeployment)
+      {
+         try
+         {
+            deployJsr77(server, unit, metaData);
+         }
+         catch (Throwable t)
+         {
+            throw DeploymentException.rethrowAsDeploymentException("Cannot deploy jsr77.", t);
+         }
+      }
+      else if (log.isTraceEnabled())
+      {
+         log.trace("Missing mbean server or deployment unit type mismatch.");
+      }
+   }
+
+   public void undeploy(DeploymentUnit unit, T metaData)
+   {
+      if (server != null && unit instanceof VFSDeploymentUnit == requiresVFSDeployment)
+         undeployJsr77(server, unit, metaData);
+      else if (log.isTraceEnabled())
+         log.trace("Missing mbean server or deployment unit type mismatch.");
+   }
+}


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,73 +1,73 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.MBeanServer;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-
-/**
- * Abstract vfs jsr77 deployer.
- *
- * @param <T> exact input type
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public abstract class AbstractVFSJSR77Deployer<T> extends AbstractJSR77Deployer<T>
-{
-   protected AbstractVFSJSR77Deployer(Class<T> input)
-   {
-      super(input);
-      setRequiresVFSDeployment(true);
-   }
-
-   protected void deployJsr77(MBeanServer server, DeploymentUnit unit, T metaData) throws Throwable
-   {
-      if (unit instanceof VFSDeploymentUnit)
-         deployJsr77(server, (VFSDeploymentUnit)unit, metaData);
-   }
-
-   /**
-    * Deploy jsr77 view.
-    *
-    * @param server the mbean server
-    * @param unit the deployment unit
-    * @param metaData the metadata
-    * @throws Throwable for any error
-    */
-   protected abstract void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, T metaData) throws Throwable;
-
-   protected void undeployJsr77(MBeanServer server, DeploymentUnit unit, T metaData)
-   {
-      if (unit instanceof VFSDeploymentUnit)
-         undeployJsr77(server, (VFSDeploymentUnit)unit, metaData);
-   }
-
-   /**
-    * Undeploy jsr77 view.
-    *
-    * @param server the mbean server
-    * @param unit the deployment unit
-    * @param metaData the metadata
-    */
-   protected abstract void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, T metaData);
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.MBeanServer;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+
+/**
+ * Abstract vfs jsr77 deployer.
+ *
+ * @param <T> exact input type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class AbstractVFSJSR77Deployer<T> extends AbstractJSR77Deployer<T>
+{
+   protected AbstractVFSJSR77Deployer(Class<T> input)
+   {
+      super(input);
+      setRequiresVFSDeployment(true);
+   }
+
+   protected void deployJsr77(MBeanServer server, DeploymentUnit unit, T metaData) throws Throwable
+   {
+      if (unit instanceof VFSDeploymentUnit)
+         deployJsr77(server, (VFSDeploymentUnit)unit, metaData);
+   }
+
+   /**
+    * Deploy jsr77 view.
+    *
+    * @param server the mbean server
+    * @param unit the deployment unit
+    * @param metaData the metadata
+    * @throws Throwable for any error
+    */
+   protected abstract void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, T metaData) throws Throwable;
+
+   protected void undeployJsr77(MBeanServer server, DeploymentUnit unit, T metaData)
+   {
+      if (unit instanceof VFSDeploymentUnit)
+         undeployJsr77(server, (VFSDeploymentUnit)unit, metaData);
+   }
+
+   /**
+    * Undeploy jsr77 view.
+    *
+    * @param server the mbean server
+    * @param unit the deployment unit
+    * @param metaData the metadata
+    */
+   protected abstract void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, T metaData);
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,63 +1,63 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.management.j2ee.J2EEApplication;
-import org.jboss.metadata.ear.jboss.JBossAppMetaData;
-
-/**
- * Ear module jsr77 view.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class EarModuleJSR77Deployer extends AbstractVFSJSR77Deployer<JBossAppMetaData>
-{
-   public EarModuleJSR77Deployer()
-   {
-      super(JBossAppMetaData.class);
-      setTopLevelOnly(true);
-   }
-
-   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossAppMetaData metaData) throws Throwable
-   {
-      ObjectName jsr77Name = J2EEApplication.create(server, unit.getSimpleName(), unit.getRoot().toURL());
-      if (jsr77Name != null)
-      {
-         putObjectName(unit, J2EEApplication.class.getName(), jsr77Name);
-         log.debug("Created J2EEApplication: " + jsr77Name);
-      }
-   }
-
-   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossAppMetaData metaData)
-   {
-      ObjectName jsr77Name = removeObjectName(unit, J2EEApplication.class.getName());
-      if (jsr77Name != null)
-      {
-         J2EEApplication.destroy(server, jsr77Name);
-         log.debug("Removed J2EEApplication: " + jsr77Name);
-      }
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.management.j2ee.J2EEApplication;
+import org.jboss.metadata.ear.jboss.JBossAppMetaData;
+
+/**
+ * Ear module jsr77 view.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class EarModuleJSR77Deployer extends AbstractVFSJSR77Deployer<JBossAppMetaData>
+{
+   public EarModuleJSR77Deployer()
+   {
+      super(JBossAppMetaData.class);
+      setTopLevelOnly(true);
+   }
+
+   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossAppMetaData metaData) throws Throwable
+   {
+      ObjectName jsr77Name = J2EEApplication.create(server, unit.getSimpleName(), unit.getRoot().toURL());
+      if (jsr77Name != null)
+      {
+         putObjectName(unit, J2EEApplication.class.getName(), jsr77Name);
+         log.debug("Created J2EEApplication: " + jsr77Name);
+      }
+   }
+
+   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossAppMetaData metaData)
+   {
+      ObjectName jsr77Name = removeObjectName(unit, J2EEApplication.class.getName());
+      if (jsr77Name != null)
+      {
+         J2EEApplication.destroy(server, jsr77Name);
+         log.debug("Removed J2EEApplication: " + jsr77Name);
+      }
+   }
+}


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,141 +1,141 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.ejb.EjbModule;
-import org.jboss.management.j2ee.EJB;
-import org.jboss.management.j2ee.EJBModule;
-import org.jboss.management.j2ee.factory.FactoryUtils;
-import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.SessionMetaData;
-import org.jboss.metadata.ejb.jboss.JBossMetaData;
-
-/**
- * Ejb module jsr77 view.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class EjbModuleJSR77Deployer extends AbstractVFSJSR77Deployer<JBossMetaData>
-{
-   public EjbModuleJSR77Deployer()
-   {
-      super(JBossMetaData.class);
-   }
-
-   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossMetaData metaData) throws Throwable
-   {
-      String ejbJarName = unit.getSimpleName();
-      ObjectName ejbModuleService = extractRootObjectName(server, unit, metaData); // TODO
-      ObjectName jsr77Name = EJBModule.create(server, FactoryUtils.findEarParent(unit), ejbJarName, unit.getRoot().toURL(), ejbModuleService);
-      putObjectName(unit, ejbModuleService.getCanonicalName(), jsr77Name);
-      putObjectName(unit, EJBModule.class.getName(), jsr77Name);
-      log.debug("Created module: " + jsr77Name);
-      Iterable<ObjectName> ejbs = extractComponentObjectNames(server, unit, metaData); // TODO
-      for (ObjectName containerName : ejbs)
-      {
-         createEJB(server, unit, containerName);
-      }
-   }
-
-   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossMetaData metaData)
-   {
-      ObjectName jsr77Name = removeObjectName(unit, EJBModule.class.getName());
-      log.debug("Destroy module: " + jsr77Name);
-      Iterable<ObjectName> ejbs = extractComponentObjectNames(server, unit, metaData); // TODO
-      for (ObjectName containerName : ejbs)
-      {
-         destroyEJB(server, unit, containerName);
-      }
-      if (jsr77Name != null)
-      {
-         EJBModule.destroy(server, jsr77Name);
-      }
-      ObjectName ejbModuleService = extractRootObjectName(server, unit, metaData); // TODO
-      if (ejbModuleService != null)
-         removeObjectName(unit, ejbModuleService.getCanonicalName());
-   }
-
-   /**
-    * Create an EJB mbean for the container
-    *
-    * @param server - the deployment server
-    * @param unit the deployment unit
-    * @param containerName - the internal ejb container jmx name
-    * @return JSR77 ObjectName of the EJB mbean subtype
-    */
-   @SuppressWarnings("deprecation")
-   public ObjectName createEJB(MBeanServer server, VFSDeploymentUnit unit, ObjectName containerName)
-   {
-      ObjectName jsr77Name = null;
-      try
-      {
-         BeanMetaData metaData = (BeanMetaData) server.getAttribute(containerName, "BeanMetaData");
-         EjbModule ejbModule = (EjbModule) server.getAttribute(containerName, "EjbModule");
-         ObjectName ejbModName = getObjectName(unit, ejbModule.getServiceName().getCanonicalName());
-         String ejbName = metaData.getEjbName();
-         String jndiName = metaData.getJndiName();
-         String localJndiName = metaData.getLocalJndiName();
-         int type = EJB.STATELESS_SESSION_BEAN;
-         if (metaData.isSession())
-         {
-            SessionMetaData smetaData = (SessionMetaData) metaData;
-            if (smetaData.isStateful())
-               type = EJB.STATEFUL_SESSION_BEAN;
-         }
-         else if (metaData.isMessageDriven())
-            type = EJB.MESSAGE_DRIVEN_BEAN;
-         else
-            type = EJB.ENTITY_BEAN;
-
-         jsr77Name = EJB.create(server, ejbModName, containerName, type, ejbName, jndiName, localJndiName);
-         putObjectName(unit, containerName.getCanonicalName(), jsr77Name);
-         log.debug("Create container: " + containerName + ", module: " + jsr77Name);
-      }
-      catch (Exception e)
-      {
-         log.debug("", e);
-      }
-
-      return jsr77Name;
-   }
-
-   /**
-    * Destory JSR-77 J2EEApplication
-    *
-    * @param server the MBeanServer context
-    * @param unit the deployment unit
-    * @param containerName   arbitrary data associated with the creation context
-    */
-   public void destroyEJB(MBeanServer server, VFSDeploymentUnit unit, ObjectName containerName)
-   {
-      ObjectName jsr77Name = removeObjectName(unit, containerName.getCanonicalName());
-      log.debug("Destroy container: " + containerName + ", module: " + jsr77Name);
-      if (jsr77Name != null)
-      {
-         EJB.destroy(server, jsr77Name);
-      }
-   }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.ejb.EjbModule;
+import org.jboss.management.j2ee.EJB;
+import org.jboss.management.j2ee.EJBModule;
+import org.jboss.management.j2ee.factory.FactoryUtils;
+import org.jboss.metadata.BeanMetaData;
+import org.jboss.metadata.SessionMetaData;
+import org.jboss.metadata.ejb.jboss.JBossMetaData;
+
+/**
+ * Ejb module jsr77 view.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class EjbModuleJSR77Deployer extends AbstractVFSJSR77Deployer<JBossMetaData>
+{
+   public EjbModuleJSR77Deployer()
+   {
+      super(JBossMetaData.class);
+   }
+
+   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossMetaData metaData) throws Throwable
+   {
+      String ejbJarName = unit.getSimpleName();
+      ObjectName ejbModuleService = extractRootObjectName(server, unit, metaData); // TODO
+      ObjectName jsr77Name = EJBModule.create(server, FactoryUtils.findEarParent(unit), ejbJarName, unit.getRoot().toURL(), ejbModuleService);
+      putObjectName(unit, ejbModuleService.getCanonicalName(), jsr77Name);
+      putObjectName(unit, EJBModule.class.getName(), jsr77Name);
+      log.debug("Created module: " + jsr77Name);
+      Iterable<ObjectName> ejbs = extractComponentObjectNames(server, unit, metaData); // TODO
+      for (ObjectName containerName : ejbs)
+      {
+         createEJB(server, unit, containerName);
+      }
+   }
+
+   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossMetaData metaData)
+   {
+      ObjectName jsr77Name = removeObjectName(unit, EJBModule.class.getName());
+      log.debug("Destroy module: " + jsr77Name);
+      Iterable<ObjectName> ejbs = extractComponentObjectNames(server, unit, metaData); // TODO
+      for (ObjectName containerName : ejbs)
+      {
+         destroyEJB(server, unit, containerName);
+      }
+      if (jsr77Name != null)
+      {
+         EJBModule.destroy(server, jsr77Name);
+      }
+      ObjectName ejbModuleService = extractRootObjectName(server, unit, metaData); // TODO
+      if (ejbModuleService != null)
+         removeObjectName(unit, ejbModuleService.getCanonicalName());
+   }
+
+   /**
+    * Create an EJB mbean for the container
+    *
+    * @param server - the deployment server
+    * @param unit the deployment unit
+    * @param containerName - the internal ejb container jmx name
+    * @return JSR77 ObjectName of the EJB mbean subtype
+    */
+   @SuppressWarnings("deprecation")
+   public ObjectName createEJB(MBeanServer server, VFSDeploymentUnit unit, ObjectName containerName)
+   {
+      ObjectName jsr77Name = null;
+      try
+      {
+         BeanMetaData metaData = (BeanMetaData) server.getAttribute(containerName, "BeanMetaData");
+         EjbModule ejbModule = (EjbModule) server.getAttribute(containerName, "EjbModule");
+         ObjectName ejbModName = getObjectName(unit, ejbModule.getServiceName().getCanonicalName());
+         String ejbName = metaData.getEjbName();
+         String jndiName = metaData.getJndiName();
+         String localJndiName = metaData.getLocalJndiName();
+         int type = EJB.STATELESS_SESSION_BEAN;
+         if (metaData.isSession())
+         {
+            SessionMetaData smetaData = (SessionMetaData) metaData;
+            if (smetaData.isStateful())
+               type = EJB.STATEFUL_SESSION_BEAN;
+         }
+         else if (metaData.isMessageDriven())
+            type = EJB.MESSAGE_DRIVEN_BEAN;
+         else
+            type = EJB.ENTITY_BEAN;
+
+         jsr77Name = EJB.create(server, ejbModName, containerName, type, ejbName, jndiName, localJndiName);
+         putObjectName(unit, containerName.getCanonicalName(), jsr77Name);
+         log.debug("Create container: " + containerName + ", module: " + jsr77Name);
+      }
+      catch (Exception e)
+      {
+         log.debug("", e);
+      }
+
+      return jsr77Name;
+   }
+
+   /**
+    * Destory JSR-77 J2EEApplication
+    *
+    * @param server the MBeanServer context
+    * @param unit the deployment unit
+    * @param containerName   arbitrary data associated with the creation context
+    */
+   public void destroyEJB(MBeanServer server, VFSDeploymentUnit unit, ObjectName containerName)
+   {
+      ObjectName jsr77Name = removeObjectName(unit, containerName.getCanonicalName());
+      log.debug("Destroy container: " + containerName + ", module: " + jsr77Name);
+      if (jsr77Name != null)
+      {
+         EJB.destroy(server, jsr77Name);
+      }
+   }
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,114 +1,114 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.management.j2ee.JCAResource;
-import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
-
-/**
- * JCA resource jsr77 deployer.
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class JCAResourceJSR77Deployer extends AbstractJSR77Deployer<ManagedConnectionFactoryDeploymentGroup>
-{
-   public JCAResourceJSR77Deployer()
-   {
-      super(ManagedConnectionFactoryDeploymentGroup.class);
-   }
-
-   protected void deployJsr77(MBeanServer server, DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup metaData) throws Throwable
-   {
-      /* Get the RARDeployment service name by looking for the mbean in the
-      deployment with a name matching service=xxxDS. This relies on the naming
-      pattern created by the JCA CM deployer.
-      */
-      ObjectName rarDeployService = null;
-      ObjectName cmService = null;
-      ObjectName poolService = null;
-      Iterable<ObjectName> iter = extractComponentObjectNames(server, unit, metaData); // TODO
-      for (ObjectName oname : iter)
-      {
-         String name = oname.getKeyProperty("service");
-         if (name.equals("ManagedConnectionFactory") || name.endsWith("DS"))
-            rarDeployService = oname;
-         else if (name.endsWith("CM"))
-            cmService = oname;
-         else if (name.endsWith("Pool"))
-            poolService = oname;
-      }
-      if (rarDeployService == null || cmService == null)
-      {
-         log.debug("Failed to find a service=xxxDS match");
-         return;
-      }
-
-      try
-      {
-         /* Now to tie this CM back to its rar query the rarDeployService for
-            the org.jboss.resource.RARDeployment service created by the RARDeployer.
-          */
-         ObjectName rarService = (ObjectName) server.getAttribute(rarDeployService, "OldRarDeployment");
-         // Get the ResourceAdapter JSR77 name
-         ObjectName jsr77RAName = getObjectName(unit, rarService.getCanonicalName());
-         // Now build the JCAResource
-         String resName = rarDeployService.getKeyProperty("name");
-         JCAResource.create(server, resName, jsr77RAName, cmService, rarDeployService, poolService);
-      }
-      catch (Exception e)
-      {
-         log.debug("Failed to create JCAResource", e);
-      }
-   }
-
-   protected void undeployJsr77(MBeanServer server, DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup metaData)
-   {
-      Iterable<ObjectName> mbeans = extractComponentObjectNames(server, unit, metaData); // TODO
-      String resName = getDeploymentResName(mbeans);
-      JCAResource.destroy(server, resName);
-   }
-
-   private String getDeploymentResName(Iterable<ObjectName> mbeans)
-   {
-      String resName = null;
-      /* Get the RARDeployment service name by looking for the mbean in the
-         deployment with a name matching service=xxxDS. This relies on the naming
-         pattern created by the JCA CM deployer.
-      */
-      ObjectName rarDeployService;
-      for (ObjectName oname : mbeans)
-      {
-         String name = oname.getKeyProperty("service");
-         if (name.equals("ManagedConnectionFactory") || name.endsWith("DS"))
-         {
-            rarDeployService = oname;
-            resName = rarDeployService.getKeyProperty("name");
-            break;
-         }
-      }
-      return resName;
-   }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.management.j2ee.JCAResource;
+import org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup;
+
+/**
+ * JCA resource jsr77 deployer.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JCAResourceJSR77Deployer extends AbstractJSR77Deployer<ManagedConnectionFactoryDeploymentGroup>
+{
+   public JCAResourceJSR77Deployer()
+   {
+      super(ManagedConnectionFactoryDeploymentGroup.class);
+   }
+
+   protected void deployJsr77(MBeanServer server, DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup metaData) throws Throwable
+   {
+      /* Get the RARDeployment service name by looking for the mbean in the
+      deployment with a name matching service=xxxDS. This relies on the naming
+      pattern created by the JCA CM deployer.
+      */
+      ObjectName rarDeployService = null;
+      ObjectName cmService = null;
+      ObjectName poolService = null;
+      Iterable<ObjectName> iter = extractComponentObjectNames(server, unit, metaData); // TODO
+      for (ObjectName oname : iter)
+      {
+         String name = oname.getKeyProperty("service");
+         if (name.equals("ManagedConnectionFactory") || name.endsWith("DS"))
+            rarDeployService = oname;
+         else if (name.endsWith("CM"))
+            cmService = oname;
+         else if (name.endsWith("Pool"))
+            poolService = oname;
+      }
+      if (rarDeployService == null || cmService == null)
+      {
+         log.debug("Failed to find a service=xxxDS match");
+         return;
+      }
+
+      try
+      {
+         /* Now to tie this CM back to its rar query the rarDeployService for
+            the org.jboss.resource.RARDeployment service created by the RARDeployer.
+          */
+         ObjectName rarService = (ObjectName) server.getAttribute(rarDeployService, "OldRarDeployment");
+         // Get the ResourceAdapter JSR77 name
+         ObjectName jsr77RAName = getObjectName(unit, rarService.getCanonicalName());
+         // Now build the JCAResource
+         String resName = rarDeployService.getKeyProperty("name");
+         JCAResource.create(server, resName, jsr77RAName, cmService, rarDeployService, poolService);
+      }
+      catch (Exception e)
+      {
+         log.debug("Failed to create JCAResource", e);
+      }
+   }
+
+   protected void undeployJsr77(MBeanServer server, DeploymentUnit unit, ManagedConnectionFactoryDeploymentGroup metaData)
+   {
+      Iterable<ObjectName> mbeans = extractComponentObjectNames(server, unit, metaData); // TODO
+      String resName = getDeploymentResName(mbeans);
+      JCAResource.destroy(server, resName);
+   }
+
+   private String getDeploymentResName(Iterable<ObjectName> mbeans)
+   {
+      String resName = null;
+      /* Get the RARDeployment service name by looking for the mbean in the
+         deployment with a name matching service=xxxDS. This relies on the naming
+         pattern created by the JCA CM deployer.
+      */
+      ObjectName rarDeployService;
+      for (ObjectName oname : mbeans)
+      {
+         String name = oname.getKeyProperty("service");
+         if (name.equals("ManagedConnectionFactory") || name.endsWith("DS"))
+         {
+            rarDeployService = oname;
+            resName = rarDeployService.getKeyProperty("name");
+            break;
+         }
+      }
+      return resName;
+   }
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,94 +1,94 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import java.util.HashSet;
-import java.util.Set;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.management.j2ee.JMSResource;
-import org.jboss.system.metadata.ServiceMetaData;
-
-/**
- * JMS resource jsr77 deployer.
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class JMSResourceJSR77Deployer extends AbstractJSR77Deployer<ServiceMetaData>
-{
-   private Set<String> jmsCodes;
-
-   public JMSResourceJSR77Deployer()
-   {
-      super(ServiceMetaData.class);
-      setComponentsOnly(true);
-   }
-
-   /**
-    * Is service metadata jms resource.
-    *
-    * @param metaData the service metadata
-    * @return true if service metadata code matches one of jms codes
-    */
-   protected boolean isJMSServiceMetaData(ServiceMetaData metaData)
-   {
-      if (jmsCodes == null)
-      {
-         // fill in jms codes
-         jmsCodes = new HashSet<String>();
-         jmsCodes.add("org.jboss.jms.server.destination.QueueService");
-         jmsCodes.add("org.jboss.jms.server.destination.TopicService");
-      }
-
-      String code = metaData.getCode();
-      return jmsCodes.contains(code);
-   }
-
-   protected void deployJsr77(MBeanServer server, DeploymentUnit unit, ServiceMetaData metaData) throws Throwable
-   {
-      if (isJMSServiceMetaData(metaData))
-      {
-         ObjectName serviceName = metaData.getObjectName();
-         JMSResource.create(server, "LocalJMS", serviceName);
-      }
-   }
-
-   protected void undeployJsr77(MBeanServer server, DeploymentUnit unit, ServiceMetaData metaData)
-   {
-      if (isJMSServiceMetaData(metaData))
-      {
-         JMSResource.destroy(server, "LocalJMS");  
-      }
-   }
-
-   /**
-    * Set jms codes.
-    *
-    * @param jmsCodes the jms codes
-    */
-   public void setJmsCodes(Set<String> jmsCodes)
-   {
-      this.jmsCodes = jmsCodes;
-   }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import java.util.HashSet;
+import java.util.Set;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.management.j2ee.JMSResource;
+import org.jboss.system.metadata.ServiceMetaData;
+
+/**
+ * JMS resource jsr77 deployer.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class JMSResourceJSR77Deployer extends AbstractJSR77Deployer<ServiceMetaData>
+{
+   private Set<String> jmsCodes;
+
+   public JMSResourceJSR77Deployer()
+   {
+      super(ServiceMetaData.class);
+      setComponentsOnly(true);
+   }
+
+   /**
+    * Is service metadata jms resource.
+    *
+    * @param metaData the service metadata
+    * @return true if service metadata code matches one of jms codes
+    */
+   protected boolean isJMSServiceMetaData(ServiceMetaData metaData)
+   {
+      if (jmsCodes == null)
+      {
+         // fill in jms codes
+         jmsCodes = new HashSet<String>();
+         jmsCodes.add("org.jboss.jms.server.destination.QueueService");
+         jmsCodes.add("org.jboss.jms.server.destination.TopicService");
+      }
+
+      String code = metaData.getCode();
+      return jmsCodes.contains(code);
+   }
+
+   protected void deployJsr77(MBeanServer server, DeploymentUnit unit, ServiceMetaData metaData) throws Throwable
+   {
+      if (isJMSServiceMetaData(metaData))
+      {
+         ObjectName serviceName = metaData.getObjectName();
+         JMSResource.create(server, "LocalJMS", serviceName);
+      }
+   }
+
+   protected void undeployJsr77(MBeanServer server, DeploymentUnit unit, ServiceMetaData metaData)
+   {
+      if (isJMSServiceMetaData(metaData))
+      {
+         JMSResource.destroy(server, "LocalJMS");  
+      }
+   }
+
+   /**
+    * Set jms codes.
+    *
+    * @param jmsCodes the jms codes
+    */
+   public void setJmsCodes(Set<String> jmsCodes)
+   {
+      this.jmsCodes = jmsCodes;
+   }
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomain.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomain.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomain.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,439 +1,439 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import java.net.InetAddress;
-import java.util.Set;
-import javax.management.JMException;
-import javax.management.MBeanException;
-import javax.management.MBeanServer;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectName;
-import javax.management.MBeanRegistration;
-
-import org.jboss.logging.Logger;
-import org.jboss.management.j2ee.J2EEDomain;
-import org.jboss.management.j2ee.J2EEServer;
-import org.jboss.management.j2ee.JVM;
-import org.jboss.management.j2ee.factory.DefaultManagedObjectFactoryMap;
-import org.jboss.management.j2ee.factory.ManagedObjectFactory;
-import org.jboss.management.j2ee.factory.ManagedObjectFactoryMap;
-import org.jboss.system.ServiceControllerMBean;
-import org.jboss.system.ServiceMBean;
-
-/**
- * Port of the old LocalJBossServerDomain to POJO.
- *
- * @author  <a href="mailto:andreas at jboss.org">Andreas Schaefer</a>
- * @author  <a href="mailto:scott.stark at jboss.org">Scott Stark</a>
- * @author  <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
- */
-public class LocalJBossServerDomain implements NotificationListener, LocalJBossServerDomainMBean, MBeanRegistration
-{
-   /**
-    * Class logger.
-    */
-   private static final Logger log = Logger.getLogger(LocalJBossServerDomain.class);
-
-   /** The mbean server */
-   private MBeanServer server;
-
-   /** The service name */
-   private ObjectName serviceName;
-
-   /**
-    * The name of the JNDI service
-    */
-   private ObjectName jndiService;
-   /**
-    * The name of the JTA service
-    */
-   private ObjectName jtaService;
-   /**
-    * The name of the UserTransaction service
-    */
-   private ObjectName userTxService;
-   /**
-    * The name of the JavaMail service
-    */
-   private ObjectName mailService;
-   /**
-    * The name of the RMI_IIOP service
-    */
-   private ObjectName rmiiiopService;
-   /**
-    * The name of the service which emites URL binding events
-    */
-   private ObjectName jndiBindingService;
-
-   /**
-    * A mapping of JMX notifications to ManagedObjectFactory instances
-    */
-   private ManagedObjectFactoryMap managedObjFactoryMap;
-
-   /**
-    * The managed factory map class
-    */
-   private Class<?> managedObjFactoryMapClass = DefaultManagedObjectFactoryMap.class;
-
-   /**
-    * @return The JNDI service mbean name
-    */
-   public ObjectName getJNDIService()
-   {
-      return jndiService;
-   }
-
-   /**
-    * @param name The JNDI service mbean name
-    */
-   public void setJNDIService(ObjectName name)
-   {
-      this.jndiService = name;
-   }
-
-   /**
-    * @return The JTA service mbean name
-    */
-   public ObjectName getJTAService()
-   {
-      return jtaService;
-   }
-
-   /**
-    * @param name The JTA service mbean name
-    */
-   public void setJTAService(ObjectName name)
-   {
-      this.jtaService = name;
-   }
-
-   /**
-    * @return The JavaMail service mbean name
-    */
-   public ObjectName getMailService()
-   {
-      return mailService;
-   }
-
-   /**
-    * @param name The JavaMail service mbean name
-    */
-   public void setMailService(ObjectName name)
-   {
-      this.mailService = name;
-   }
-
-   /**
-    * @return The UserTransaction service mbean name
-    */
-   public ObjectName getUserTransactionService()
-   {
-      return userTxService;
-   }
-
-   /**
-    * @param name The UserTransaction service mbean name
-    */
-   public void setUserTransactionService(ObjectName name)
-   {
-      this.userTxService = name;
-   }
-
-   /**
-    * @return The RMI/IIOP service mbean name
-    */
-   public ObjectName getRMI_IIOPService()
-   {
-      return rmiiiopService;
-   }
-
-   /**
-    * @param name The RMI/IIOP service mbean name
-    */
-   public void setRMI_IIOPService(ObjectName name)
-   {
-      this.rmiiiopService = name;
-   }
-
-   /**
-    * @return The Jndi binding service mbean name
-    */
-   public ObjectName getJndiBindingService()
-   {
-      return jndiBindingService;
-   }
-
-   /**
-    * @param name The Jndi binding service mbean name
-    */
-   public void setJndiBindingService(ObjectName name)
-   {
-      this.jndiBindingService = name;
-   }
-
-   /**
-    * @return The ManagementObjFactoryMap class
-    */
-   public Class<?> getManagementObjFactoryMapClass()
-   {
-      return managedObjFactoryMapClass;
-   }
-
-   /**
-    * @param cls The ManagementObjFactoryMap class
-    */
-   public void setManagementObjFactoryMapClass(Class<?> cls)
-   {
-      this.managedObjFactoryMapClass = cls;
-   }
-
-   public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
-   {
-      this.server = server;
-      this.serviceName = name;
-      return name;
-   }
-
-   public void postRegister(Boolean registrationDone)
-   {
-      if (registrationDone)
-      {
-         try
-         {
-            createService();
-         }
-         catch (Exception e)
-         {
-            throw new RuntimeException(e);
-         }
-      }
-   }
-
-   public void preDeregister() throws Exception
-   {
-      destroyService();
-   }
-
-   public void postDeregister()
-   {
-   }
-
-   /**
-    * The JMX nofication callback. Here we create/destroy JSR77 MBeans based
-    * on the create/destory notifications.
-    *
-    * @param msg      the notification msg
-    * @param handback currently unused
-    */
-   public void handleNotification(Notification msg, Object handback)
-   {
-      if (managedObjFactoryMap == null || server == null)
-      {
-         return;
-      }
-
-      log.debug("handleNotification: " + msg);
-      String type = msg.getType();
-      Object userData = msg.getUserData();
-      try
-      {
-         if (type.equals(ServiceMBean.CREATE_EVENT))
-         {
-            ManagedObjectFactory factory = managedObjFactoryMap.getFactory(msg);
-            if (factory != null)
-            {
-               factory.create(server, userData);
-            }
-         }
-         else if (type.equals(ServiceMBean.DESTROY_EVENT))
-         {
-            ManagedObjectFactory factory = managedObjFactoryMap.getFactory(msg);
-            if (factory != null)
-            {
-               factory.destroy(server, userData);
-            }
-         }
-      }
-      catch (Throwable t)
-      {
-         log.debug("Failed to handle event", t);
-      }
-   }
-
-   public String toString()
-   {
-      return "LocalJBossServerDomain { " + super.toString() + " }";
-   }
-
-   protected void createService() throws Exception
-   {
-      setupJ2EEMBeans();
-      registerWithController();
-      populateFactoryMap();
-   }
-
-   /**
-    * Called to destroy the service. This unregisters with all deployers and
-    * then removes all MBeans in this services domain to remove all JSR77
-    * beans.
-    *
-    * @throws Exception for any error
-    */
-   protected void destroyService() throws Exception
-   {
-      cleanupLeftoverMBeans();
-      unregisterWithController();
-   }
-
-   /**
-    * Build the ManagedObjectFactoryMap used to obtain the ManagedObjectFactory
-    * instances from notification msgs.
-    *
-    * @throws Exception for any error
-    */
-   private void populateFactoryMap() throws Exception
-   {
-      // Create the ManagedObjectFactoryMap
-      managedObjFactoryMap = (ManagedObjectFactoryMap) managedObjFactoryMapClass.newInstance();
-      managedObjFactoryMap.setJNDIResource(jndiService);
-      managedObjFactoryMap.setJTAResource(jtaService);
-      managedObjFactoryMap.setJTAResource(userTxService);
-      managedObjFactoryMap.setJavaMailResource(mailService);
-      managedObjFactoryMap.setRMI_IIOPResource(rmiiiopService);
-   }
-
-   /**
-    * Create the J2EEServer and JVM MBeans.
-    */
-   private void setupJ2EEMBeans()
-   {
-      // Create Server Component
-      try
-      {
-         log.debug("setupJ2EEMBeans(), create J2EEServer instance");
-         Package pkg = Package.getPackage("org.jboss");
-         String vendor = pkg.getSpecificationVendor();
-         String version = pkg.getImplementationVersion();
-         // Create the createService
-         J2EEDomain serverDomain = new J2EEDomain(serviceName.getDomain());
-         ObjectName domain = serverDomain.getObjectName();
-         server.registerMBean(serverDomain, domain);
-         // Create single Local J2EEServer MBean
-         J2EEServer j2eeServer = new J2EEServer("Local", domain, vendor, version);
-         ObjectName lServer = j2eeServer.getObjectName();
-         server.registerMBean(j2eeServer, lServer);
-
-         // Create the JVM MBean
-         String hostName = "localhost";
-         try
-         {
-            InetAddress lLocalHost = InetAddress.getLocalHost();
-            hostName = lLocalHost.getHostName();
-         }
-         catch (Exception e)
-         {
-            // Ignore when host address is not accessible (localhost is used instead)
-         }
-         String vmVendor = System.getProperty("java.vendor");
-         String vmVersion = System.getProperty("java.version");
-         String name = vmVendor + " " + vmVersion;
-         JVM jvm = new JVM(name, lServer, vmVersion, vmVendor, hostName);
-         ObjectName jvmName = jvm.getObjectName();
-         server.registerMBean(jvm, jvmName);
-      }
-      catch (JMException jme)
-      {
-         log.debug("setupJ2EEMBeans - unexpected JMException", jme);
-      }
-      catch (Exception e)
-      {
-         log.debug("setupJ2EEMBeans - unexpected exception", e);
-      }
-   }
-
-   /**
-    * Register as a listener of the ServiceControllerMBean
-    */
-   private void registerWithController()
-   {
-      try
-      {
-         server.addNotificationListener(ServiceControllerMBean.OBJECT_NAME, this, null, null);
-         log.debug("Registered as listener of: " + ServiceControllerMBean.OBJECT_NAME);
-      }
-      catch (JMException jme)
-      {
-         log.debug("unexpected exception", jme);
-      }
-      catch (Exception e)
-      {
-         log.debug("unexpected exception", e);
-      }
-   }
-
-   /**
-    * Unregister as a listener of the ServiceControllerMBean.
-    */
-   private void unregisterWithController()
-   {
-      try
-      {
-         server.removeNotificationListener(ServiceControllerMBean.OBJECT_NAME, this);
-         log.debug("UNRegistered as listener of: " + ServiceControllerMBean.OBJECT_NAME);
-      }
-      catch (JMException jme)
-      {
-         log.debug("unexpected exception", jme);
-      }
-      catch (Exception e)
-      {
-         log.debug("unexpected exception", e);
-      }
-   }
-
-   /**
-    * Query for all mbeans in this services domain and unregisters them.
-    *
-    * @throws Exception if the domain query fails
-    */
-   private void cleanupLeftoverMBeans() throws Exception
-   {
-      String domain = serviceName.getDomain();
-      ObjectName domainName = new ObjectName(domain + ":*");
-      Set domainNames = server.queryNames(domainName, null);
-      log.debug("Found " + domainNames.size() + " domain mbeans");
-      for (Object name : domainNames)
-      {
-         try
-         {
-            ObjectName oname = (ObjectName)name;
-            if (oname.equals(serviceName) == false)
-               server.unregisterMBean(oname);
-         }
-         catch (MBeanException ignore)
-         {
-         }
-      }
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import java.net.InetAddress;
+import java.util.Set;
+import javax.management.JMException;
+import javax.management.MBeanException;
+import javax.management.MBeanServer;
+import javax.management.Notification;
+import javax.management.NotificationListener;
+import javax.management.ObjectName;
+import javax.management.MBeanRegistration;
+
+import org.jboss.logging.Logger;
+import org.jboss.management.j2ee.J2EEDomain;
+import org.jboss.management.j2ee.J2EEServer;
+import org.jboss.management.j2ee.JVM;
+import org.jboss.management.j2ee.factory.DefaultManagedObjectFactoryMap;
+import org.jboss.management.j2ee.factory.ManagedObjectFactory;
+import org.jboss.management.j2ee.factory.ManagedObjectFactoryMap;
+import org.jboss.system.ServiceControllerMBean;
+import org.jboss.system.ServiceMBean;
+
+/**
+ * Port of the old LocalJBossServerDomain to POJO.
+ *
+ * @author  <a href="mailto:andreas at jboss.org">Andreas Schaefer</a>
+ * @author  <a href="mailto:scott.stark at jboss.org">Scott Stark</a>
+ * @author  <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class LocalJBossServerDomain implements NotificationListener, LocalJBossServerDomainMBean, MBeanRegistration
+{
+   /**
+    * Class logger.
+    */
+   private static final Logger log = Logger.getLogger(LocalJBossServerDomain.class);
+
+   /** The mbean server */
+   private MBeanServer server;
+
+   /** The service name */
+   private ObjectName serviceName;
+
+   /**
+    * The name of the JNDI service
+    */
+   private ObjectName jndiService;
+   /**
+    * The name of the JTA service
+    */
+   private ObjectName jtaService;
+   /**
+    * The name of the UserTransaction service
+    */
+   private ObjectName userTxService;
+   /**
+    * The name of the JavaMail service
+    */
+   private ObjectName mailService;
+   /**
+    * The name of the RMI_IIOP service
+    */
+   private ObjectName rmiiiopService;
+   /**
+    * The name of the service which emites URL binding events
+    */
+   private ObjectName jndiBindingService;
+
+   /**
+    * A mapping of JMX notifications to ManagedObjectFactory instances
+    */
+   private ManagedObjectFactoryMap managedObjFactoryMap;
+
+   /**
+    * The managed factory map class
+    */
+   private Class<?> managedObjFactoryMapClass = DefaultManagedObjectFactoryMap.class;
+
+   /**
+    * @return The JNDI service mbean name
+    */
+   public ObjectName getJNDIService()
+   {
+      return jndiService;
+   }
+
+   /**
+    * @param name The JNDI service mbean name
+    */
+   public void setJNDIService(ObjectName name)
+   {
+      this.jndiService = name;
+   }
+
+   /**
+    * @return The JTA service mbean name
+    */
+   public ObjectName getJTAService()
+   {
+      return jtaService;
+   }
+
+   /**
+    * @param name The JTA service mbean name
+    */
+   public void setJTAService(ObjectName name)
+   {
+      this.jtaService = name;
+   }
+
+   /**
+    * @return The JavaMail service mbean name
+    */
+   public ObjectName getMailService()
+   {
+      return mailService;
+   }
+
+   /**
+    * @param name The JavaMail service mbean name
+    */
+   public void setMailService(ObjectName name)
+   {
+      this.mailService = name;
+   }
+
+   /**
+    * @return The UserTransaction service mbean name
+    */
+   public ObjectName getUserTransactionService()
+   {
+      return userTxService;
+   }
+
+   /**
+    * @param name The UserTransaction service mbean name
+    */
+   public void setUserTransactionService(ObjectName name)
+   {
+      this.userTxService = name;
+   }
+
+   /**
+    * @return The RMI/IIOP service mbean name
+    */
+   public ObjectName getRMI_IIOPService()
+   {
+      return rmiiiopService;
+   }
+
+   /**
+    * @param name The RMI/IIOP service mbean name
+    */
+   public void setRMI_IIOPService(ObjectName name)
+   {
+      this.rmiiiopService = name;
+   }
+
+   /**
+    * @return The Jndi binding service mbean name
+    */
+   public ObjectName getJndiBindingService()
+   {
+      return jndiBindingService;
+   }
+
+   /**
+    * @param name The Jndi binding service mbean name
+    */
+   public void setJndiBindingService(ObjectName name)
+   {
+      this.jndiBindingService = name;
+   }
+
+   /**
+    * @return The ManagementObjFactoryMap class
+    */
+   public Class<?> getManagementObjFactoryMapClass()
+   {
+      return managedObjFactoryMapClass;
+   }
+
+   /**
+    * @param cls The ManagementObjFactoryMap class
+    */
+   public void setManagementObjFactoryMapClass(Class<?> cls)
+   {
+      this.managedObjFactoryMapClass = cls;
+   }
+
+   public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception
+   {
+      this.server = server;
+      this.serviceName = name;
+      return name;
+   }
+
+   public void postRegister(Boolean registrationDone)
+   {
+      if (registrationDone)
+      {
+         try
+         {
+            createService();
+         }
+         catch (Exception e)
+         {
+            throw new RuntimeException(e);
+         }
+      }
+   }
+
+   public void preDeregister() throws Exception
+   {
+      destroyService();
+   }
+
+   public void postDeregister()
+   {
+   }
+
+   /**
+    * The JMX nofication callback. Here we create/destroy JSR77 MBeans based
+    * on the create/destory notifications.
+    *
+    * @param msg      the notification msg
+    * @param handback currently unused
+    */
+   public void handleNotification(Notification msg, Object handback)
+   {
+      if (managedObjFactoryMap == null || server == null)
+      {
+         return;
+      }
+
+      log.debug("handleNotification: " + msg);
+      String type = msg.getType();
+      Object userData = msg.getUserData();
+      try
+      {
+         if (type.equals(ServiceMBean.CREATE_EVENT))
+         {
+            ManagedObjectFactory factory = managedObjFactoryMap.getFactory(msg);
+            if (factory != null)
+            {
+               factory.create(server, userData);
+            }
+         }
+         else if (type.equals(ServiceMBean.DESTROY_EVENT))
+         {
+            ManagedObjectFactory factory = managedObjFactoryMap.getFactory(msg);
+            if (factory != null)
+            {
+               factory.destroy(server, userData);
+            }
+         }
+      }
+      catch (Throwable t)
+      {
+         log.debug("Failed to handle event", t);
+      }
+   }
+
+   public String toString()
+   {
+      return "LocalJBossServerDomain { " + super.toString() + " }";
+   }
+
+   protected void createService() throws Exception
+   {
+      setupJ2EEMBeans();
+      registerWithController();
+      populateFactoryMap();
+   }
+
+   /**
+    * Called to destroy the service. This unregisters with all deployers and
+    * then removes all MBeans in this services domain to remove all JSR77
+    * beans.
+    *
+    * @throws Exception for any error
+    */
+   protected void destroyService() throws Exception
+   {
+      cleanupLeftoverMBeans();
+      unregisterWithController();
+   }
+
+   /**
+    * Build the ManagedObjectFactoryMap used to obtain the ManagedObjectFactory
+    * instances from notification msgs.
+    *
+    * @throws Exception for any error
+    */
+   private void populateFactoryMap() throws Exception
+   {
+      // Create the ManagedObjectFactoryMap
+      managedObjFactoryMap = (ManagedObjectFactoryMap) managedObjFactoryMapClass.newInstance();
+      managedObjFactoryMap.setJNDIResource(jndiService);
+      managedObjFactoryMap.setJTAResource(jtaService);
+      managedObjFactoryMap.setJTAResource(userTxService);
+      managedObjFactoryMap.setJavaMailResource(mailService);
+      managedObjFactoryMap.setRMI_IIOPResource(rmiiiopService);
+   }
+
+   /**
+    * Create the J2EEServer and JVM MBeans.
+    */
+   private void setupJ2EEMBeans()
+   {
+      // Create Server Component
+      try
+      {
+         log.debug("setupJ2EEMBeans(), create J2EEServer instance");
+         Package pkg = Package.getPackage("org.jboss");
+         String vendor = pkg.getSpecificationVendor();
+         String version = pkg.getImplementationVersion();
+         // Create the createService
+         J2EEDomain serverDomain = new J2EEDomain(serviceName.getDomain());
+         ObjectName domain = serverDomain.getObjectName();
+         server.registerMBean(serverDomain, domain);
+         // Create single Local J2EEServer MBean
+         J2EEServer j2eeServer = new J2EEServer("Local", domain, vendor, version);
+         ObjectName lServer = j2eeServer.getObjectName();
+         server.registerMBean(j2eeServer, lServer);
+
+         // Create the JVM MBean
+         String hostName = "localhost";
+         try
+         {
+            InetAddress lLocalHost = InetAddress.getLocalHost();
+            hostName = lLocalHost.getHostName();
+         }
+         catch (Exception e)
+         {
+            // Ignore when host address is not accessible (localhost is used instead)
+         }
+         String vmVendor = System.getProperty("java.vendor");
+         String vmVersion = System.getProperty("java.version");
+         String name = vmVendor + " " + vmVersion;
+         JVM jvm = new JVM(name, lServer, vmVersion, vmVendor, hostName);
+         ObjectName jvmName = jvm.getObjectName();
+         server.registerMBean(jvm, jvmName);
+      }
+      catch (JMException jme)
+      {
+         log.debug("setupJ2EEMBeans - unexpected JMException", jme);
+      }
+      catch (Exception e)
+      {
+         log.debug("setupJ2EEMBeans - unexpected exception", e);
+      }
+   }
+
+   /**
+    * Register as a listener of the ServiceControllerMBean
+    */
+   private void registerWithController()
+   {
+      try
+      {
+         server.addNotificationListener(ServiceControllerMBean.OBJECT_NAME, this, null, null);
+         log.debug("Registered as listener of: " + ServiceControllerMBean.OBJECT_NAME);
+      }
+      catch (JMException jme)
+      {
+         log.debug("unexpected exception", jme);
+      }
+      catch (Exception e)
+      {
+         log.debug("unexpected exception", e);
+      }
+   }
+
+   /**
+    * Unregister as a listener of the ServiceControllerMBean.
+    */
+   private void unregisterWithController()
+   {
+      try
+      {
+         server.removeNotificationListener(ServiceControllerMBean.OBJECT_NAME, this);
+         log.debug("UNRegistered as listener of: " + ServiceControllerMBean.OBJECT_NAME);
+      }
+      catch (JMException jme)
+      {
+         log.debug("unexpected exception", jme);
+      }
+      catch (Exception e)
+      {
+         log.debug("unexpected exception", e);
+      }
+   }
+
+   /**
+    * Query for all mbeans in this services domain and unregisters them.
+    *
+    * @throws Exception if the domain query fails
+    */
+   private void cleanupLeftoverMBeans() throws Exception
+   {
+      String domain = serviceName.getDomain();
+      ObjectName domainName = new ObjectName(domain + ":*");
+      Set domainNames = server.queryNames(domainName, null);
+      log.debug("Found " + domainNames.size() + " domain mbeans");
+      for (Object name : domainNames)
+      {
+         try
+         {
+            ObjectName oname = (ObjectName)name;
+            if (oname.equals(serviceName) == false)
+               server.unregisterMBean(oname);
+         }
+         catch (MBeanException ignore)
+         {
+         }
+      }
+   }
+}


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomain.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomainMBean.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomainMBean.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomainMBean.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,53 +1,53 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.ObjectName;
-
-/**
- * Reduced port of the old LocalJBossServerDomainMBean.
- *  
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public interface LocalJBossServerDomainMBean
-{
-   ObjectName getJNDIService();
-   void setJNDIService(ObjectName name);
-
-   ObjectName getJTAService();
-   void setJTAService(ObjectName name);
-
-   ObjectName getMailService();
-   void setMailService(ObjectName name);
-
-   ObjectName getUserTransactionService();
-   void setUserTransactionService(ObjectName name);
-
-   ObjectName getRMI_IIOPService();
-   void setRMI_IIOPService(ObjectName name);
-
-   ObjectName getJndiBindingService();
-   void setJndiBindingService(ObjectName name);
-
-   Class<?> getManagementObjFactoryMapClass();
-   void setManagementObjFactoryMapClass(Class<?> cls);
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.ObjectName;
+
+/**
+ * Reduced port of the old LocalJBossServerDomainMBean.
+ *  
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public interface LocalJBossServerDomainMBean
+{
+   ObjectName getJNDIService();
+   void setJNDIService(ObjectName name);
+
+   ObjectName getJTAService();
+   void setJTAService(ObjectName name);
+
+   ObjectName getMailService();
+   void setMailService(ObjectName name);
+
+   ObjectName getUserTransactionService();
+   void setUserTransactionService(ObjectName name);
+
+   ObjectName getRMI_IIOPService();
+   void setRMI_IIOPService(ObjectName name);
+
+   ObjectName getJndiBindingService();
+   void setJndiBindingService(ObjectName name);
+
+   Class<?> getManagementObjFactoryMapClass();
+   void setManagementObjFactoryMapClass(Class<?> cls);
+}


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/LocalJBossServerDomainMBean.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,93 +1,93 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.management.j2ee.ResourceAdapter;
-import org.jboss.management.j2ee.ResourceAdapterModule;
-import org.jboss.management.j2ee.factory.FactoryUtils;
-import org.jboss.resource.metadata.ConnectorMetaData;
-import org.jboss.resource.metadata.RARDeploymentMetaData;
-
-/**
- * Rar module jsr77 deployer.
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class RarModuleJSR77Deployer extends AbstractVFSJSR77Deployer<RARDeploymentMetaData>
-{
-   public RarModuleJSR77Deployer()
-   {
-      super(RARDeploymentMetaData.class);
-   }
-
-   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, RARDeploymentMetaData rdmd) throws Throwable
-   {
-      ConnectorMetaData metaData = rdmd.getConnectorMetaData();
-      // Create the ResourceAdapterModule
-      String rarName = unit.getSimpleName();
-      ObjectName rarService = extractRootObjectName(server, unit, rdmd); // TODO
-      ObjectName jsr77ModuleName = ResourceAdapterModule.create(server, FactoryUtils.findEarParent(unit), rarName, unit.getRoot().toURL());
-      putObjectName(unit, ResourceAdapter.class.getName(), jsr77ModuleName);
-      log.debug("Created module: " + jsr77ModuleName);
-      // Create the ResourceAdapter
-      ObjectName jsr77RAName = ResourceAdapter.create(server, getDisplayName(unit, metaData), jsr77ModuleName, rarService);
-      // Register a mapping from the RARDeployment service to the ResourceAdapter
-      putObjectName(unit, rarService.getCanonicalName(), jsr77RAName);
-   }
-
-   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, RARDeploymentMetaData rdmd)
-   {
-      ConnectorMetaData metaData = rdmd.getConnectorMetaData();
-      ObjectName jsr77Name = removeObjectName(unit, ResourceAdapter.class.getName());
-      ResourceAdapter.destroy(server, getDisplayName(unit, metaData));
-      log.debug("Destroy module: " + jsr77Name);
-      if (jsr77Name != null)
-      {
-         ResourceAdapterModule.destroy(server, jsr77Name);
-      }
-      ObjectName rarService = extractRootObjectName(server, unit, rdmd); // TODO
-      if (rarService != null)
-         removeObjectName(unit, rarService.getCanonicalName());
-   }
-
-   /**
-    * Get display name.
-    *
-    * @param unit the deployment unit
-    * @param metaData the connector metadata
-    * @return metadata display name
-    */
-   protected String getDisplayName(VFSDeploymentUnit unit, ConnectorMetaData metaData)
-   {
-      String displayName = metaData.getDescription().getDisplayName();
-      if (displayName == null)
-      {
-         log.debug("ConnectorMetaData displayname is null: " + metaData);
-         displayName = unit.getSimpleName() + " [MISSING-DISPLAY-NAME]";
-      }
-      return displayName;
-   }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.management.j2ee.ResourceAdapter;
+import org.jboss.management.j2ee.ResourceAdapterModule;
+import org.jboss.management.j2ee.factory.FactoryUtils;
+import org.jboss.resource.metadata.ConnectorMetaData;
+import org.jboss.resource.metadata.RARDeploymentMetaData;
+
+/**
+ * Rar module jsr77 deployer.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class RarModuleJSR77Deployer extends AbstractVFSJSR77Deployer<RARDeploymentMetaData>
+{
+   public RarModuleJSR77Deployer()
+   {
+      super(RARDeploymentMetaData.class);
+   }
+
+   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, RARDeploymentMetaData rdmd) throws Throwable
+   {
+      ConnectorMetaData metaData = rdmd.getConnectorMetaData();
+      // Create the ResourceAdapterModule
+      String rarName = unit.getSimpleName();
+      ObjectName rarService = extractRootObjectName(server, unit, rdmd); // TODO
+      ObjectName jsr77ModuleName = ResourceAdapterModule.create(server, FactoryUtils.findEarParent(unit), rarName, unit.getRoot().toURL());
+      putObjectName(unit, ResourceAdapter.class.getName(), jsr77ModuleName);
+      log.debug("Created module: " + jsr77ModuleName);
+      // Create the ResourceAdapter
+      ObjectName jsr77RAName = ResourceAdapter.create(server, getDisplayName(unit, metaData), jsr77ModuleName, rarService);
+      // Register a mapping from the RARDeployment service to the ResourceAdapter
+      putObjectName(unit, rarService.getCanonicalName(), jsr77RAName);
+   }
+
+   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, RARDeploymentMetaData rdmd)
+   {
+      ConnectorMetaData metaData = rdmd.getConnectorMetaData();
+      ObjectName jsr77Name = removeObjectName(unit, ResourceAdapter.class.getName());
+      ResourceAdapter.destroy(server, getDisplayName(unit, metaData));
+      log.debug("Destroy module: " + jsr77Name);
+      if (jsr77Name != null)
+      {
+         ResourceAdapterModule.destroy(server, jsr77Name);
+      }
+      ObjectName rarService = extractRootObjectName(server, unit, rdmd); // TODO
+      if (rarService != null)
+         removeObjectName(unit, rarService.getCanonicalName());
+   }
+
+   /**
+    * Get display name.
+    *
+    * @param unit the deployment unit
+    * @param metaData the connector metadata
+    * @return metadata display name
+    */
+   protected String getDisplayName(VFSDeploymentUnit unit, ConnectorMetaData metaData)
+   {
+      String displayName = metaData.getDescription().getDisplayName();
+      if (displayName == null)
+      {
+         log.debug("ConnectorMetaData displayname is null: " + metaData);
+         displayName = unit.getSimpleName() + " [MISSING-DISPLAY-NAME]";
+      }
+      return displayName;
+   }
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,102 +1,102 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import java.util.List;
-import java.util.ListIterator;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.management.j2ee.MBean;
-import org.jboss.management.j2ee.ServiceModule;
-import org.jboss.system.metadata.ServiceDeployment;
-import org.jboss.system.metadata.ServiceMetaData;
-
-/**
- * Service module jsr77 deployer.
- * 
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class ServiceModuleJSR77Deployer extends AbstractVFSJSR77Deployer<ServiceDeployment>
-{
-   public ServiceModuleJSR77Deployer()
-   {
-      super(ServiceDeployment.class);
-   }
-
-   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, ServiceDeployment metaData) throws Throwable
-   {
-      ObjectName sarName = ServiceModule.create(server, unit.getSimpleName(), unit.getRoot().toURL());
-      if (sarName != null)
-      {
-         log.debug("Created ServiceModule: " + sarName);
-      }
-
-      List<ServiceMetaData> beans = metaData.getServices();
-      if (beans != null && beans.isEmpty() == false)
-      {
-         for (ServiceMetaData bean : beans)
-         {
-            ObjectName mbeanName = bean.getObjectName();
-            // Create JSR-77 MBean
-            MBean.create(server, sarName.toString(), mbeanName);
-            log.debug("Create MBean, name: " + mbeanName + ", SAR Module: " + sarName);
-         }
-      }
-   }
-
-   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, ServiceDeployment metaData)
-   {
-      List<ServiceMetaData> beans = metaData.getServices();
-      if (beans != null && beans.isEmpty() == false)
-      {
-         ListIterator<ServiceMetaData> iter = beans.listIterator(beans.size());
-         while(iter.hasPrevious())
-         {
-            ObjectName name = iter.previous().getObjectName();
-            try
-            {
-               // Destroy JSR-77 MBean
-               MBean.destroy(server, name.toString());
-               log.debug("Destroy MBean, name: " + name);
-            }
-            catch (Throwable e)
-            {
-               log.debug("Failed to remove remove JSR-77 MBean", e);
-            }
-         }
-      }
-
-      // Remove JSR-77 SAR-Module
-      String moduleName = unit.getSimpleName();
-      try
-      {
-         ServiceModule.destroy(server, moduleName);
-         log.debug("Removed JSR-77 SAR: " + moduleName);
-      }
-      catch (Throwable e)
-      {
-         log.debug("Failed to remove JSR-77 SAR: " + moduleName);
-      }
-   }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import java.util.List;
+import java.util.ListIterator;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.management.j2ee.MBean;
+import org.jboss.management.j2ee.ServiceModule;
+import org.jboss.system.metadata.ServiceDeployment;
+import org.jboss.system.metadata.ServiceMetaData;
+
+/**
+ * Service module jsr77 deployer.
+ * 
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ServiceModuleJSR77Deployer extends AbstractVFSJSR77Deployer<ServiceDeployment>
+{
+   public ServiceModuleJSR77Deployer()
+   {
+      super(ServiceDeployment.class);
+   }
+
+   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, ServiceDeployment metaData) throws Throwable
+   {
+      ObjectName sarName = ServiceModule.create(server, unit.getSimpleName(), unit.getRoot().toURL());
+      if (sarName != null)
+      {
+         log.debug("Created ServiceModule: " + sarName);
+      }
+
+      List<ServiceMetaData> beans = metaData.getServices();
+      if (beans != null && beans.isEmpty() == false)
+      {
+         for (ServiceMetaData bean : beans)
+         {
+            ObjectName mbeanName = bean.getObjectName();
+            // Create JSR-77 MBean
+            MBean.create(server, sarName.toString(), mbeanName);
+            log.debug("Create MBean, name: " + mbeanName + ", SAR Module: " + sarName);
+         }
+      }
+   }
+
+   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, ServiceDeployment metaData)
+   {
+      List<ServiceMetaData> beans = metaData.getServices();
+      if (beans != null && beans.isEmpty() == false)
+      {
+         ListIterator<ServiceMetaData> iter = beans.listIterator(beans.size());
+         while(iter.hasPrevious())
+         {
+            ObjectName name = iter.previous().getObjectName();
+            try
+            {
+               // Destroy JSR-77 MBean
+               MBean.destroy(server, name.toString());
+               log.debug("Destroy MBean, name: " + name);
+            }
+            catch (Throwable e)
+            {
+               log.debug("Failed to remove remove JSR-77 MBean", e);
+            }
+         }
+      }
+
+      // Remove JSR-77 SAR-Module
+      String moduleName = unit.getSimpleName();
+      try
+      {
+         ServiceModule.destroy(server, moduleName);
+         log.debug("Removed JSR-77 SAR: " + moduleName);
+      }
+      catch (Throwable e)
+      {
+         log.debug("Failed to remove JSR-77 SAR: " + moduleName);
+      }
+   }
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,139 +1,139 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
-import org.jboss.management.j2ee.Servlet;
-import org.jboss.management.j2ee.WebModule;
-import org.jboss.management.j2ee.factory.FactoryUtils;
-import org.jboss.metadata.web.jboss.JBossWebMetaData;
-
-/**
- * War module jsr77 view deployer.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class WebModuleJSR77Deployer extends AbstractVFSJSR77Deployer<JBossWebMetaData>
-{
-   public WebModuleJSR77Deployer()
-   {
-      super(JBossWebMetaData.class);
-   }
-
-   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossWebMetaData metaData) throws Throwable
-   {
-      String warName = unit.getSimpleName();
-      ObjectName webModuleService = extractRootObjectName(server, unit, metaData); // TODO
-      String earName = FactoryUtils.findEarParent(unit);
-      ObjectName jsr77Name = WebModule.create(server, earName, warName, unit.getRoot().toURL(), webModuleService);
-      putObjectName(unit, WebModule.class.getName(), jsr77Name);
-      Iterable<ObjectName> servlets = extractComponentObjectNames(server, unit, metaData); // TODO
-      for (ObjectName servletName : servlets)
-      {
-         try
-         {
-            createServlet(server, unit, jsr77Name, servletName);
-         }
-         catch (Throwable e)
-         {
-            log.debug("Failed to create JSR-77 servlet: " + servletName, e);
-         }
-      }
-   }
-
-   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossWebMetaData metaData)
-   {
-      ObjectName jsr77Name = removeObjectName(unit, WebModule.class.getName());
-      log.debug("Destroy module: " + jsr77Name);
-      Iterable<ObjectName> servlets = extractComponentObjectNames(server, unit, metaData); // TODO
-      for (ObjectName servletName : servlets)
-      {
-         try
-         {
-            destroyServlet(server, unit, servletName);
-         }
-         catch (Throwable e)
-         {
-            log.debug("Failed to destroy JSR-77 servlet: " + servletName, e);
-         }
-      }
-
-      if (jsr77Name != null)
-      {
-         WebModule.destroy(server, jsr77Name);
-      }
-   }
-
-   /**
-    * Create JSR-77 Servlet
-    *
-    * @param mbeanServer        the MBeanServer context
-    * @param unit the deployment unit
-    * @param webModuleName      the JSR77 name of the servlet's WebModule
-    * @param servletServiceName The jboss servlet mbean name
-    * @return servlet's jsr77 object name
-    */
-   public ObjectName createServlet(MBeanServer mbeanServer, VFSDeploymentUnit unit, ObjectName webModuleName, ObjectName servletServiceName)
-   {
-      ObjectName jsr77Name = null;
-      // We don't currently have a web container mbean
-      ObjectName webContainerName = null;
-      try
-      {
-         log.debug("Creating servlet: " + servletServiceName);
-         String servletName = servletServiceName.getKeyProperty("name");
-         if (servletName != null)
-         {
-            // Only treat resources with names as potential servlets
-            jsr77Name = Servlet.create(mbeanServer, webModuleName, webContainerName, servletServiceName);
-            putObjectName(unit, servletServiceName.getCanonicalName(), jsr77Name);
-            log.debug("Created servlet: " + servletServiceName + ", module: " + jsr77Name);
-         }
-      }
-      catch (Exception e)
-      {
-         log.debug("Failed to create servlet: " + servletServiceName, e);
-      }
-
-      return jsr77Name;
-   }
-
-   /**
-    * Destroy JSR-77 Servlet
-    *
-    * @param server        the MBeanServer context
-    * @param unit the deployment unit
-    * @param servletServiceName The jboss servlet mbean name
-    */
-   public void destroyServlet(MBeanServer server, VFSDeploymentUnit unit, ObjectName servletServiceName)
-   {
-      ObjectName jsr77Name = removeObjectName(unit, servletServiceName.getCanonicalName());
-      log.debug("Destroy container: " + servletServiceName + ", module: " + jsr77Name);
-      if (jsr77Name != null)
-      {
-         Servlet.destroy(server, jsr77Name);
-      }
-   }
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.deployers;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
+import org.jboss.management.j2ee.Servlet;
+import org.jboss.management.j2ee.WebModule;
+import org.jboss.management.j2ee.factory.FactoryUtils;
+import org.jboss.metadata.web.jboss.JBossWebMetaData;
+
+/**
+ * War module jsr77 view deployer.
+ *
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class WebModuleJSR77Deployer extends AbstractVFSJSR77Deployer<JBossWebMetaData>
+{
+   public WebModuleJSR77Deployer()
+   {
+      super(JBossWebMetaData.class);
+   }
+
+   protected void deployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossWebMetaData metaData) throws Throwable
+   {
+      String warName = unit.getSimpleName();
+      ObjectName webModuleService = extractRootObjectName(server, unit, metaData); // TODO
+      String earName = FactoryUtils.findEarParent(unit);
+      ObjectName jsr77Name = WebModule.create(server, earName, warName, unit.getRoot().toURL(), webModuleService);
+      putObjectName(unit, WebModule.class.getName(), jsr77Name);
+      Iterable<ObjectName> servlets = extractComponentObjectNames(server, unit, metaData); // TODO
+      for (ObjectName servletName : servlets)
+      {
+         try
+         {
+            createServlet(server, unit, jsr77Name, servletName);
+         }
+         catch (Throwable e)
+         {
+            log.debug("Failed to create JSR-77 servlet: " + servletName, e);
+         }
+      }
+   }
+
+   protected void undeployJsr77(MBeanServer server, VFSDeploymentUnit unit, JBossWebMetaData metaData)
+   {
+      ObjectName jsr77Name = removeObjectName(unit, WebModule.class.getName());
+      log.debug("Destroy module: " + jsr77Name);
+      Iterable<ObjectName> servlets = extractComponentObjectNames(server, unit, metaData); // TODO
+      for (ObjectName servletName : servlets)
+      {
+         try
+         {
+            destroyServlet(server, unit, servletName);
+         }
+         catch (Throwable e)
+         {
+            log.debug("Failed to destroy JSR-77 servlet: " + servletName, e);
+         }
+      }
+
+      if (jsr77Name != null)
+      {
+         WebModule.destroy(server, jsr77Name);
+      }
+   }
+
+   /**
+    * Create JSR-77 Servlet
+    *
+    * @param mbeanServer        the MBeanServer context
+    * @param unit the deployment unit
+    * @param webModuleName      the JSR77 name of the servlet's WebModule
+    * @param servletServiceName The jboss servlet mbean name
+    * @return servlet's jsr77 object name
+    */
+   public ObjectName createServlet(MBeanServer mbeanServer, VFSDeploymentUnit unit, ObjectName webModuleName, ObjectName servletServiceName)
+   {
+      ObjectName jsr77Name = null;
+      // We don't currently have a web container mbean
+      ObjectName webContainerName = null;
+      try
+      {
+         log.debug("Creating servlet: " + servletServiceName);
+         String servletName = servletServiceName.getKeyProperty("name");
+         if (servletName != null)
+         {
+            // Only treat resources with names as potential servlets
+            jsr77Name = Servlet.create(mbeanServer, webModuleName, webContainerName, servletServiceName);
+            putObjectName(unit, servletServiceName.getCanonicalName(), jsr77Name);
+            log.debug("Created servlet: " + servletServiceName + ", module: " + jsr77Name);
+         }
+      }
+      catch (Exception e)
+      {
+         log.debug("Failed to create servlet: " + servletServiceName, e);
+      }
+
+      return jsr77Name;
+   }
+
+   /**
+    * Destroy JSR-77 Servlet
+    *
+    * @param server        the MBeanServer context
+    * @param unit the deployment unit
+    * @param servletServiceName The jboss servlet mbean name
+    */
+   public void destroyServlet(MBeanServer server, VFSDeploymentUnit unit, ObjectName servletServiceName)
+   {
+      ObjectName jsr77Name = removeObjectName(unit, servletServiceName.getCanonicalName());
+      log.debug("Destroy container: " + servletServiceName + ", module: " + jsr77Name);
+      if (jsr77Name != null)
+      {
+         Servlet.destroy(server, jsr77Name);
+      }
+   }
 }
\ No newline at end of file


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java	2008-11-14 15:06:42 UTC (rev 81062)
+++ trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java	2008-11-14 15:07:19 UTC (rev 81063)
@@ -1,73 +1,73 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.factory;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.deployment.DeploymentInfo;
-
-/**
- * Common management factory utilities 
- *
- * @author Dimitris.Andreadis at jboss.org
- * @version $Revision: 57197 $
- */
-public final class FactoryUtils
-{
-   /**
-    * For a given DeploymentInfo instance return the shortname of the
-    * parent .ear, if one exists, or null.
-    * 
-    * @param di the module 
-    * @return .ear parent shortname, or null
-    */
-   public static String findEarParent(DeploymentInfo di)
-   {
-      if (di.parent != null && di.parent.shortName.endsWith(".ear"))
-      {
-         return di.parent.shortName;
-      }
-      else
-      {
-         return null;
-      }
-   }
-
-   /**
-    * For a given DeploymentUnit instance return the shortname of the
-    * parent .ear, if one exists, or null.
-    *
-    * @param di the module
-    * @return .ear parent shortname, or null
-    */
-   public static String findEarParent(DeploymentUnit di)
-   {
-      DeploymentUnit parent = di.getParent();
-      if (parent != null && parent.getSimpleName().endsWith(".ear"))
-      {
-         return parent.getSimpleName();
-      }
-      else
-      {
-         return null;
-      }
-   }
-}
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.management.j2ee.factory;
+
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployment.DeploymentInfo;
+
+/**
+ * Common management factory utilities 
+ *
+ * @author Dimitris.Andreadis at jboss.org
+ * @version $Revision: 57197 $
+ */
+public final class FactoryUtils
+{
+   /**
+    * For a given DeploymentInfo instance return the shortname of the
+    * parent .ear, if one exists, or null.
+    * 
+    * @param di the module 
+    * @return .ear parent shortname, or null
+    */
+   public static String findEarParent(DeploymentInfo di)
+   {
+      if (di.parent != null && di.parent.shortName.endsWith(".ear"))
+      {
+         return di.parent.shortName;
+      }
+      else
+      {
+         return null;
+      }
+   }
+
+   /**
+    * For a given DeploymentUnit instance return the shortname of the
+    * parent .ear, if one exists, or null.
+    *
+    * @param di the module
+    * @return .ear parent shortname, or null
+    */
+   public static String findEarParent(DeploymentUnit di)
+   {
+      DeploymentUnit parent = di.getParent();
+      if (parent != null && parent.getSimpleName().endsWith(".ear"))
+      {
+         return parent.getSimpleName();
+      }
+      else
+      {
+         return null;
+      }
+   }
+}


Property changes on: trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the jboss-cvs-commits mailing list