You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by cs...@apache.org on 2006/05/25 23:12:51 UTC

svn commit: r409469 - /beehive/trunk/wsm/src/webservice-utils/axis/org/apache/beehive/webservice/utils/databinding/AxisBindingLookupFactory.java

Author: cschoett
Date: Thu May 25 14:12:50 2006
New Revision: 409469

URL: http://svn.apache.org/viewvc?rev=409469&view=rev
Log:
Updated to check at runtime if Xmlbeans is available before adding xmlbean lookup.

Modified:
    beehive/trunk/wsm/src/webservice-utils/axis/org/apache/beehive/webservice/utils/databinding/AxisBindingLookupFactory.java

Modified: beehive/trunk/wsm/src/webservice-utils/axis/org/apache/beehive/webservice/utils/databinding/AxisBindingLookupFactory.java
URL: http://svn.apache.org/viewvc/beehive/trunk/wsm/src/webservice-utils/axis/org/apache/beehive/webservice/utils/databinding/AxisBindingLookupFactory.java?rev=409469&r1=409468&r2=409469&view=diff
==============================================================================
--- beehive/trunk/wsm/src/webservice-utils/axis/org/apache/beehive/webservice/utils/databinding/AxisBindingLookupFactory.java (original)
+++ beehive/trunk/wsm/src/webservice-utils/axis/org/apache/beehive/webservice/utils/databinding/AxisBindingLookupFactory.java Thu May 25 14:12:50 2006
@@ -19,17 +19,24 @@
  */
 package org.apache.beehive.webservice.utils.databinding;
 
-import org.apache.beehive.webservice.utils.databinding.BindingLookupStrategy;
-import org.apache.beehive.webservice.utils.databinding.BindingLookupFactory;
-import org.apache.beehive.webservice.utils.databinding.XmlBeanLookupStrategy;
-import org.apache.beehive.webservice.utils.databinding.BindingLookupChain;
-
 public class AxisBindingLookupFactory
     extends BindingLookupFactory {
 
+    private static Class XML_OBJECT = null;
+    static {
+        try {
+            XML_OBJECT = Class.forName("org.apache.xmlbeans.XmlObject");
+        }
+        catch (ClassNotFoundException e) {
+            // not an error, xmlbeans is not present
+        }
+    }
+
     public BindingLookupStrategy getInstance() {
         BindingLookupChain chain = new BindingLookupChain();
-        chain.addBindingLookupService(new XmlBeanLookupStrategy());
+        if (XML_OBJECT != null) {
+            chain.addBindingLookupService(new XmlBeanLookupStrategy());
+        }
         chain.addBindingLookupService(new AxisLookupStrategy());
         return chain;
     }