[jboss-cvs] JBossAS SVN: r108055 - projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 8 16:50:21 EDT 2010


Author: jesper.pedersen
Date: 2010-09-08 16:50:20 -0400 (Wed, 08 Sep 2010)
New Revision: 108055

Modified:
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/ExplicitJndiStrategy.java
   projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/SimpleJndiStrategy.java
Log:
Additional validation and debugging

Modified: projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/ExplicitJndiStrategy.java
===================================================================
--- projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/ExplicitJndiStrategy.java	2010-09-08 19:42:44 UTC (rev 108054)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/ExplicitJndiStrategy.java	2010-09-08 20:50:20 UTC (rev 108055)
@@ -48,6 +48,8 @@
 {
    private static Logger log = Logger.getLogger(ExplicitJndiStrategy.class);
 
+   private static boolean trace = log.isTraceEnabled();
+
    private static ConcurrentMap<String, Object> connectionFactories = new ConcurrentHashMap<String, Object>();
 
    /**
@@ -113,6 +115,15 @@
             String jndiName = jndis[i];
             Object cf = cfs[i];
 
+            if (trace)
+               log.trace("Binding " + cf.getClass().getName() + " under " + jndiName);
+
+            if (cf == null)
+               throw new IllegalArgumentException("Connection factory is null");
+
+            if (jndiName == null)
+               throw new IllegalArgumentException("JNDI name is null");
+
             String className = cf.getClass().getName();
             Reference ref = new Reference(className,
                                           new StringRefAddr("class", className),
@@ -187,8 +198,18 @@
          {
             String jndiName = jndis[i];
             Object cf = cfs[i];
+
+            if (cf == null)
+               throw new IllegalArgumentException("Connection factory is null");
+
+            if (jndiName == null)
+               throw new IllegalArgumentException("JNDI name is null");
+
             String className = cf.getClass().getName();
 
+            if (trace)
+               log.trace("Unbinding " + className + " under " + jndiName);
+
             Util.unbind(context, jndiName);
 
             connectionFactories.remove(qualifiedName(jndiName, className));

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-09-08 19:42:44 UTC (rev 108054)
+++ projects/jboss-jca/trunk/core/src/main/java/org/jboss/jca/core/naming/SimpleJndiStrategy.java	2010-09-08 20:50:20 UTC (rev 108055)
@@ -49,6 +49,8 @@
 {
    private static Logger log = Logger.getLogger(SimpleJndiStrategy.class);
 
+   private static boolean trace = log.isTraceEnabled();
+
    /** JNDI prefix */
    private static final String JNDI_PREFIX = "java:/eis/";
 
@@ -118,6 +120,15 @@
       String jndiName = jndis[0];
       Object cf = cfs[0];
 
+      if (trace)
+         log.trace("Binding " + cf.getClass().getName() + " under " + jndiName);
+      
+      if (cf == null)
+         throw new IllegalArgumentException("Connection factory is null");
+      
+      if (jndiName == null)
+         throw new IllegalArgumentException("JNDI name is null");
+
       Context context = new InitialContext();
       try
       {
@@ -194,8 +205,18 @@
 
       String jndiName = jndis[0];
       Object cf = cfs[0];
+
+      if (cf == null)
+         throw new IllegalArgumentException("Connection factory is null");
+
+      if (jndiName == null)
+         throw new IllegalArgumentException("JNDI name is null");
+
       String className = cf.getClass().getName();
 
+      if (trace)
+         log.trace("Unbinding " + className + " under " + jndiName);
+
       Context context = null;
       try
       {



More information about the jboss-cvs-commits mailing list