[jboss-cvs] JBossAS SVN: r79829 - in trunk: server/src/etc/deployers and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 21 08:46:05 EDT 2008
Author: alesj
Date: 2008-10-21 08:46:05 -0400 (Tue, 21 Oct 2008)
New Revision: 79829
Added:
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/RarModuleJSR77Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java
Removed:
trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR277Deployer.java
trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR277Deployer.java
Modified:
trunk/server/src/etc/deployers/jsr77-deployers-jboss-beans.xml
Log:
Rename deployers - 277 --> 77.
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,191 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 AbstractJSR277Deployer<T> extends AbstractSimpleRealDeployer<T>
-{
- private boolean requiresVFSDeployment;
-
- private MBeanServer server;
-
- protected AbstractJSR277Deployer(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)
- {
- 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.");
- }
-}
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,191 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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)
+ {
+ 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.");
+ }
+}
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,73 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 AbstractVFSJSR277Deployer<T> extends AbstractJSR277Deployer<T>
-{
- protected AbstractVFSJSR277Deployer(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
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/AbstractVFSJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 EarModuleJSR277Deployer extends AbstractVFSJSR277Deployer<JBossAppMetaData>
-{
- public EarModuleJSR277Deployer()
- {
- 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);
- }
- }
-}
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/EarModuleJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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);
+ }
+ }
+}
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,141 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 EjbModuleJSR277Deployer extends AbstractVFSJSR277Deployer<JBossMetaData>
-{
- public EjbModuleJSR277Deployer()
- {
- 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
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/EjbModuleJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,141 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,114 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 JCAResourceJSR277Deployer extends AbstractJSR277Deployer<ManagedConnectionFactoryDeploymentGroup>
-{
- public JCAResourceJSR277Deployer()
- {
- 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
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/JCAResourceJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,114 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,94 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 JMSResourceJSR277Deployer extends AbstractJSR277Deployer<ServiceMetaData>
-{
- private Set<String> jmsCodes;
-
- public JMSResourceJSR277Deployer()
- {
- 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
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/JMSResourceJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,75 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 RarModuleJSR277Deployer extends AbstractVFSJSR277Deployer<RARDeploymentMetaData>
-{
- public RarModuleJSR277Deployer()
- {
- 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, metaData.getDescription().getDisplayName(), 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, metaData.getDescription().getDisplayName());
- 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());
- }
-}
\ No newline at end of file
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/RarModuleJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,75 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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, metaData.getDescription().getDisplayName(), 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, metaData.getDescription().getDisplayName());
+ 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());
+ }
+}
\ No newline at end of file
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,102 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 ServiceModuleJSR277Deployer extends AbstractVFSJSR277Deployer<ServiceDeployment>
-{
- public ServiceModuleJSR277Deployer()
- {
- 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
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/ServiceModuleJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,102 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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
Deleted: trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR277Deployer.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR277Deployer.java 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR277Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -1,139 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.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 WebModuleJSR277Deployer extends AbstractVFSJSR277Deployer<JBossWebMetaData>
-{
- public WebModuleJSR277Deployer()
- {
- 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
Copied: trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java (from rev 79824, trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR277Deployer.java)
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/deployers/WebModuleJSR77Deployer.java 2008-10-21 12:46:05 UTC (rev 79829)
@@ -0,0 +1,139 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.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
Modified: trunk/server/src/etc/deployers/jsr77-deployers-jboss-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/jsr77-deployers-jboss-beans.xml 2008-10-21 12:26:27 UTC (rev 79828)
+++ trunk/server/src/etc/deployers/jsr77-deployers-jboss-beans.xml 2008-10-21 12:46:05 UTC (rev 79829)
@@ -15,12 +15,12 @@
<!--<property name="jndiBindingService"></property>-->
</bean>
- <bean name="EarModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.EarModuleJSR277Deployer"/>
- <bean name="EjbModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.EjbModuleJSR277Deployer"/>
- <bean name="JCAResourceJSR77Deployer" class="org.jboss.management.j2ee.deployers.JCAResourceJSR277Deployer"/>
- <bean name="JMSResourceJSR77Deployer" class="org.jboss.management.j2ee.deployers.JMSResourceJSR277Deployer"/>
- <bean name="RarModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.RarModuleJSR277Deployer"/>
- <bean name="ServiceModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.ServiceModuleJSR277Deployer"/>
- <bean name="WebModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.WebModuleJSR277Deployer"/>
+ <bean name="EarModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.EarModuleJSR77Deployer"/>
+ <bean name="EjbModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.EjbModuleJSR77Deployer"/>
+ <bean name="JCAResourceJSR77Deployer" class="org.jboss.management.j2ee.deployers.JCAResourceJSR77Deployer"/>
+ <bean name="JMSResourceJSR77Deployer" class="org.jboss.management.j2ee.deployers.JMSResourceJSR77Deployer"/>
+ <bean name="RarModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.RarModuleJSR77Deployer"/>
+ <bean name="ServiceModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.ServiceModuleJSR77Deployer"/>
+ <bean name="WebModuleJSR77Deployer" class="org.jboss.management.j2ee.deployers.WebModuleJSR77Deployer"/>
</deployment>
More information about the jboss-cvs-commits
mailing list