[jboss-cvs] JBossAS SVN: r73246 - in trunk: server/src/main/org/jboss/deployment and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 9 18:22:22 EDT 2008


Author: scott.stark at jboss.org
Date: 2008-05-09 18:22:22 -0400 (Fri, 09 May 2008)
New Revision: 73246

Added:
   trunk/server/src/main/org/jboss/deployment/plugin/LegacyEjb3JndiPolicy.java
Modified:
   trunk/component-matrix/pom.xml
   trunk/server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java
Log:
Update to jboss-metadata 1.0.0.Beta15

Modified: trunk/component-matrix/pom.xml
===================================================================
--- trunk/component-matrix/pom.xml	2008-05-09 22:10:15 UTC (rev 73245)
+++ trunk/component-matrix/pom.xml	2008-05-09 22:22:22 UTC (rev 73246)
@@ -998,7 +998,7 @@
       <dependency>
         <groupId>org.jboss.metadata</groupId>
         <artifactId>jboss-metadata</artifactId>
-        <version>1.0.0.Beta14</version>
+        <version>1.0.0.Beta15</version>
       </dependency>
  
       <dependency>

Modified: trunk/server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java	2008-05-09 22:10:15 UTC (rev 73245)
+++ trunk/server/src/main/org/jboss/deployment/MappedReferenceMetaDataResolverDeployer.java	2008-05-09 22:22:22 UTC (rev 73246)
@@ -34,6 +34,7 @@
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployment.dependency.ContainerDependencyMetaData;
 import org.jboss.deployment.dependency.JndiDependencyMetaData;
+import org.jboss.deployment.plugin.LegacyEjb3JndiPolicy;
 import org.jboss.deployment.plugin.MappedDeploymentEndpointResolver;
 import org.jboss.deployment.spi.DeploymentEndpointResolver;
 import org.jboss.deployment.spi.EndpointInfo;
@@ -648,7 +649,8 @@
                cdmd.addDependency(target);
                // Determine the jndi name for the reference interface
                String ifaceName = iface != null ? iface.getName() : null;
-               // Need to compare iface against the metadata local/local-home/home/remote
+               
+               LegacyEjb3JndiPolicy policy = new LegacyEjb3JndiPolicy();
                String containerJndiName = target.getBeanMetaData().determineResolvedJndiName(ifaceName, null);
                if(containerJndiName != null)
                   ref.setResolvedJndiName(containerJndiName);

Added: trunk/server/src/main/org/jboss/deployment/plugin/LegacyEjb3JndiPolicy.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/plugin/LegacyEjb3JndiPolicy.java	                        (rev 0)
+++ trunk/server/src/main/org/jboss/deployment/plugin/LegacyEjb3JndiPolicy.java	2008-05-09 22:22:22 UTC (rev 73246)
@@ -0,0 +1,113 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * 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.deployment.plugin;
+
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.DefaultJndiBindingPolicy;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.EjbDeploymentSummary;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.KnownInterfaces;
+import org.jboss.metadata.ejb.jboss.jndipolicy.spi.KnownInterfaces.KnownInterfaceType;
+
+/**
+ * DefaultJndiBindingPolicy that uses the old ejb3 binding name conventions
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision:$
+ */
+public class LegacyEjb3JndiPolicy
+   implements DefaultJndiBindingPolicy
+{
+   private String baseJndiName;
+
+   public LegacyEjb3JndiPolicy()
+   {
+      
+   }
+   public LegacyEjb3JndiPolicy(String baseJndiName)
+   {
+      this.baseJndiName = baseJndiName;
+   }
+
+   
+   public String getBaseJndiName()
+   {
+      return baseJndiName;
+   }
+   public void setBaseJndiName(String baseJndiName)
+   {
+      this.baseJndiName = baseJndiName;
+   }
+
+   public String getDefaultLocalHomeJndiName(EjbDeploymentSummary summary)
+   {
+      return baseJndiName + "/" + KnownInterfaces.LOCAL_HOME;
+   }
+
+   public String getDefaultLocalJndiName(EjbDeploymentSummary summary)
+   {
+      return baseJndiName + "/" + KnownInterfaces.LOCAL;
+   }
+
+   public String getDefaultRemoteHomeJndiName(EjbDeploymentSummary summary)
+   {
+      return baseJndiName + "/" + KnownInterfaces.HOME;
+   }
+
+   public String getDefaultRemoteJndiName(EjbDeploymentSummary summary)
+   {
+      return baseJndiName + "/" + KnownInterfaces.REMOTE;
+   }
+
+   public String getJndiName(EjbDeploymentSummary summary)
+   {
+      return baseJndiName;
+   }
+
+   public String getJndiName(EjbDeploymentSummary summary, String iface,
+         KnownInterfaceType ifaceType)
+   {
+      JBossEnterpriseBeanMetaData beanMD = summary.getBeanMD();
+      baseJndiName = beanMD.getMappedName();
+      if(baseJndiName == null)
+         baseJndiName = beanMD.determineJndiName();
+      String jndiName = null;
+      if(iface == null)
+         jndiName = getJndiName(summary);
+      else if(KnownInterfaces.isKnownInterface(iface))
+      {
+         // Don't append the iface for ejb2.x homes
+         boolean is3x = beanMD.getJBossMetaData().isEJB3x();
+         if(is3x)
+            jndiName = baseJndiName + "/" + iface;
+         else if(KnownInterfaces.LOCAL_HOME.equalsIgnoreCase(iface))
+            jndiName = summary.getBeanMD().determineLocalJndiName();
+         else
+            jndiName = baseJndiName;
+      }
+      else
+      {
+         jndiName = baseJndiName + "/" + iface;
+      }
+      return jndiName;
+   }
+
+}




More information about the jboss-cvs-commits mailing list