[jboss-cvs] JBossAS SVN: r106350 - in projects/jboss-jca/trunk: deployers/src/main/java/org/jboss/jca/deployers/fungal and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 30 14:55:22 EDT 2010


Author: jesper.pedersen
Date: 2010-06-30 14:55:21 -0400 (Wed, 30 Jun 2010)
New Revision: 106350

Added:
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/NoopJndiStrategy.java
Modified:
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/SimpleJndiStrategy.java
   projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployment.java
   projects/jboss-jca/trunk/doc/userguide/en/modules/configuration.xml
Log:
[JBJCA-370] A noop JNDI strategy

Added: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/NoopJndiStrategy.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/NoopJndiStrategy.java	                        (rev 0)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/NoopJndiStrategy.java	2010-06-30 18:55:21 UTC (rev 106350)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jca.core.naming;
+
+import org.jboss.jca.core.spi.naming.JndiStrategy;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.Name;
+
+import org.jboss.logging.Logger;
+
+/**
+ * A noop JNDI strategy
+ * 
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class NoopJndiStrategy implements JndiStrategy
+{
+   private static Logger log = Logger.getLogger(NoopJndiStrategy.class);
+
+   /**
+    * Constructor
+    */
+   public NoopJndiStrategy()
+   {
+   }
+
+   /**
+    * Obtain the connection factory
+    * {@inheritDoc}
+    */
+   public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable<?, ?> environment)
+      throws Exception
+   {
+      return null;
+   }
+
+   /**
+    * Bind connection factories for a deployment
+    * @param deployment The deployment name
+    * @param cfs The connection factories
+    * @return The JNDI names for the connection factories
+    * @exception Throwable Thrown if an error occurs
+    */
+   public String[] bindConnectionFactories(String deployment, Object[] cfs) throws Throwable
+   {
+      return new String[0];
+   }
+
+   /**
+    * Unbind connection factories for a deployment
+    * @param deployment The deployment name
+    * @param jndiNames The JNDI names for the connection factories
+    * @exception Throwable Thrown if an error occurs
+    */
+   public void unbindConnectionFactories(String deployment, String[] jndiNames) throws Throwable
+   {
+   }
+
+   /**
+    * Clone the JNDI strategy implementation
+    * @return A copy of the implementation
+    * @exception CloneNotSupportedException Thrown if the copy operation isn't supported
+    *  
+    */
+   public JndiStrategy clone() throws CloneNotSupportedException
+   {
+      return (JndiStrategy)super.clone();
+   }
+}

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/SimpleJndiStrategy.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/SimpleJndiStrategy.java	2010-06-30 18:29:20 UTC (rev 106349)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/SimpleJndiStrategy.java	2010-06-30 18:55:21 UTC (rev 106350)
@@ -40,7 +40,8 @@
 import org.jboss.util.naming.Util;
 
 /**
- * A simple JNDI strategy
+ * A simple JNDI strategy that bind a single connection factory under the
+ * name of "java:/eis/&lt;deployment&gt;"
  * 
  * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
  */

Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployment.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployment.java	2010-06-30 18:29:20 UTC (rev 106349)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/fungal/RADeployment.java	2010-06-30 18:55:21 UTC (rev 106350)
@@ -32,7 +32,6 @@
 import javax.resource.spi.ResourceAdapter;
 
 import org.jboss.logging.Logger;
-import org.jboss.util.naming.Util;
 
 import com.github.fungal.api.util.FileUtil;
 import com.github.fungal.spi.deployers.Deployment;

Modified: projects/jboss-jca/trunk/doc/userguide/en/modules/configuration.xml
===================================================================
--- projects/jboss-jca/trunk/doc/userguide/en/modules/configuration.xml	2010-06-30 18:29:20 UTC (rev 106349)
+++ projects/jboss-jca/trunk/doc/userguide/en/modules/configuration.xml	2010-06-30 18:55:21 UTC (rev 106350)
@@ -142,6 +142,14 @@
                   <para>Default: <code>false</code></para>
                 </entry>
               </row>
+              <row>
+                <entry><code>JndiStrategy</code></entry>
+                <entry><code>org.jboss.jca.core.spi.naming.JndiStrategy</code></entry>
+                <entry>
+                  Specifies the JNDI strategy policy for binding the connection factories into
+                  the naming environment
+                </entry>
+              </row>
             </tbody>
           </tgroup>
         </table>



More information about the jboss-cvs-commits mailing list