[jboss-cvs] JBossAS SVN: r62056 - branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 3 18:20:23 EDT 2007
Author: dimitris at jboss.org
Date: 2007-04-03 18:20:23 -0400 (Tue, 03 Apr 2007)
New Revision: 62056
Added:
branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
Modified:
branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java
branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java
branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java
Log:
JBAS-2026, Wrong placeholder ear created
Modified: branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java
===================================================================
--- branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java 2007-04-03 21:52:59 UTC (rev 62055)
+++ branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java 2007-04-03 22:20:23 UTC (rev 62056)
@@ -72,7 +72,7 @@
String ejbJarName = di.shortName;
ObjectName ejbModuleService = di.deployedObject;
ObjectName jsr77Name = EJBModule.create(server,
- (di.parent == null ? null : di.parent.shortName),
+ FactoryUtils.findEarParent(di),
ejbJarName,
di.localUrl,
ejbModuleService);
Added: branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
===================================================================
--- branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java (rev 0)
+++ branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java 2007-04-03 22:20:23 UTC (rev 62056)
@@ -0,0 +1,52 @@
+/*
+ * 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.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;
+ }
+ }
+}
Modified: branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java
===================================================================
--- branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java 2007-04-03 21:52:59 UTC (rev 62055)
+++ branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java 2007-04-03 22:20:23 UTC (rev 62056)
@@ -68,7 +68,7 @@
String rarName = di.shortName;
ObjectName rarService = di.deployedObject;
ObjectName jsr77ModuleName = ResourceAdapterModule.create(mbeanServer,
- (di.parent == null ? null : di.parent.shortName),
+ FactoryUtils.findEarParent(di),
rarName,
di.localUrl);
deploymentToModuleNameMap.put(di, jsr77ModuleName);
Modified: branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java
===================================================================
--- branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java 2007-04-03 21:52:59 UTC (rev 62055)
+++ branches/Branch_4_2/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java 2007-04-03 22:20:23 UTC (rev 62056)
@@ -58,7 +58,7 @@
DeploymentInfo di = (DeploymentInfo) data;
String warName = di.shortName;
ObjectName webModuleService = di.deployedObject;
- String earName = di.parent == null ? null : di.parent.shortName;
+ String earName = FactoryUtils.findEarParent(di);
ObjectName jsr77Name = WebModule.create(server,
earName, warName, di.localUrl, webModuleService);
deploymentToModuleNameMap.put(di, jsr77Name);
More information about the jboss-cvs-commits
mailing list