[jboss-cvs] JBossAS SVN: r104792 - projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri May 14 05:45:02 EDT 2010
Author: jeff.zhang
Date: 2010-05-14 05:45:01 -0400 (Fri, 14 May 2010)
New Revision: 104792
Modified:
projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnCodeGen.java
projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnFactoryCodeGen.java
projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CfCodeGen.java
projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/JCA16AnnoProfile.java
projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McCodeGen.java
projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McfCodeGen.java
Log:
[JBJCA-319] make ResourceAdapterAssociation code generation optional
Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnCodeGen.java 2010-05-14 07:01:31 UTC (rev 104791)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnCodeGen.java 2010-05-14 09:45:01 UTC (rev 104792)
@@ -47,6 +47,13 @@
int indent = 1;
writeDefaultConstructor(def, out, indent);
+
+ //constructor
+ writeIndent(out, indent);
+ out.write("public " + getClassName(def) + "(ConnectionSpec connSpec)");
+ writeLeftCurlyBracket(out, indent);
+ writeRightCurlyBracket(out, indent);
+ writeEol(out);
writeClose(def, out, indent);
writeInteraction(def, out, indent);
@@ -77,6 +84,8 @@
writeEol(out);
out.write("import javax.resource.cci.ConnectionMetaData;");
writeEol(out);
+ out.write("import javax.resource.cci.ConnectionSpec;");
+ writeEol(out);
out.write("import javax.resource.cci.Interaction;");
writeEol(out);
out.write("import javax.resource.cci.LocalTransaction;");
@@ -178,7 +187,7 @@
writeLeftCurlyBracket(out, indent);
writeIndent(out, indent + 1);
- out.write("return new MyConnectionMetaData();");
+ out.write("return new " + def.getConnMetaClass() + "();");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnFactoryCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnFactoryCodeGen.java 2010-05-14 07:01:31 UTC (rev 104791)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CciConnFactoryCodeGen.java 2010-05-14 09:45:01 UTC (rev 104792)
@@ -46,7 +46,19 @@
writeLeftCurlyBracket(out, 0);
int indent = 1;
+ writeIndent(out, indent);
+ out.write("private Reference reference;");
+ writeEol(out);
+ writeEol(out);
+
writeDefaultConstructor(def, out, indent);
+
+ //constructor
+ writeIndent(out, indent);
+ out.write("public " + getClassName(def) + "(ConnectionManager cxManager)");
+ writeLeftCurlyBracket(out, indent);
+ writeRightCurlyBracket(out, indent);
+ writeEol(out);
writeConnection(def, out, indent);
writeMetaData(def, out, indent);
@@ -84,7 +96,9 @@
writeEol(out);
out.write("import javax.resource.cci.ResourceAdapterMetaData;");
writeEol(out);
+ out.write("import javax.resource.spi.ConnectionManager;");
writeEol(out);
+ writeEol(out);
}
/**
@@ -115,7 +129,7 @@
writeLeftCurlyBracket(out, indent);
writeIndent(out, indent + 1);
- out.write("return new MyCciConnection();");
+ out.write("return new " + def.getCciConnClass() + "(new " + def.getConnSpecClass() + "());");
writeRightCurlyBracket(out, indent);
writeEol(out);
@@ -123,11 +137,11 @@
out.write("@Override");
writeEol(out);
writeIndent(out, indent);
- out.write("public Connection getConnection(ConnectionSpec properties) throws ResourceException");
+ out.write("public Connection getConnection(ConnectionSpec connSpec) throws ResourceException");
writeLeftCurlyBracket(out, indent);
writeIndent(out, indent + 1);
- out.write("return new MyCciConnection();");
+ out.write("return new " + def.getCciConnClass() + "(connSpec);");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
@@ -149,7 +163,7 @@
writeLeftCurlyBracket(out, indent);
writeIndent(out, indent + 1);
- out.write("return new MyRaMetaData();");
+ out.write("return new " + def.getRaMetaClass() + "();");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
@@ -192,7 +206,7 @@
out.write("public Reference getReference() throws NamingException");
writeLeftCurlyBracket(out, indent);
writeIndent(out, indent + 1);
- out.write("return null;");
+ out.write("return reference;");
writeRightCurlyBracket(out, indent);
writeEol(out);
@@ -202,6 +216,8 @@
writeIndent(out, indent);
out.write("public void setReference(Reference reference)");
writeLeftCurlyBracket(out, indent);
+ writeIndent(out, indent + 1);
+ out.write("this.reference = reference;");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CfCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CfCodeGen.java 2010-05-14 07:01:31 UTC (rev 104791)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/CfCodeGen.java 2010-05-14 09:45:01 UTC (rev 104792)
@@ -46,7 +46,19 @@
writeLeftCurlyBracket(out, 0);
int indent = 1;
+ writeIndent(out, indent);
+ out.write("private Reference reference;");
+ writeEol(out);
+ writeEol(out);
+
writeDefaultConstructor(def, out, indent);
+
+ //constructor
+ writeIndent(out, indent);
+ out.write("public " + getClassName(def) + "(ConnectionManager cxManager)");
+ writeLeftCurlyBracket(out, indent);
+ writeRightCurlyBracket(out, indent);
+ writeEol(out);
writeConnection(def, out, indent);
writeReference(def, out, indent);
@@ -77,7 +89,9 @@
writeEol(out);
out.write("import javax.resource.ResourceException;");
writeEol(out);
+ out.write("import javax.resource.spi.ConnectionManager;");
writeEol(out);
+ writeEol(out);
}
/**
@@ -129,7 +143,7 @@
out.write("public Reference getReference() throws NamingException");
writeLeftCurlyBracket(out, indent);
writeIndent(out, indent + 1);
- out.write("return null;");
+ out.write("return reference;");
writeRightCurlyBracket(out, indent);
writeEol(out);
@@ -139,6 +153,8 @@
writeIndent(out, indent);
out.write("public void setReference(Reference reference)");
writeLeftCurlyBracket(out, indent);
+ writeIndent(out, indent + 1);
+ out.write("this.reference = reference;");
writeRightCurlyBracket(out, indent);
writeEol(out);
}
Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/JCA16AnnoProfile.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/JCA16AnnoProfile.java 2010-05-14 07:01:31 UTC (rev 104791)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/JCA16AnnoProfile.java 2010-05-14 09:45:01 UTC (rev 104792)
@@ -52,6 +52,8 @@
generateClassCode(def, "Ra");
generateClassCode(def, "Mcf");
generateClassCode(def, "Mc");
+ generateClassCode(def, "McMeta");
+ generateClassCode(def, "Cm");
if (!def.isUseCciConnection())
{
@@ -64,8 +66,6 @@
{
generateClassCode(def, "CciConn");
generateClassCode(def, "CciConnFactory");
- generateClassCode(def, "McMeta");
- generateClassCode(def, "Cm");
generateClassCode(def, "ConnMeta");
generateClassCode(def, "RaMeta");
generateClassCode(def, "ConnSpec");
Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McCodeGen.java 2010-05-14 07:01:31 UTC (rev 104791)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McCodeGen.java 2010-05-14 09:45:01 UTC (rev 104792)
@@ -282,10 +282,8 @@
writeEol(out);
writeIndent(out, indent + 1);
- if (def.isUseCciConnection())
- out.write("return new MyManagedConnectionMetaData();");
- else
- out.write("return null;");
+ out.write("return new " + def.getMcMetaClass() + "();");
+
writeRightCurlyBracket(out, indent);
writeEol(out);
}
Modified: projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McfCodeGen.java
===================================================================
--- projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McfCodeGen.java 2010-05-14 07:01:31 UTC (rev 104791)
+++ projects/jboss-jca/trunk/codegenerator/src/main/java/org/jboss/jca/codegenerator/McfCodeGen.java 2010-05-14 09:45:01 UTC (rev 104792)
@@ -212,9 +212,9 @@
writeEol(out);
writeIndent(out, indent + 1);
if (def.isUseCciConnection())
- out.write("return new MyCciConnectionFactory();");
+ out.write("return new " + def.getCciConnFactoryClass() + "(cxManager);");
else
- out.write("return new " + def.getCfClass() + "();");
+ out.write("return new " + def.getCfClass() + "(cxManager);");
writeRightCurlyBracket(out, indent);
writeEol(out);
@@ -229,9 +229,11 @@
writeIndent(out, indent + 1);
if (def.isUseCciConnection())
- out.write("return createConnectionFactory(new MyConnectionManager());");
+ out.write("return new " + def.getCciConnFactoryClass() + "(new " + def.getCmClass() + "());");
else
- out.write("return createConnectionFactory(null);");
+ {
+ out.write("return new " + def.getCfClass() + "(new " + def.getCmClass() + "());");
+ }
writeRightCurlyBracket(out, indent);
writeEol(out);
}
More information about the jboss-cvs-commits
mailing list