[jboss-cvs] JBossAS SVN: r94216 - in projects/jboss-jca/trunk: core and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 1 09:58:34 EDT 2009


Author: jesper.pedersen
Date: 2009-10-01 09:58:34 -0400 (Thu, 01 Oct 2009)
New Revision: 94216

Added:
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Bootstrap.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Unmarshaller.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/package.html
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/BeanType.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ConstructorType.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/DependsType.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Deployment.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/InjectType.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ParameterType.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/PropertyType.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/package.html
Modified:
   projects/jboss-jca/trunk/build.xml
   projects/jboss-jca/trunk/core/build.xml
   projects/jboss-jca/trunk/deployers/build.xml
   projects/jboss-jca/trunk/fungal/build.xml
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java
   projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/KernelImpl.java
   projects/jboss-jca/trunk/ivy.xml
   projects/jboss-jca/trunk/sjc/build.xml
   projects/jboss-jca/trunk/standalone/build.xml
Log:
[JBJCA-183] Use StAX for XML parsing

Modified: projects/jboss-jca/trunk/build.xml
===================================================================
--- projects/jboss-jca/trunk/build.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/build.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -80,7 +80,6 @@
   <property name="version.javassist" value="3.11.0.GA"/>
   <property name="version.jaxb.api" value="2.1"/>
   <property name="version.jaxb.impl" value="2.1.9"/>
-  <property name="version.jaxb.xjc" value="2.1.9"/>
   <property name="version.jboss.bootstrap" value="1.0.0-Beta-3"/>
   <property name="version.jboss.classloading" value="2.0.6.GA"/>
   <property name="version.jboss.common" value="2.2.15.GA"/>
@@ -426,6 +425,7 @@
       <sysproperty key="test.dir" value="${test.dir}"/>
       <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
       <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
 
       <classpath>
         <fileset dir="${build.dir}/instrumented" includes="*.jar" />
@@ -454,6 +454,7 @@
       <sysproperty key="archives.dir" value="${build.dir}/deployers"/>
       <sysproperty key="test.dir" value="${test.dir}"/>
       <sysproperty key="net.sourceforge.cobertura.datafile" file="${reports.dir}/cobertura/cobertura.ser" />
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
 
       <classpath>
         <fileset dir="${build.dir}/instrumented" includes="*.jar" />

Modified: projects/jboss-jca/trunk/core/build.xml
===================================================================
--- projects/jboss-jca/trunk/core/build.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/core/build.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -107,6 +107,7 @@
       <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
       <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
       <sysproperty key="log4j.defaultInitOverride" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
       
       <classpath>
         <pathelement location="${build.core.dir}/test"/>
@@ -152,6 +153,7 @@
       <sysproperty key="java.util.logging.manager" value="org.jboss.logmanager.LogManager"/>
       <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
       <sysproperty key="log4j.defaultInitOverride" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
       
       <classpath>
         <pathelement location="${build.core.dir}/test"/>

Modified: projects/jboss-jca/trunk/deployers/build.xml
===================================================================
--- projects/jboss-jca/trunk/deployers/build.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/deployers/build.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -322,6 +322,7 @@
       <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
       <sysproperty key="test.dir" value="${test.dir}"/>
       <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
       
       <classpath>
         <pathelement location="${build.deployers.dir}/test"/>
@@ -368,6 +369,7 @@
       <sysproperty key="org.jboss.logging.Logger.pluginClass" value="org.jboss.logging.logmanager.LoggerPluginImpl"/>
       <sysproperty key="test.dir" value="${test.dir}"/>
       <sysproperty key="xb.builder.useUnorderedSequence" value="true"/>
+      <sysproperty key="javax.xml.stream.XMLInputFactory" value="com.sun.xml.internal.stream.XMLInputFactoryImpl"/>
       
       <classpath>
         <pathelement location="${build.deployers.dir}/test"/>

Modified: projects/jboss-jca/trunk/fungal/build.xml
===================================================================
--- projects/jboss-jca/trunk/fungal/build.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/fungal/build.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -37,59 +37,9 @@
   </target>
 
   <!-- ================================= 
-       Target: compile bootstrap.xsd
-       ================================= -->
-  <target name="compile-bootstrap-xsd" depends="init">
-    <taskdef name="xjc"
-             classname="com.sun.tools.xjc.XJCTask"
-             classpathref="fungal.lib.path.id"/>
-    <xjc schema="src/main/resources/bootstrap.xsd"
-         destdir="${build.fungal.dir}/impl"
-         package="org.jboss.jca.fungal.bootstrap"/>
-    <javac srcdir="${build.fungal.dir}/impl"
-           destdir="${build.fungal.dir}/impl"
-           classpathref="fungal.lib.path.id"
-           debug="${javac.debug}"
-           deprecation="${javac.deprecation}"
-           optimize="${javac.optimize}">
-      <compilerarg value="-Xlint"/>
-    </javac>
-    <delete>
-      <fileset dir="${build.fungal.dir}/impl">
-        <include name="**/*.java"/>
-      </fileset>
-    </delete>
-  </target>
-
-  <!-- ================================= 
-       Target: compile deployment.xsd
-       ================================= -->
-  <target name="compile-deployment-xsd" depends="init">
-    <taskdef name="xjc"
-             classname="com.sun.tools.xjc.XJCTask"
-             classpathref="fungal.lib.path.id"/>
-    <xjc schema="src/main/resources/deployment.xsd"
-         destdir="${build.fungal.dir}/impl"
-         package="org.jboss.jca.fungal.deployment"/>
-    <javac srcdir="${build.fungal.dir}/impl"
-           destdir="${build.fungal.dir}/impl"
-           classpathref="fungal.lib.path.id"
-           debug="${javac.debug}"
-           deprecation="${javac.deprecation}"
-           optimize="${javac.optimize}">
-      <compilerarg value="-Xlint"/>
-    </javac>
-    <delete>
-      <fileset dir="${build.fungal.dir}/impl">
-        <include name="**/*.java"/>
-      </fileset>
-    </delete>
-  </target>
-
-  <!-- ================================= 
        Target: compile
        ================================= -->
-  <target name="compile" depends="compile-bootstrap-xsd,compile-deployment-xsd">
+  <target name="compile" depends="init">
     <javac srcdir="src/main"
            destdir="${build.fungal.dir}/impl"
            classpathref="fungal.lib.path.id"

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Bootstrap.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Bootstrap.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Bootstrap.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.bootstrap;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents the bootstrap
+ */
+public class Bootstrap
+{
+   private List<String> url;
+
+   /**
+    * Constructor
+    */
+   public Bootstrap()
+   {
+      url = null;
+   }
+
+   /**
+    * Get the value of the url property
+    * @return The value
+    */
+   public List<String> getUrl()
+   {
+      if (url == null) 
+         url = new ArrayList<String>();
+      
+      return url;
+   }
+
+   /**
+    * String representation
+    * @return The value
+    */
+   public String toString()
+   {
+      if (url == null)
+         return "<null>";
+
+      return url.toString();
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Unmarshaller.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Unmarshaller.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/Unmarshaller.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.bootstrap;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Unmarshaller for bootstrap.xml
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class Unmarshaller
+{
+   /**
+    * Constructor
+    */
+   public Unmarshaller()
+   {
+   }
+
+   /**
+    * Unmarshal
+    * @param file The file
+    * @return The result
+    * @exception IOException If an I/O error occurs
+    */
+   public Bootstrap unmarshal(File file) throws IOException
+   {
+      if (file == null)
+         throw new IllegalArgumentException("File is null");
+
+      if (!file.exists())
+         throw new IOException("File doesn't exists: " + file);
+
+      if (file.isDirectory())
+         throw new IOException("File is a directory: " + file);
+
+      InputStream is = null;
+      try
+      {
+         Bootstrap bootstrap = new Bootstrap();
+
+         is = new FileInputStream(file);
+
+         XMLInputFactory xmlInputFactory = null;
+
+         try
+         {
+            xmlInputFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory",
+                                                          Thread.currentThread().getContextClassLoader());
+         }
+         catch (Throwable t)
+         {
+            xmlInputFactory = XMLInputFactory.newInstance();
+         }
+
+         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(is);
+
+         while (xmlStreamReader.hasNext())
+         {
+            int eventCode = xmlStreamReader.next();
+
+            switch (eventCode)
+            {
+               case XMLStreamReader.START_ELEMENT :
+
+                  if ("url".equals(xmlStreamReader.getLocalName()))
+                     bootstrap.getUrl().add(readUrl(xmlStreamReader));
+
+                  break;
+               default :
+            }
+         }
+
+         return bootstrap;
+      }
+      catch (Throwable t)
+      {
+         throw new IOException(t.getMessage(), t);
+      }
+      finally
+      {
+         try
+         {
+            if (is != null)
+               is.close();
+         }
+         catch (IOException ioe)
+         {
+            // Ignore
+         }
+      }
+   }
+
+   /**
+    * Read: <url>
+    * @param xmlStreamReader The XML stream
+    * @return The result
+    * @exception XMLStreamException Thrown if an error occurs
+    */
+   private String readUrl(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      String result = null;
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.CHARACTERS :
+               result = xmlStreamReader.getText();
+               break;
+            default : 
+         }
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"url".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/package.html
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/bootstrap/package.html	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,3 @@
+<body>
+This package contains the classes needed to work with bootstrap.xml
+</body>

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/BeanType.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/BeanType.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/BeanType.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,148 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a bean
+ */
+public class BeanType
+{
+   private ConstructorType constructor;
+   private List<PropertyType> property;
+   private List<DependsType> depends;
+   private String name;
+   private String interfaze;
+   private String clazz;
+
+   /**
+    * Constructor
+    */
+   public BeanType()
+   {
+      constructor = null;
+      property = null;
+      depends = null;
+      name = null;
+      interfaze = null;
+      clazz = null;
+   }
+
+   /**
+    * Get the constructor
+    * @return The value
+    */
+   public ConstructorType getConstructor()
+   {
+      return constructor;
+   }
+
+   /**
+    * Set the constructor
+    * @param value The value
+    */
+   public void setConstructor(ConstructorType value)
+   {
+      constructor = value;
+   }
+
+   /**
+    * Get the property values
+    * @return The value
+    */
+   public List<PropertyType> getProperty()
+   {
+      if (property == null)
+         property = new ArrayList<PropertyType>();
+
+      return property;
+   }
+
+   /**
+    * Get the depends values
+    * @return The value
+    */
+   public List<DependsType> getDepends()
+   {
+      if (depends == null)
+         depends = new ArrayList<DependsType>();
+
+      return depends;
+   }
+
+   /**
+    * Get the name
+    * @return The value
+    */
+   public String getName()
+   {
+      return name;
+   }
+   
+   /**
+    * Set the name
+    * @param value The value
+    */
+   public void setName(String value)
+   {
+      name = value;
+   }
+
+   /**
+    * Get the interface
+    * @return The value
+    */
+   public String getInterface()
+   {
+      return interfaze;
+   }
+
+   /**
+    * Set the interface
+    * @param value The value
+    */
+   public void setInterface(String value)
+   {
+      interfaze = value;
+   }
+
+   /**
+    * Get the class
+    * @return The value
+    */
+   public String getClazz()
+   {
+      return clazz;
+   }
+
+   /**
+    * Set the class
+    * @param value The value
+    */
+   public void setClazz(String value)
+   {
+      clazz = value;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ConstructorType.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ConstructorType.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ConstructorType.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * Represents a constructor
+ */
+public class ConstructorType
+{
+   private List<ParameterType> parameter;
+   private String factoryMethod;
+   private String factoryClass;
+   
+   /**
+    * Constructor
+    */
+   public ConstructorType()
+   {
+      parameter = null;
+      factoryMethod = null;
+      factoryClass = null;
+   }
+
+   /**
+    * Get the parameter values
+    * @return The value
+    */
+   public List<ParameterType> getParameter()
+   {
+      if (parameter == null)
+         parameter = new ArrayList<ParameterType>();
+
+      return parameter;
+   }
+
+   /**
+    * Get the factory method
+    * @return The value
+    */
+   public String getFactoryMethod()
+   {
+      return factoryMethod;
+   }
+   
+   /**
+    * Set the factory method
+    * @param value The value
+    */
+   public void setFactoryMethod(String value)
+   {
+      factoryMethod = value;
+   }
+
+   /**
+    * Get the factory class
+    * @return The value
+    */
+   public String getFactoryClass()
+   {
+      return factoryClass;
+   }
+
+   /**
+    * Set the factory class
+    * @param value The value
+    */
+   public void setFactoryClass(String value)
+   {
+      factoryClass = value;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/DependsType.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/DependsType.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/DependsType.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+/**
+ * Represents a depends element
+ */
+public class DependsType
+{
+   private String value;
+
+   /**
+    * Constructor
+    */
+   public DependsType()
+   {
+      value = null;
+   }
+
+   /**
+    * Get the value
+    * @return The value
+    */
+   public String getValue()
+   {
+      return value;
+   }
+
+   /**
+    * Set the value
+    * @param value The value
+    */
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Deployment.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Deployment.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Deployment.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a deployment
+ */
+public class Deployment
+{
+   private List<BeanType> bean;
+
+   /**
+    * Constructor
+    */
+   public Deployment()
+   {
+      bean = null;
+   }
+
+   /**
+    * Get the bean values
+    * @return The value
+    */
+   public List<BeanType> getBean()
+   {
+      if (bean == null)
+         bean = new ArrayList<BeanType>();
+
+      return bean;
+   }
+
+   /**
+    * String representation
+    * @return The value
+    */
+   public String toString()
+   {
+      if (bean == null)
+         return "<null>";
+
+      return bean.toString();
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/InjectType.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/InjectType.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/InjectType.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+/**
+ * Represents an inject element
+ */
+public class InjectType
+{
+   private String value;
+   private String bean;
+   private String property;
+
+   /**
+    * Constructor
+    */
+   public InjectType()
+   {
+      value = null;
+      bean = null;
+      property = null;
+   }
+
+   /**
+    * Get the value
+    * @return The value
+    */
+   public String getValue()
+   {
+      return value;
+   }
+
+   /**
+    * Set the value
+    * @param value The value
+    */
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+
+   /**
+    * Get the bean
+    * @return The value
+    */
+   public String getBean()
+   {
+      return bean;
+   }
+
+   /**
+    * Set the bean
+    * @param value The value
+    */
+   public void setBean(String value)
+   {
+      this.bean = value;
+   }
+
+   /**
+    * Get the property
+    * @return The value
+    */
+   public String getProperty()
+   {
+      return property;
+   }
+   
+   /**
+    * Set the property
+    * @param value The value
+    */
+   public void setProperty(String value)
+   {
+      this.property = value;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ParameterType.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ParameterType.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/ParameterType.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+/**
+ * Represents a parameter element
+ */
+public class ParameterType
+{
+   private String value;
+
+   /**
+    * Constructor
+    */
+   public ParameterType()
+   {
+      value = null;
+   }
+
+   /**
+    * Get the value
+    * @return The value
+    */
+   public String getValue()
+   {
+      return value;
+   }
+
+   /**
+    * Set the value
+    * @param value The value
+    */
+   public void setValue(String value)
+   {
+      this.value = value;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/PropertyType.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/PropertyType.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/PropertyType.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,94 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Represents a property element
+ */
+public class PropertyType
+{
+   private List<Object> content;
+   private String name;
+   private String clazz;
+
+   /**
+    * Constructor
+    */
+   public PropertyType()
+   {
+      content = null;
+      name = null;
+      clazz = null;
+   }
+
+   /**
+    * Get the content values
+    * @return The value
+    */
+   public List<Object> getContent()
+   {
+      if (content == null)
+         content = new ArrayList<Object>();
+      
+      return this.content;
+   }
+
+   /**
+    * Get the name
+    * @return The value
+    */
+   public String getName()
+   {
+      return name;
+   }
+
+   /**
+    * Set the name
+    * @param value The value
+    */
+   public void setName(String value)
+   {
+      name = value;
+   }
+
+   /**
+    * Get the class
+    * @return The value
+    */
+   public String getClazz()
+   {
+      return clazz;
+   }
+
+   /**
+    * Set the class
+    * @param value The value
+    */
+   public void setClazz(String value)
+   {
+      clazz = value;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/Unmarshaller.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,389 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, 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.fungal.deployment;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * Unmarshaller for a bean deployment XML file
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ */
+public class Unmarshaller
+{
+   /**
+    * Constructor
+    */
+   public Unmarshaller()
+   {
+   }
+
+   /**
+    * Unmarshal
+    * @param url The URL
+    * @return The result
+    * @exception IOException If an I/O error occurs
+    */
+   public Deployment unmarshal(URL url) throws IOException
+   {
+      if (url == null)
+         throw new IllegalArgumentException("File is null");
+
+      InputStream is = null;
+      try
+      {
+         Deployment deployment = new Deployment();
+
+         File file = new File(url.toURI());
+         is = new FileInputStream(file);
+
+         XMLInputFactory xmlInputFactory = null;
+
+         try
+         {
+            xmlInputFactory = XMLInputFactory.newInstance("javax.xml.stream.XMLInputFactory",
+                                                          Thread.currentThread().getContextClassLoader());
+         }
+         catch (Throwable t)
+         {
+            xmlInputFactory = XMLInputFactory.newInstance();
+         }
+        
+         XMLStreamReader xmlStreamReader = xmlInputFactory.createXMLStreamReader(is);
+
+         while (xmlStreamReader.hasNext())
+         {
+            int eventCode = xmlStreamReader.next();
+
+            switch (eventCode)
+            {
+               case XMLStreamReader.START_ELEMENT :
+
+                  if ("bean".equals(xmlStreamReader.getLocalName()))
+                     deployment.getBean().add(readBean(xmlStreamReader));
+
+                  break;
+               default :
+            }
+         }
+
+         return deployment;
+      }
+      catch (Throwable t)
+      {
+         throw new IOException(t.getMessage(), t);
+      }
+      finally
+      {
+         try
+         {
+            if (is != null)
+               is.close();
+         }
+         catch (IOException ioe)
+         {
+            // Ignore
+         }
+      }
+   }
+
+   /**
+    * Read: <bean>
+    * @param xmlStreamReader The XML stream
+    * @return The bean
+    * @exception XMLStreamException Thrown if an exception occurs
+    */
+   private BeanType readBean(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      BeanType result = new BeanType();
+
+      for (int i = 0; i < xmlStreamReader.getAttributeCount(); i++)
+      {
+         String name = xmlStreamReader.getAttributeLocalName(i);
+         if ("name".equals(name))
+         {
+            result.setName(xmlStreamReader.getAttributeValue(i));
+         }
+         else if ("class".equals(name))
+         {
+            result.setClazz(xmlStreamReader.getAttributeValue(i));
+         }
+         else if ("interface".equals(name))
+         {
+            result.setInterface(xmlStreamReader.getAttributeValue(i));
+         }
+      }
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.START_ELEMENT :
+               String name = xmlStreamReader.getLocalName();
+               if ("constructor".equals(name))
+               {
+                  result.setConstructor(readConstructor(xmlStreamReader));
+               }
+               else if ("property".equals(name))
+               {
+                  result.getProperty().add(readProperty(xmlStreamReader));
+               }
+               else if ("depends".equals(name))
+               {
+                  result.getDepends().add(readDepends(xmlStreamReader));
+               }
+
+               break;
+            default :
+         }
+
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"bean".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+
+   /**
+    * Read: <constructor>
+    * @param xmlStreamReader The XML stream
+    * @return The constructor
+    * @exception XMLStreamException Thrown if an exception occurs
+    */
+   private ConstructorType readConstructor(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      ConstructorType result = new ConstructorType();
+
+      for (int i = 0; i < xmlStreamReader.getAttributeCount(); i++)
+      {
+         String name = xmlStreamReader.getAttributeLocalName(i);
+         if ("factoryMethod".equals(name))
+         {
+            result.setFactoryMethod(xmlStreamReader.getAttributeValue(i));
+         }
+         else if ("factoryClass".equals(name))
+         {
+            result.setFactoryClass(xmlStreamReader.getAttributeValue(i));
+         }
+      }
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.START_ELEMENT :
+               String name = xmlStreamReader.getLocalName();
+
+               if ("parameter".equals(name))
+                  result.getParameter().add(readParameter(xmlStreamReader));
+
+               break;
+            default :
+         }
+
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"constructor".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+
+   /**
+    * Read: <parameter>
+    * @param xmlStreamReader The XML stream
+    * @return The parameter
+    * @exception XMLStreamException Thrown if an exception occurs
+    */
+   private ParameterType readParameter(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      ParameterType result = new ParameterType();
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.CHARACTERS :
+               result.setValue(xmlStreamReader.getText());
+               break;
+            default :
+         }
+
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"parameter".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+
+   /**
+    * Read: <property>
+    * @param xmlStreamReader The XML stream
+    * @return The property
+    * @exception XMLStreamException Thrown if an exception occurs
+    */
+   private PropertyType readProperty(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      PropertyType result = new PropertyType();
+
+      for (int i = 0; i < xmlStreamReader.getAttributeCount(); i++)
+      {
+         String name = xmlStreamReader.getAttributeLocalName(i);
+         if ("name".equals(name))
+         {
+            result.setName(xmlStreamReader.getAttributeValue(i));
+         }
+         else if ("class".equals(name))
+         {
+            result.setClazz(xmlStreamReader.getAttributeValue(i));
+         }
+      }
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.START_ELEMENT :
+               String name = xmlStreamReader.getLocalName();
+
+               if ("inject".equals(name))
+                  result.getContent().add(readInject(xmlStreamReader));
+
+               break;
+
+            case XMLStreamReader.CHARACTERS :
+               result.getContent().add(xmlStreamReader.getText());
+
+               break;
+
+            default :
+         }
+
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"property".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+
+   /**
+    * Read: <inject>
+    * @param xmlStreamReader The XML stream
+    * @return The inject
+    * @exception XMLStreamException Thrown if an exception occurs
+    */
+   private InjectType readInject(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      InjectType result = new InjectType();
+
+      for (int i = 0; i < xmlStreamReader.getAttributeCount(); i++)
+      {
+         String name = xmlStreamReader.getAttributeLocalName(i);
+         if ("bean".equals(name))
+         {
+            result.setBean(xmlStreamReader.getAttributeValue(i));
+         }
+         else if ("property".equals(name))
+         {
+            result.setProperty(xmlStreamReader.getAttributeValue(i));
+         }
+      }
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.CHARACTERS :
+               result.setValue(xmlStreamReader.getText());
+
+               break;
+
+            default :
+         }
+
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"inject".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+
+   /**
+    * Read: <depends>
+    * @param xmlStreamReader The XML stream
+    * @return The depends
+    * @exception XMLStreamException Thrown if an exception occurs
+    */
+   private DependsType readDepends(XMLStreamReader xmlStreamReader) throws XMLStreamException
+   {
+      DependsType result = new DependsType();
+
+      int eventCode = xmlStreamReader.next();
+
+      while (eventCode != XMLStreamReader.END_ELEMENT)
+      {
+         switch (eventCode)
+         {
+            case XMLStreamReader.CHARACTERS :
+               result.setValue(xmlStreamReader.getText());
+
+               break;
+
+            default :
+         }
+
+         eventCode = xmlStreamReader.next();
+      }
+
+      if (!"depends".equals(xmlStreamReader.getLocalName()))
+         throw new XMLStreamException("url tag not completed");
+
+      return result;
+   }
+}

Added: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/package.html
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/package.html	                        (rev 0)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/deployment/package.html	2009-10-01 13:58:34 UTC (rev 94216)
@@ -0,0 +1,3 @@
+<body>
+This package contains the classes needed to work with bean deployment XML files
+</body>

Modified: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/DeploymentDeployer.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -30,6 +30,7 @@
 import org.jboss.jca.fungal.deployment.DependsType;
 import org.jboss.jca.fungal.deployment.InjectType;
 import org.jboss.jca.fungal.deployment.PropertyType;
+import org.jboss.jca.fungal.deployment.Unmarshaller;
 
 import java.lang.reflect.Method;
 import java.net.InetAddress;
@@ -41,10 +42,6 @@
 import java.util.Set;
 import java.util.concurrent.CountDownLatch;
 
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.Unmarshaller;
-
 /**
  * The deployment deployer (deploys .xml files)
  * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
@@ -60,19 +57,20 @@
    /** Logging */
    private static Object logging;
 
-   static
-   {
-      initLogging();
-   }
-
    /**
     * Constructor
     * @param kernel The kernel
     */
    public DeploymentDeployer(KernelImpl kernel)
    {
+      if (kernel == null)
+         throw new IllegalArgumentException("Kernel is null");
+
       this.kernel = kernel;
       this.beansLatch = null;
+
+      if (logging == null)
+         initLogging(kernel.getKernelClassLoader());
    }
 
    /**
@@ -91,10 +89,9 @@
 
       try
       {
-         JAXBContext deploymentJc = JAXBContext.newInstance("org.jboss.jca.fungal.deployment");
-         Unmarshaller deploymentU = deploymentJc.createUnmarshaller();
+         Unmarshaller deploymentU = new Unmarshaller();
          org.jboss.jca.fungal.deployment.Deployment deployment = 
-            (org.jboss.jca.fungal.deployment.Deployment)deploymentU.unmarshal(url);
+            deploymentU.unmarshal(url);
 
          if (deployment != null)
          {
@@ -236,18 +233,14 @@
 
             for (PropertyType pt : pts)
             {
-               Object e = pt.getContent().get(0);
+               Object element = pt.getContent().get(0);
 
-               if (e != null && e instanceof JAXBElement)
+               if (element != null && element instanceof InjectType)
                {
-                  Object element = ((JAXBElement)e).getValue();
-                  if (element instanceof InjectType)
-                  {
-                     InjectType it = (InjectType)element;
-                     result.add(it.getBean());
+                  InjectType it = (InjectType)element;
+                  result.add(it.getBean());
 
-                     kernel.addBeanDependants(it.getBean(), bt.getName());
-                  }
+                  kernel.addBeanDependants(it.getBean(), bt.getName());
                }
             }
          }
@@ -517,21 +510,11 @@
          Class parameterClass = m.getParameterTypes()[0];
       
          Object parameterValue = null;
-         Object e = pt.getContent().get(0);
-         Object element = null;
+         Object element = pt.getContent().get(0);
 
-         if (e != null && e instanceof JAXBElement)
-         {
-            element = ((JAXBElement)e).getValue();
-         }
-         else
-         {
-            if (e == null)
-               e = "";
+         if (element == null)
+            element = "";
 
-            element = e;
-         }
-
          if (element instanceof InjectType)
          {
             InjectType it = (InjectType)element;
@@ -672,11 +655,11 @@
     * Init logging
     */
    @SuppressWarnings("unchecked") 
-   private static void initLogging()
+   private static void initLogging(ClassLoader cl)
    {
       try
       {
-         Class clz = Class.forName("org.jboss.logging.Logger");
+         Class clz = Class.forName("org.jboss.logging.Logger", true, cl);
          
          Method mGetLogger = clz.getMethod("getLogger", String.class);
 

Modified: projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/KernelImpl.java
===================================================================
--- projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/KernelImpl.java	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/fungal/src/main/java/org/jboss/jca/fungal/impl/KernelImpl.java	2009-10-01 13:58:34 UTC (rev 94216)
@@ -51,8 +51,6 @@
 import javax.management.remote.JMXConnectorServer;
 import javax.management.remote.JMXConnectorServerFactory;
 import javax.management.remote.JMXServiceURL;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.Unmarshaller;
 
 /**
  * The kernel implementation for JBoss JCA/Fungal
@@ -178,6 +176,8 @@
 
       SecurityActions.setSystemProperty("xb.builder.useUnorderedSequence", "true");
       SecurityActions.setSystemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
+      SecurityActions.setSystemProperty("javax.xml.stream.XMLInputFactory", 
+                                        "com.sun.xml.internal.stream.XMLInputFactoryImpl");
 
       if (kernelConfiguration.getBindAddress() != null)
          SecurityActions.setSystemProperty("jboss.jca.bindaddress", kernelConfiguration.getBindAddress().trim());
@@ -203,16 +203,15 @@
       // Start all URLs defined in bootstrap.xml
       if (configDirectory != null && configDirectory.exists() && configDirectory.isDirectory())
       {
-         File bootXml = new File(configDirectory, "bootstrap.xml");
-         JAXBContext bootJc = JAXBContext.newInstance("org.jboss.jca.fungal.bootstrap");
-         Unmarshaller bootU = bootJc.createUnmarshaller();
-         org.jboss.jca.fungal.bootstrap.Bootstrap boot = 
-            (org.jboss.jca.fungal.bootstrap.Bootstrap)bootU.unmarshal(bootXml);
+         File bootstrapXml = new File(configDirectory, "bootstrap.xml");
+         org.jboss.jca.fungal.bootstrap.Unmarshaller bootstrapU = 
+            new org.jboss.jca.fungal.bootstrap.Unmarshaller();
+         org.jboss.jca.fungal.bootstrap.Bootstrap bootstrap = bootstrapU.unmarshal(bootstrapXml);
 
-         // Boot urls
-         if (boot != null)
+         // Bootstrap urls
+         if (bootstrap != null)
          {
-            for (String url : boot.getUrl())
+            for (String url : bootstrap.getUrl())
             {
                try
                {

Modified: projects/jboss-jca/trunk/ivy.xml
===================================================================
--- projects/jboss-jca/trunk/ivy.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/ivy.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -39,7 +39,6 @@
     <dependency org="apache-log4j" name="log4j" rev="${version.apache-log4j}" conf="standalone->default;sjc->*"/>
     <dependency org="apache-logging" name="commons-logging" rev="${version.apache-logging}" conf="*"/>
     <dependency org="com.sun.xml.bind" name="jaxb-impl" rev="${version.jaxb.impl}" conf="standalone->default;sjc->*"/>
-    <dependency org="com.sun.xml.bind" name="jaxb-xjc" rev="${version.jaxb.xjc}" conf="standalone->default;sjc->*"/>
     <dependency org="javassist" name="javassist" rev="${version.javassist}" conf="standalone->default;sjc->*"/>
     <dependency org="javax.activation" name="activation" rev="${version.activation}" conf="standalone->default;sjc->*"/>
     <dependency org="javax.validation" name="validation-api" rev="${version.validation-api}" conf="standalone->default;sjc->*"/>

Modified: projects/jboss-jca/trunk/sjc/build.xml
===================================================================
--- projects/jboss-jca/trunk/sjc/build.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/sjc/build.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -142,7 +142,6 @@
         <include name="*.jar"/>
         <exclude name="jaxb-api.jar"/>
         <exclude name="xercesImpl.jar"/>
-        <exclude name="*xjc.jar"/>
         <exclude name="stax-api.jar"/>
       </fileset>
     </copy>

Modified: projects/jboss-jca/trunk/standalone/build.xml
===================================================================
--- projects/jboss-jca/trunk/standalone/build.xml	2009-10-01 13:13:43 UTC (rev 94215)
+++ projects/jboss-jca/trunk/standalone/build.xml	2009-10-01 13:58:34 UTC (rev 94216)
@@ -147,7 +147,6 @@
         <include name="*.jar"/>
         <exclude name="jaxb-api.jar"/>
         <exclude name="xercesImpl.jar"/>
-        <exclude name="*xjc.jar"/>
         <exclude name="stax-api.jar"/>
       </fileset>
     </copy>




More information about the jboss-cvs-commits mailing list