[jboss-cvs] JBossAS SVN: r62057 - trunk/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:22:45 EDT 2007
Author: dimitris at jboss.org
Date: 2007-04-03 18:22:45 -0400 (Tue, 03 Apr 2007)
New Revision: 62057
Added:
trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
Modified:
trunk/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java
trunk/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java
trunk/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java
Log:
JBAS-2026, Wrong placeholder ear created
Modified: trunk/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java 2007-04-03 22:20:23 UTC (rev 62056)
+++ trunk/management/src/main/org/jboss/management/j2ee/factory/EJBModuleFactory.java 2007-04-03 22:22:45 UTC (rev 62057)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.
-*/
+ * 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 java.util.Iterator;
@@ -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: trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java (rev 0)
+++ trunk/management/src/main/org/jboss/management/j2ee/factory/FactoryUtils.java 2007-04-03 22:22:45 UTC (rev 62057)
@@ -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: trunk/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java 2007-04-03 22:20:23 UTC (rev 62056)
+++ trunk/management/src/main/org/jboss/management/j2ee/factory/RARModuleFactory.java 2007-04-03 22:22:45 UTC (rev 62057)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.
-*/
+ * 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;
@@ -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: trunk/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java
===================================================================
--- trunk/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java 2007-04-03 22:20:23 UTC (rev 62056)
+++ trunk/management/src/main/org/jboss/management/j2ee/factory/WebModuleFactory.java 2007-04-03 22:22:45 UTC (rev 62057)
@@ -1,24 +1,24 @@
/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, 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.
-*/
+ * 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;
@@ -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