[jboss-cvs] JBossAS SVN: r110654 - in projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator: code and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Feb 14 05:55:36 EST 2011


Author: jeff.zhang
Date: 2011-02-14 05:55:35 -0500 (Mon, 14 Feb 2011)
New Revision: 110654

Removed:
   projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/CmCodeGen.java
Modified:
   projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/BaseProfile.java
   projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/McfCodeGen.java
   projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/TestCodeGen.java
Log:
[JBJCA-497] remove connectionManager generated code

Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/BaseProfile.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/BaseProfile.java	2011-02-14 07:34:20 UTC (rev 110653)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/BaseProfile.java	2011-02-14 10:55:35 UTC (rev 110654)
@@ -122,7 +122,6 @@
          generateClassCode(def, "Mcf");
          generateClassCode(def, "Mc");
          generateClassCode(def, "McMeta");
-         generateClassCode(def, "Cm");
    
          if (!def.isUseCciConnection())
          {

Deleted: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/CmCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/CmCodeGen.java	2011-02-14 07:34:20 UTC (rev 110653)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/CmCodeGen.java	2011-02-14 10:55:35 UTC (rev 110654)
@@ -1,141 +0,0 @@
-/*
- * 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.codegenerator.code;
-
-import org.jboss.jca.codegenerator.Definition;
-
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * A connection impl class CodeGen.
- * 
- * @author Jeff Zhang
- * @version $Revision: $
- */
-public class CmCodeGen extends AbstractCodeGen
-{
-
-   /**
-    * Output ResourceAdapater class
-    * @param def definition
-    * @param out Writer
-    * @throws IOException ioException
-    */
-   @Override
-   public void writeClassBody(Definition def, Writer out) throws IOException
-   {
-
-      out.write("public class " + getClassName(def) + " implements ConnectionManager");
-      writeLeftCurlyBracket(out, 0);
-      int indent = 1;
-      
-      writeDefaultConstructor(def, out, indent);
-      
-      writeAllocateConn(def, out, indent);
-      writeRightCurlyBracket(out, 0);
-   }
-   
-   /**
-    * Output class import
-    * @param def definition
-    * @param out Writer
-    * @throws IOException ioException
-    */
-   @Override
-   public void writeImport(Definition def, Writer out) throws IOException
-   {
-      out.write("package " + def.getRaPackage() + ";");
-      writeEol(out);
-      writeEol(out);
-      out.write("import javax.resource.ResourceException;");
-      writeEol(out);
-      out.write("import javax.resource.spi.ConnectionManager;");
-      writeEol(out);
-      out.write("import javax.resource.spi.ConnectionRequestInfo;");
-      writeEol(out);
-      out.write("import javax.resource.spi.ManagedConnectionFactory;");
-      writeEol(out);
-      writeEol(out);
-   }
-   
-   /**
-    * get this class name
-    * @param def definition
-    * @return String class name
-    */
-   @Override
-   public String getClassName(Definition def)
-   {
-      return def.getCmClass();
-   }
-   
-   /**
-    * Output allocateConnection method
-    * @param def definition
-    * @param out Writer
-    * @param indent space number
-    * @throws IOException ioException
-    */
-   private void writeAllocateConn(Definition def, Writer out, int indent) throws IOException
-   {
-      writeIndent(out, indent);
-      out.write("/**");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" * Allocate a connection");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" *");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" * @param mcf The managed connection factory");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" * @param cri The connection request information");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" * @return Object The connection");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" * @exception ResourceException Thrown if an error occurs");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write(" */");
-      writeEol(out);
-      
-      writeIndent(out, indent);
-      out.write("@Override");
-      writeEol(out);
-      writeIndent(out, indent);
-      out.write("public Object allocateConnection(ManagedConnectionFactory mcf, " +
-         "ConnectionRequestInfo cri)");
-      writeEol(out);
-      writeIndent(out, indent + 1);
-      out.write("throws ResourceException");
-      writeLeftCurlyBracket(out, indent);
-      writeIndent(out, indent + 1);
-      out.write("return null;");
-      writeRightCurlyBracket(out, indent);
-      writeEol(out);
-   }
-}

Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/McfCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/McfCodeGen.java	2011-02-14 07:34:20 UTC (rev 110653)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/McfCodeGen.java	2011-02-14 10:55:35 UTC (rev 110654)
@@ -301,12 +301,8 @@
       }
 
       writeIndent(out, indent + 1);
-      if (def.isUseCciConnection())
-         out.write("return new " + def.getCciConnFactoryClass() + "(new " + def.getCmClass() + "());");
-      else
-      {
-         out.write("return new " + def.getCfClass() + "(new " + def.getCmClass() + "());");
-      }
+      out.write("throw new ResourceException(\"This resource adapter doesn't support non-managed environments\");");
+
       writeRightCurlyBracket(out, indent);
       writeEol(out);
    }

Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/TestCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/TestCodeGen.java	2011-02-14 07:34:20 UTC (rev 110653)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/code/TestCodeGen.java	2011-02-14 10:55:35 UTC (rev 110654)
@@ -175,8 +175,7 @@
       {
          out.write(def.getRaClass() + ".class, ");
       }
-      out.write(def.getMcfClass() + ".class, " + def.getMcClass() + ".class, " + 
-         def.getMcMetaClass() + ".class, " + def.getCmClass() + ".class, ");
+      out.write(def.getMcfClass() + ".class, " + def.getMcClass() + ".class, ");
       if (def.isUseCciConnection())
       {
          out.write(def.getCciConnFactoryClass() + ".class, " + def.getCciConnFactoryClass() + ".class, " + 



More information about the jboss-cvs-commits mailing list