[jboss-cvs] JBossAS SVN: r66066 - in trunk/connector/src/main/org/jboss/resource: metadata/mcf and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Oct 11 22:59:41 EDT 2007


Author: weston.price at jboss.com
Date: 2007-10-11 22:59:41 -0400 (Thu, 11 Oct 2007)
New Revision: 66066

Added:
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/DBMSMetaData.java
Removed:
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/MetaDataTypeMappingAdapter.java
Modified:
   trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java
   trunk/connector/src/main/org/jboss/resource/deployers/builder/MetaDataTypeMappingBuilder.java
   trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
Log:
[JBAS-1425, JBAS-4809] Reworked and cleaned up metadata for
marshalling for ProfileService.

Modified: trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java	2007-10-12 02:30:23 UTC (rev 66065)
+++ trunk/connector/src/main/org/jboss/resource/deployers/builder/ManagedConnectionPoolBuilder.java	2007-10-12 02:59:41 UTC (rev 66066)
@@ -101,7 +101,16 @@
       poolAttribute = buildSimpleAttribute("StatisticsFormatter", md.getStatisticsFormatter());
       poolAttributes.add(poolAttribute);
             
-      poolAttribute = buildSimpleAttribute("Criteria", String.valueOf(getCriteria(md.getSecurityMetaData().getSecurityDeploymentType())));
+      //Temp fix for JAXB marshalling issue
+      if(md.getSecurityMetaData() == null)
+      {
+         poolAttribute = buildSimpleAttribute("Criteria", "ByNothing");         
+      }
+      else
+      {
+         poolAttribute = buildSimpleAttribute("Criteria", String.valueOf(getCriteria(md.getSecurityMetaData().getSecurityDeploymentType())));
+      }
+
       poolAttributes.add(poolAttribute);
       
       poolAttribute = buildDependencyAttribute("ManagedConnectionFactoryName", MCF_JMX + md.getJndiName());

Modified: trunk/connector/src/main/org/jboss/resource/deployers/builder/MetaDataTypeMappingBuilder.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/deployers/builder/MetaDataTypeMappingBuilder.java	2007-10-12 02:30:23 UTC (rev 66065)
+++ trunk/connector/src/main/org/jboss/resource/deployers/builder/MetaDataTypeMappingBuilder.java	2007-10-12 02:59:41 UTC (rev 66066)
@@ -52,7 +52,22 @@
       attribute = buildDependencyAttribute("MetadataLibrary", "jboss.jdbc:service=metadata");
       attributes.add(attribute);
       
-      attribute = buildSimpleAttribute("TypeMapping", md.getTypeMapping());
+      String typeMapping = null;
+      
+      if(md.getDBMSMetaData() != null)
+      {
+         if(md.getDBMSMetaData().getTypeMapping() != null)
+         {
+            typeMapping = md.getDBMSMetaData().getTypeMapping();
+         }
+      
+      }else if(md.getTypeMapping() != null)
+      {
+         typeMapping = md.getTypeMapping();
+      }
+      
+      
+      attribute = buildSimpleAttribute("TypeMapping", typeMapping);
       attributes.add(attribute);
             
       return attributes;
@@ -63,11 +78,12 @@
    {
       ServiceMetaData md = null;
       
-      if(mcfmd.getTypeMapping() != null)
+      if(mcfmd.getTypeMapping() != null || mcfmd.getDBMSMetaData() != null)
       {
          md = super.build(mcfmd);
          
-      }
+      }      
+      
       return md;
       
    }
@@ -77,7 +93,7 @@
    {
       ObjectName on = null;
       
-      if(md.getTypeMapping() != null)
+      if(md.getTypeMapping() != null || md.getDBMSMetaData() != null)
       {
          on =  ObjectNameFactory.create(BINDING_JMX + md.getJndiName());   
          

Added: trunk/connector/src/main/org/jboss/resource/metadata/mcf/DBMSMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/DBMSMetaData.java	                        (rev 0)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/DBMSMetaData.java	2007-10-12 02:59:41 UTC (rev 66066)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* 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.resource.metadata.mcf;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * A DBMSMetaData.
+ * 
+ * @author <a href="weston.price at jboss.org">Weston M. Price</a>
+ * @version $Revision: 1.1 $
+ */
+ at XmlAccessorType(XmlAccessType.FIELD)
+ at XmlType(name="metadata")
+public class DBMSMetaData
+{
+   @XmlElement(name="type-mapping")
+   private String typeMapping;
+
+   public String getTypeMapping()
+   {
+      return typeMapping;
+   }
+
+   public void setTypeMapping(String typeMapping)
+   {
+      this.typeMapping = typeMapping;
+   }
+
+}

Modified: trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java	2007-10-12 02:30:23 UTC (rev 66065)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/ManagedConnectionFactoryDeploymentMetaData.java	2007-10-12 02:59:41 UTC (rev 66066)
@@ -119,6 +119,7 @@
    private Boolean trackConnectionByTransaction = Boolean.FALSE;
       
    /** The transactionSupportMetaData */
+   @XmlTransient
    private ManagedConnectionFactoryTransactionSupportMetaData transactionSupportMetaData = ManagedConnectionFactoryTransactionSupportMetaData.NONE;
 
    /** The managedConnectionFactoryProperties */
@@ -127,7 +128,7 @@
    
    /** The securityMetaData */
    @XmlElements({@XmlElement(name="security-domain", type=SecurityDomainMetaData.class), @XmlElement(name="security-domain-and-application",type=SecurityDomainApplicationManagedMetaData.class), @XmlElement(name="application-managed-security",type=ApplicationManagedSecurityMetaData.class)})
-   private SecurityMetaData securityMetaData = new SecurityMetaData();
+   private SecurityMetaData securityMetaData;
       
    @XmlElement(name="depends")
    private List<String> dependsNames = new ArrayList<String>();
@@ -135,10 +136,12 @@
    @XmlTransient
    private List<ServiceMetaData> dependsServices = new ArrayList<ServiceMetaData>();
 
-   @XmlElements({@XmlElement(name="metadata"), @XmlElement(name="type-mapping")})
-   @XmlJavaTypeAdapter(MetaDataTypeMappingAdapter.class)
-   private String typeMapping;
-
+   @XmlElement(name="metadata")
+   private DBMSMetaData dbmsMetaData;
+      
+   @XmlElement(name="type-mapping")
+   String typeMapping;
+   
    /** The localTransactions */
    @XmlJavaTypeAdapter(ManagedConnectionEmptyContentAdapter.class)
    @XmlElement(name="local-transaction")
@@ -540,4 +543,16 @@
    {
       this.noTxSeperatePools = notxpool;
    }
+
+   public DBMSMetaData getDBMSMetaData()
+   {
+      return dbmsMetaData;
+   }
+
+   public void setDBMSMetaData(DBMSMetaData dbmsMetaData)
+   {
+      this.dbmsMetaData = dbmsMetaData;
+   }
+   
+
 }

Deleted: trunk/connector/src/main/org/jboss/resource/metadata/mcf/MetaDataTypeMappingAdapter.java
===================================================================
--- trunk/connector/src/main/org/jboss/resource/metadata/mcf/MetaDataTypeMappingAdapter.java	2007-10-12 02:30:23 UTC (rev 66065)
+++ trunk/connector/src/main/org/jboss/resource/metadata/mcf/MetaDataTypeMappingAdapter.java	2007-10-12 02:59:41 UTC (rev 66066)
@@ -1,64 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* 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.resource.metadata.mcf;
-
-import javax.xml.bind.annotation.adapters.XmlAdapter;
-
-import org.w3c.dom.Element;
-
-/**
- * A MetaDataTypeMappingAdapter used to support legacy <metadata/><typemapping/>
- * constructs in *-ds.xml file.
- * 
- * @author <a href="weston.price at jboss.org">Weston Price</a>
- * @version $Revision: 1.1 $
- */
-public class MetaDataTypeMappingAdapter extends XmlAdapter<Object, String>
-{
-   @Override
-   public String unmarshal(Object obj) throws Exception
-   {
-      Element e = (Element)obj;
-      String typeMapping = null;
-      
-      if(e.getNodeName().equals("metadata"))
-      {
-         Element child = (Element)e.getChildNodes().item(0);
-         typeMapping = child.getTextContent();
-         
-      }
-      else
-      {
-         typeMapping = e.getTextContent();
-         
-      }
-         
-      return typeMapping;
-   }
-
-   @Override
-   public Object marshal(String arg0) throws Exception
-   {
-      // TODO Auto-generated method stub
-      return null;
-   }
-}




More information about the jboss-cvs-commits mailing list