Trimming trailing spaces, removing tabs by a script
- using tab width of 4 spaces
- trailing space in property files is converted to unicode, so it is
visible in sources
- bat files use CRLF
- all other text files use just LF
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/build.xml b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/build.xml
index e56cff3..a165eae 100755
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/build.xml
@@ -38,7 +38,7 @@
</target>
<target name="usage">
- <antcall target="usage-common"/>
+ <antcall target="usage-common"/>
</target>
<target name="clean" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.properties b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.properties
index e7a62e6..218ae00 100755
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.properties
@@ -15,12 +15,12 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector"/>
<property name="app.type" value="application"/>
<property name="cciblackbox.path" value="../lib/cciblackbox-tx.jar"/>
-<property name="appname" value="${module}-embedded-cci"/>
+<property name="appname" value="${module}-embedded-cci"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="db.type" value="pointbase"/>
@@ -29,5 +29,5 @@
<property name="sun-cmp-dbschema" value="descriptor/sec_bankadmin_schema.dbschema"/>
<property name="application-client.xml" value="descriptor/application-client.xml"/>
<property name="sun-application-client.xml" value="descriptor/sun-application-client.xml"/>
-<property name="rarname" value="cciblackbox-tx"/>
+<property name="rarname" value="cciblackbox-tx"/> \u0020
<property name="jdbc.drivers" value="com.pointbase.jdbc.jdbcUniversalDriver"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.xml b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.xml
index e932893..a766986 100755
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/build.xml
@@ -31,7 +31,7 @@
&commonBuild;
&testProperties;
&run;
-
+
<target name="all" depends="build,setup,deploy,run,undeploy,unsetup"/>
<target name="run-test" depends="build,deploy,run,undeploy"/>
@@ -80,7 +80,7 @@
</target>
<!--
- Custom target for compilation with local libraries for connector
+ Custom target for compilation with local libraries for connector
-->
<target name="compile-cci" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
@@ -96,7 +96,7 @@
</target>
<target name="build">
- <antcall target="build-embedded-ear"/>
+ <antcall target="build-embedded-ear"/>
</target>
<target name="package-embedded-ejb">
@@ -124,9 +124,9 @@
<mkdir dir="${assemble.dir}"/>
<copy file="descriptor/application.xml" tofile="${assemble.dir}/application.xml"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
- <antcall target="package-embedded-ejb"/>
- <antcall target="package-embedded-client"/>
- <antcall target="package-rar"/>
+ <antcall target="package-embedded-ejb"/>
+ <antcall target="package-embedded-client"/>
+ <antcall target="package-rar"/>
<ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${assemble.dir}/application.xml">
<fileset dir="${assemble.dir}">
@@ -139,30 +139,30 @@
</target>
<target name="deploy" depends="init-common">
- <antcall target="deploy-common"/>
+ <antcall target="deploy-common"/>
<!--
- <antcall target="create-pool">
+ <antcall target="create-pool">
<param name="tx.mode" value="tx"/>
</antcall>
<antcall target="create-resource">
<param name="tx.mode" value="tx"/>
</antcall>
- -->
+ -->
</target>
<target name="undeploy">
<!--
- <antcall target="delete-resource"/>
+ <antcall target="delete-resource"/>
<antcall target="delete-pool"/>
- -->
- <antcall target="undeploy-common"/>
+ -->
+ <antcall target="undeploy-common"/>
</target>
- <target name="run" depends="init-common">
- <antcall target="runclient-common">
- <param name="appclient.application.args" value="Embedded"/>
- </antcall>
+ <target name="run" depends="init-common">
+ <antcall target="runclient-common">
+ <param name="appclient.application.args" value="Embedded"/>
+ </antcall>
</target>
<target name="usage">
@@ -209,10 +209,10 @@
</target>
<target name="create-rar">
- <copy file="descriptor/ra.xml" tofile="${assemble.dir}/rar/META-INF/ra.xml"/>
- <copy file="descriptor/sun-ra.xml" tofile="${assemble.dir}/rar/META-INF/sun-ra.xml"/>
- <copy file="${env.APS_HOME}/sqetests/connector/lib/cciblackbox-tx.jar" tofile="${assemble.dir}/rar/cciblackbox-tx.jar"/>
- <replace file="${assemble.dir}/rar/META-INF/ra.xml" token="DBURL" value="${db.url}"/>
+ <copy file="descriptor/ra.xml" tofile="${assemble.dir}/rar/META-INF/ra.xml"/>
+ <copy file="descriptor/sun-ra.xml" tofile="${assemble.dir}/rar/META-INF/sun-ra.xml"/>
+ <copy file="${env.APS_HOME}/sqetests/connector/lib/cciblackbox-tx.jar" tofile="${assemble.dir}/rar/cciblackbox-tx.jar"/>
+ <replace file="${assemble.dir}/rar/META-INF/ra.xml" token="DBURL" value="${db.url}"/>
</target>
<target name="package-rar" depends="init-common">
@@ -262,5 +262,5 @@
</exec>
</target>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/client/CoffeeClient.java b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/client/CoffeeClient.java
index d35a7b8..cf964c7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/client/CoffeeClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/client/CoffeeClient.java
@@ -30,17 +30,17 @@
String testId = "J2EE Connectors : Embedded Adapter Tests";
try {
- if (args.length == 1) {
- testId = args[0];
- }
+ if (args.length == 1) {
+ testId = args[0];
+ }
System.err.println(testId + " : CoffeeClient started in main...");
- stat.addDescription("J2EE Connectors 1.5: Embedded CCI Adapter tests");
+ stat.addDescription("J2EE Connectors 1.5: Embedded CCI Adapter tests");
Context initial = new InitialContext();
Object objref = initial.lookup("java:comp/env/ejb/SimpleCoffee");
- CoffeeRemoteHome home =
- (CoffeeRemoteHome)PortableRemoteObject.narrow(objref,
+ CoffeeRemoteHome home =
+ (CoffeeRemoteHome)PortableRemoteObject.narrow(objref,
CoffeeRemoteHome.class);
CoffeeRemote coffee = home.create();
@@ -55,23 +55,23 @@
int newCount = coffee.getCoffeeCount();
System.err.println("Coffee count = " + newCount);
- if (count==(newCount-3)) {
- stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.PASS);
- }else{
- stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.FAIL);
- }
+ if (count==(newCount-3)) {
+ stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.PASS);
+ }else{
+ stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.FAIL);
+ }
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
- stat.addStatus("Connector:CCI Connector " + testId + " rar Test status:",stat.FAIL);
+ stat.addStatus("Connector:CCI Connector " + testId + " rar Test status:",stat.FAIL);
ex.printStackTrace();
}finally{
- //print test summary
- stat.printSummary(testId);
+ //print test summary
+ stat.printSummary(testId);
}
- }
+ }
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/ejb/CoffeeBean.java b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/ejb/CoffeeBean.java
index b4ccb7c..9654d7c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/ejb/CoffeeBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci-embedded/ejb/CoffeeBean.java
@@ -60,7 +60,7 @@
IndexedRecord iRec = rf.createIndexedRecord("InputRecord");
Record oRec = ix.execute(iSpec, iRec);
Iterator iterator = ((IndexedRecord)oRec).iterator();
- while(iterator.hasNext()) {
+ while(iterator.hasNext()) {
Object obj = iterator.next();
if(obj instanceof Integer) {
count = ((Integer)obj).intValue();
@@ -99,11 +99,11 @@
private Connection getCCIConnection() {
Connection con = null;
- System.out.println("<========== IN get cci Connection ===========>");
+ System.out.println("<========== IN get cci Connection ===========>");
try {
ConnectionSpec spec = new CciConnectionSpec("DBUSER", "DBPASSWORD");
- System.out.println("<========== Created ISpec ===========>");
- System.out.println("CF value : " + cf);
+ System.out.println("<========== Created ISpec ===========>");
+ System.out.println("CF value : " + cf);
con = cf.getConnection(spec);
} catch (ResourceException ex) {
ex.printStackTrace();
@@ -123,4 +123,4 @@
public void ejbActivate() {}
public void ejbPassivate() {}
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.properties b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.properties
index fa86556..0d75142 100755
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.properties
@@ -15,12 +15,12 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector"/>
<property name="app.type" value="application"/>
<property name="cciblackbox.path" value="../lib/cciblackbox-tx.jar"/>
-<property name="appname" value="connector-cci"/>
+<property name="appname" value="connector-cci"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="db.type" value="pointbase"/>
@@ -29,5 +29,5 @@
<property name="sun-cmp-dbschema" value="descriptor/sec_bankadmin_schema.dbschema"/>
<property name="application-client.xml" value="descriptor/application-client.xml"/>
<property name="sun-application-client.xml" value="descriptor/sun-application-client.xml"/>
-<property name="rarname" value="cciblackbox-tx"/>
+<property name="rarname" value="cciblackbox-tx"/> \u0020
<property name="jdbc.drivers" value="com.pointbase.jdbc.jdbcUniversalDriver"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.xml b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.xml
index b914b9f..a22aa43 100755
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/build.xml
@@ -105,7 +105,7 @@
</target>
<target name="undeploy">
-<!--
+<!--
<antcall target="delete-resource"/>
<antcall target="delete-pool"/>
-->
@@ -119,10 +119,10 @@
<antcall target="undeploy-common"/>
</target>
-<target name="run" depends="init-common">
- <antcall target="runclient-common">
- <param name="appclient.application.args" value="standalone"/>
- </antcall>
+<target name="run" depends="init-common">
+ <antcall target="runclient-common">
+ <param name="appclient.application.args" value="standalone"/>
+ </antcall>
</target>
<!-- setup -->
@@ -139,7 +139,7 @@
<target name="create-pool">
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="cciblackbox-${tx.mode}"/>
- <param name="connection.defname"
+ <param name="connection.defname"
value="jakarta.resource.cci.ConnectionFactory"/>
<param name="connector.conpool.name" value="CCI-CONNPOOL"/>
</antcall>
@@ -181,7 +181,7 @@
<!-- create the appclient jar file with custom classes-->
<target name="appclient-jar" depends="init-common">
- <property name="appclientjar.classes"
+ <property name="appclientjar.classes"
value="**/*Local*.class,**/*Remote*.class,**/*Home*.class,**/*Client*.class"/>
<antcall target="package-appclientjar-common">
<param name="appclientjar.files"
@@ -215,13 +215,13 @@
</target>
<target name="create-rar">
- <copy file="descriptor/ra.xml"
+ <copy file="descriptor/ra.xml"
tofile="${assemble.dir}/rar/META-INF/ra.xml"/>
<copy file="descriptor/sun-ra.xml"
- tofile="${assemble.dir}/rar/META-INF/sun-ra.xml"/>
- <copy file="${env.APS_HOME}/sqetests/connector/lib/cciblackbox-tx.jar"
+ tofile="${assemble.dir}/rar/META-INF/sun-ra.xml"/>
+ <copy file="${env.APS_HOME}/sqetests/connector/lib/cciblackbox-tx.jar"
tofile="${assemble.dir}/rar/cciblackbox-tx.jar"/>
- <replace file="${assemble.dir}/rar/META-INF/ra.xml"
+ <replace file="${assemble.dir}/rar/META-INF/ra.xml"
token="DBURL" value="${db.url}"/>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/client/CoffeeClient.java b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/client/CoffeeClient.java
index d8c26a3..faa0c0e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/client/CoffeeClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/client/CoffeeClient.java
@@ -30,17 +30,17 @@
String testId = "J2EE Connectors 1.5 : Standalone adapter tests";
try {
- if (args.length == 1) {
- testId = args[0];
- }
+ if (args.length == 1) {
+ testId = args[0];
+ }
System.err.println(testId + " : CoffeeClient started in main...");
- stat.addDescription("J2EE Connectors 1.5 : Standalone CCI adapter Tests");
+ stat.addDescription("J2EE Connectors 1.5 : Standalone CCI adapter Tests");
Context initial = new InitialContext();
Object objref = initial.lookup("java:comp/env/ejb/SimpleCoffee");
- CoffeeRemoteHome home =
- (CoffeeRemoteHome)PortableRemoteObject.narrow(objref,
+ CoffeeRemoteHome home =
+ (CoffeeRemoteHome)PortableRemoteObject.narrow(objref,
CoffeeRemoteHome.class);
CoffeeRemote coffee = home.create();
@@ -55,22 +55,22 @@
int newCount = coffee.getCoffeeCount();
System.err.println("Coffee count = " + newCount);
- if (count==(newCount-3)) {
- stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.PASS);
- }else{
- stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.FAIL);
- }
+ if (count==(newCount-3)) {
+ stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.PASS);
+ }else{
+ stat.addStatus("Connector:cci Connector " + testId + " rar Test status:",stat.FAIL);
+ }
- //print test summary
- stat.printSummary(testId);
+ //print test summary
+ stat.printSummary(testId);
} catch (Exception ex) {
System.err.println("Caught an unexpected exception!");
- stat.addStatus("Connector:CCI Connector " + testId + " rar Test status:",stat.FAIL);
+ stat.addStatus("Connector:CCI Connector " + testId + " rar Test status:",stat.FAIL);
ex.printStackTrace();
}
- }
+ }
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/ejb/CoffeeBean.java b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/ejb/CoffeeBean.java
index 2883589..ff1a85f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/ejb/CoffeeBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/SunRaXml/cci/ejb/CoffeeBean.java
@@ -60,7 +60,7 @@
IndexedRecord iRec = rf.createIndexedRecord("InputRecord");
Record oRec = ix.execute(iSpec, iRec);
Iterator iterator = ((IndexedRecord)oRec).iterator();
- while(iterator.hasNext()) {
+ while(iterator.hasNext()) {
Object obj = iterator.next();
if(obj instanceof Integer) {
count = ((Integer)obj).intValue();
@@ -99,11 +99,11 @@
private Connection getCCIConnection() {
Connection con = null;
- System.out.println("<========== IN get cci Connection ===========>");
+ System.out.println("<========== IN get cci Connection ===========>");
try {
ConnectionSpec spec = new CciConnectionSpec("DBUSER", "DBPASSWORD");
- System.out.println("<========== Created ISpec ===========>");
- System.out.println("CF value : " + cf);
+ System.out.println("<========== Created ISpec ===========>");
+ System.out.println("CF value : " + cf);
con = cf.getConnection(spec);
} catch (ResourceException ex) {
ex.printStackTrace();
@@ -123,4 +123,4 @@
public void ejbActivate() {}
public void ejbPassivate() {}
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/build.xml b/appserver/tests/appserv-tests/devtests/connector/build.xml
index db12520..843673f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/build.xml
@@ -37,19 +37,19 @@
<target name="pe-all">
<antcall target="backup-config-pe"/>
- <echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/pe-config.properties. The file will be reverted to its original state after the completion of these tests."/>
- <copy file="${basedir}/config/pe-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
- <antcall target="create-pe-passwordfile"/>
- <antcall target="all"/>
+ <echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/pe-config.properties. The file will be reverted to its original state after the completion of these tests."/>
+ <copy file="${basedir}/config/pe-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
+ <antcall target="create-pe-passwordfile"/>
+ <antcall target="all"/>
<antcall target="restore-config-pe"/>
</target>
-
+
<target name="das-all">
<antcall target="backup-config-pe"/>
<echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/das-config.properties. The file will be reverted to its original state after the completion of these tests."/>
- <copy file="${basedir}/config/das-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
- <antcall target="create-ee-passwordfile"/>
- <antcall target="all"/>
+ <copy file="${basedir}/config/das-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
+ <antcall target="create-ee-passwordfile"/>
+ <antcall target="all"/>
<antcall target="restore-config-pe"/>
</target>
@@ -57,58 +57,58 @@
<antcall target="backup-config-pe"/>
<antcall target="backup-config-ee"/>
<echo message="NOTE: The file ${env.APS_HOME}/config.properties is being replaced with ${basedir}/config/das-config.properties. The file will be reverted to its original state after the completion of these tests."/>
- <copy file="${basedir}/config/ee-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
- <copy file="${basedir}/config/ee-config.properties" tofile="${env.APS_HOME}/eeconfig/ee-config.properties" overwrite="true"/>
- <antcall target="create-ee-passwordfile"/>
- <antcall target="ee"/>
- <antcall target="all"/>
+ <copy file="${basedir}/config/ee-config.properties" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
+ <copy file="${basedir}/config/ee-config.properties" tofile="${env.APS_HOME}/eeconfig/ee-config.properties" overwrite="true"/>
+ <antcall target="create-ee-passwordfile"/>
+ <antcall target="ee"/>
+ <antcall target="all"/>
<antcall target="restore-config-pe"/>
<antcall target="restore-config-ee"/>
</target>
<target name="backup-config-pe" depends="replace-password-with-passwordfile">
- <copy file="${env.APS_HOME}/config.properties" tofile="${env.APS_HOME}/config.properties.bak" overwrite="true"/>
+ <copy file="${env.APS_HOME}/config.properties" tofile="${env.APS_HOME}/config.properties.bak" overwrite="true"/>
</target>
<target name="restore-config-pe" depends="undo-replace-password-with-passwordfile">
- <copy file="${env.APS_HOME}/config.properties.bak" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
+ <copy file="${env.APS_HOME}/config.properties.bak" tofile="${env.APS_HOME}/config.properties" overwrite="true"/>
</target>
-
+
<target name="backup-config-ee">
- <copy file="${env.APS_HOME}/eeconfig/ee-config.properties" tofile="${env.APS_HOME}/eeconfig/ee-config.properties.bak" overwrite="true"/>
+ <copy file="${env.APS_HOME}/eeconfig/ee-config.properties" tofile="${env.APS_HOME}/eeconfig/ee-config.properties.bak" overwrite="true"/>
</target>
<target name="restore-config-ee">
- <copy file="${env.APS_HOME}/eeconfig/ee-config.properties.bak" tofile="${env.APS_HOME}/eeconfig/ee-config.properties" overwrite="true"/>
+ <copy file="${env.APS_HOME}/eeconfig/ee-config.properties.bak" tofile="${env.APS_HOME}/eeconfig/ee-config.properties" overwrite="true"/>
</target>
-
+
<target name="create-pe-passwordfile">
- <property file="${env.APS_HOME}/config.properties"/>
- <echo message="AS_ADMIN_PASSWORD=${admin.password}${line.separator}" file="${env.APS_HOME}/devtests/connector/config/password.txt"/>
+ <property file="${env.APS_HOME}/config.properties"/>
+ <echo message="AS_ADMIN_PASSWORD=${admin.password}${line.separator}" file="${env.APS_HOME}/devtests/connector/config/password.txt"/>
</target>
<target name="create-ee-passwordfile">
- <property file="${env.APS_HOME}/config.properties"/>
- <echo message="AS_ADMIN_PASSWORD=${admin.password}${line.separator}" file="${env.APS_HOME}/devtests/connector/config/password.txt"/>
- <echo message="AS_ADMIN_MASTERPASSWORD=${master.password}${line.separator}" file="${env.APS_HOME}/devtests/connector/config/password.txt" append="true"/>
+ <property file="${env.APS_HOME}/config.properties"/>
+ <echo message="AS_ADMIN_PASSWORD=${admin.password}${line.separator}" file="${env.APS_HOME}/devtests/connector/config/password.txt"/>
+ <echo message="AS_ADMIN_MASTERPASSWORD=${master.password}${line.separator}" file="${env.APS_HOME}/devtests/connector/config/password.txt" append="true"/>
</target>
-
+
<target name="replace-password-with-passwordfile">
- <replace dir="${env.APS_HOME}/config/">
+ <replace dir="${env.APS_HOME}/config/">
<include name="**/*.xml"/>
- <replacetoken>--password ${admin.password}</replacetoken>
- <replacevalue>--passwordfile ${env.APS_HOME}/devtests/connector/config/password.txt</replacevalue>
- </replace>
+ <replacetoken>--password ${admin.password}</replacetoken>
+ <replacevalue>--passwordfile ${env.APS_HOME}/devtests/connector/config/password.txt</replacevalue>
+ </replace>
</target>
<target name="undo-replace-password-with-passwordfile">
- <replace dir="${env.APS_HOME}/config/">
+ <replace dir="${env.APS_HOME}/config/">
<include name="**/*.xml"/>
- <replacetoken>--passwordfile ${env.APS_HOME}/devtests/connector/config/password.txt</replacetoken>
- <replacevalue>--password ${admin.password}</replacevalue>
- </replace>
+ <replacetoken>--passwordfile ${env.APS_HOME}/devtests/connector/config/password.txt</replacetoken>
+ <replacevalue>--password ${admin.password}</replacevalue>
+ </replace>
</target>
-
+
<target name="run-test">
<antcall target="connector">
<param name="connector-target" value="run-test"/>
@@ -168,57 +168,57 @@
<target name="connector">
<record name="connector.output" action="start" />
- <echo message="@@## connector1.5 ##@@"/>
+ <echo message="@@## connector1.5 ##@@"/>
<ant dir="connector1.5" target="${connector-target}"/>
- <echo message="@@## embeddedConnector1.5 ##@@"/>
+ <echo message="@@## embeddedConnector1.5 ##@@"/>
<ant dir="embeddedConnector1.5" target="${connector-target}"/>
- <echo message="@@## embeddedweb ##@@"/>
+ <echo message="@@## embeddedweb ##@@"/>
<ant dir="embeddedweb" target="${connector-target}"/>
<echo message="@@## mq ##@@"/>
<ant dir="mq" target="${connector-target}"/>
- <echo message="@@## nonacc ##@@"/>
+ <echo message="@@## nonacc ##@@"/>
<ant dir="nonacc" target="${connector-target}"/>
-<!-- Commented out the defaultConnectorResource test because we cannot
+<!-- Commented out the defaultConnectorResource test because we cannot
add a non-XA Resource [a database connection in this case] to a global JTS transaction containing
-a XA resource, [a JMS resource in this case]. This test was passing due to a
-JTS bug, that allowed a non-XA resource enlistment after a XA-Resource enlistment in
+a XA resource, [a JMS resource in this case]. This test was passing due to a
+JTS bug, that allowed a non-XA resource enlistment after a XA-Resource enlistment in
a global transaction!
- <ant dir="defaultConnectorResource" target="${connector-target}"/>
+ <ant dir="defaultConnectorResource" target="${connector-target}"/>
-->
<!-- running web2connector twice -->
- <echo message="@@## web2connector ##@@"/>
- <ant dir="web2connector" target="${connector-target}" />
- <echo message="@@## web2connector (second time) ##@@"/>
+ <echo message="@@## web2connector ##@@"/>
+ <ant dir="web2connector" target="${connector-target}" />
+ <echo message="@@## web2connector (second time) ##@@"/>
<ant dir="web2connector" target="${connector-target}" />
<!-- this test is disabled because of dependency on point base database jar which is not available -->
- <!--echo message="@@## redeployRar ##@@"/>
+ <!--echo message="@@## redeployRar ##@@"/>
<ant dir="redeployRar" target="${connector-target}" /-->
- <echo message="@@## nonstringmcfproperties ##@@"/>
+ <echo message="@@## nonstringmcfproperties ##@@"/>
<ant dir="nonstringmcfproperties" target="${connector-target}" />
- <echo message="@@## nonstringraproperties ##@@"/>
+ <echo message="@@## nonstringraproperties ##@@"/>
<ant dir="nonstringraproperties" target="${connector-target}" />
- <echo message="@@## txlevelswitch ##@@"/>
+ <echo message="@@## txlevelswitch ##@@"/>
<ant dir="txlevelswitch" target="${connector-target}" />
- <echo message="@@## threadpool ##@@"/>
+ <echo message="@@## threadpool ##@@"/>
<ant dir="threadpool" target="${connector-target}" />
<record name="connector.output" action="stop" />
</target>
<target name="usage">
- <echo> Usage:
- ant connector1.5 (Executes the connector1.5 tests)
- ant embdeddedWeb (Executes embeddedWeb tests)
- ant mq (Executes the mq tests)
- ant nonacc (Executes the nonacc test)
- ant all (Executes all the connector tests)
- ant clean (cleans all the connector tests)
- ant build (builds all the connector tests)
- ant setup (sets up all resources for connector tests)
- ant deploy (deploys all the connector apps)
- ant run (Executes all the connector tests)
- ant undeploy (undeploys all the connector apps)
- ant unsetup (unsets all resources for connector tests)
- </echo>
+ <echo> Usage:
+ ant connector1.5 (Executes the connector1.5 tests)
+ ant embdeddedWeb (Executes embeddedWeb tests)
+ ant mq (Executes the mq tests)
+ ant nonacc (Executes the nonacc test)
+ ant all (Executes all the connector tests)
+ ant clean (cleans all the connector tests)
+ ant build (builds all the connector tests)
+ ant setup (sets up all resources for connector tests)
+ ant deploy (deploys all the connector apps)
+ ant run (Executes all the connector tests)
+ ant undeploy (undeploys all the connector apps)
+ ant unsetup (unsets all resources for connector tests)
+ </echo>
</target>
<target name="oracle">
diff --git a/appserver/tests/appserv-tests/devtests/connector/config/database.xml b/appserver/tests/appserv-tests/devtests/connector/config/database.xml
index c2c881d..b363832 100644
--- a/appserver/tests/appserv-tests/devtests/connector/config/database.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/config/database.xml
@@ -28,15 +28,15 @@
<!--
<project name="oracle-db-settings" default="create-jdbc-conpool-connector" basedir=".">
-&common;
+&common;
&testcommon;
-->
<target name="create-jdbc-conpool-connector" depends="default-jdbc-conpool, oracle-jdbc-conpool"/>
<target name="default-jdbc-conpool" depends="init-common" unless="oracle">
- <antcall target="create-jdbc-connpool-common"/>
+ <antcall target="create-jdbc-connpool-common"/>
</target>
-
+
<target name="oracle-jdbc-conpool" depends="init-common" if="oracle">
<echo message="creating jdbc connection pool ${jdbc.conpool.name}"
level="verbose"/>
@@ -49,12 +49,12 @@
<arg line="${jdbc.conpool.name}"/>
</exec>
<antcall target="set-oracle-props">
- <param name="pool.type" value="jdbc"/>
- <param name="conpool.name" value="${jdbc.conpool.name}"/>
+ <param name="pool.type" value="jdbc"/>
+ <param name="conpool.name" value="${jdbc.conpool.name}"/>
</antcall>
</target>
-<target name="set-oracle-props" depends="init-common" if="oracle">
+<target name="set-oracle-props" depends="init-common" if="oracle">
<property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
<antcall target="asadmin-common-ignore-fail">
<param name="admin.command" value="set" />
@@ -96,15 +96,15 @@
<target name="execute-sql-connector" depends="init-common, default-sql, sql-oracle"/>
-<target name="default-sql" depends="init-common" unless="oracle" >
- <antcall target="execute-sql-common"/>
+<target name="default-sql" depends="init-common" unless="oracle" >
+ <antcall target="execute-sql-common"/>
</target>
<target name="sql-oracle" depends="init-common" if="oracle">
- <property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
- <property name="domain.lib.ext" value="${env.S1AS_HOME}/domains/domain1/lib/ext"/>
- <property name="oracle.driver.path" value="${domain.lib.ext}/smoracle.jar:${domain.lib.ext}/smbase.jar:${domain.lib.ext}/smresource.jar:${domain.lib.ext}/smutil.jar:${domain.lib.ext}/smspy.jar:${domain.lib.ext}/Oranxo.jar"/>
- <echo message="${oracleForConnector.driver}"/>
+ <property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
+ <property name="domain.lib.ext" value="${env.S1AS_HOME}/domains/domain1/lib/ext"/>
+ <property name="oracle.driver.path" value="${domain.lib.ext}/smoracle.jar:${domain.lib.ext}/smbase.jar:${domain.lib.ext}/smresource.jar:${domain.lib.ext}/smutil.jar:${domain.lib.ext}/smspy.jar:${domain.lib.ext}/Oranxo.jar"/>
+ <echo message="${oracleForConnector.driver}"/>
<echo message="Executing sql statement at ${basedir} from ${sql.file}"
level="verbose"/>
<sql
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/build.xml
index 426ecdd..3548b93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/build.xml
@@ -36,18 +36,18 @@
<target name="all" depends="init-common, clean-common">
<ant dir="src" inheritAll="false" target="all"/>
<antcall target="ear-common">
- <param name="appname" value="simplemdb"/>
- <param name="application.xml" value="META-INF/application.xml"/>
- <param name="glassfish-resources-ear.xml" value="META-INF/glassfish-resources.xml"/>
+ <param name="appname" value="simplemdb"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="glassfish-resources-ear.xml" value="META-INF/glassfish-resources.xml"/>
</antcall>
</target>
<target name="setupJdbc" depends="init-common">
<!--
<antcall target="create-jdbc-conpool-connector">
- <param name="db.class" value="com.sun.sql.jdbcx.oracle.OracleDataSource"/>
+ <param name="db.class" value="com.sun.sql.jdbcx.oracle.OracleDataSource"/>
<param name="jdbc.conpool.name" value="jdbc-pointbase-pool1"/>
- <param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
+ <param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
</antcall>
<antcall target="create-jdbc-resource-common">
@@ -57,7 +57,7 @@
-->
<antcall target="execute-sql-connector">
<param name="sql.file" value="createdb.sql"/>
- </antcall>
+ </antcall>
</target>
<target name="unsetJdbc" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/ejb-jar.xml
index 4bdcc6f..323c0ec 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/sun-ejb-jar.xml
index 2d82ad3..1003566 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:module/eis/testAdmin</jndi-name>
+ <jndi-name>java:module/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/beans/MessageCheckerEJB.java
index bc0c9ee..6e1cf48 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/beans/MessageCheckerEJB.java
@@ -43,7 +43,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -71,11 +71,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -83,22 +83,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -124,18 +124,18 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
/*try{
-
+
Context ic = new InitialContext();
Object ds = ic.lookup("java:module/jdbc/module-level-resource");
System.out.println("java:module/jdbc/module-level-resource : " + ds);
@@ -173,7 +173,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -184,7 +184,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/client/Client.java
index 05c4265..ec77ce5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus(" Connector 1.5 test - " + testCount, stat.FAIL);
} else {
stat.addStatus(" Connector 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("simplemdb");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/mdb/MyMessageBean.java
index 54e77ea..6b12904 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/app/src/mdb/MyMessageBean.java
@@ -30,41 +30,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -75,7 +75,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -91,10 +91,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -104,63 +104,63 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
/*
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:app/jdbc/XAPointbase");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:app/jdbc/XAPointbase");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:app/jdbc/XAPointbase");
//debug("Looked up Datasource\n");
@@ -171,7 +171,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -180,9 +180,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -198,9 +198,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -213,9 +213,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/build.xml
index 8b0380e..a068e1c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/build.xml
@@ -62,7 +62,7 @@
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="simplemdb" />
+ <param name="appname" value="simplemdb" />
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/build.xml
index 2b77489..783991d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/DeliveryWork.java
index 1f59b98..652d68b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/DeliveryWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -37,7 +37,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -45,7 +45,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -56,7 +56,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -79,11 +79,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -94,14 +94,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/MyAdminObject.java
index 10483ed..1d02c62 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/MyAdminObject.java
@@ -38,13 +38,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleResourceAdapterImpl.java
index 6e5353f..3df7070 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,21 +68,21 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -92,14 +92,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -116,7 +116,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -124,7 +124,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -172,7 +172,7 @@
ex.printStackTrace();
}
}
-
+
debug("005. Simple RA start...");
}
@@ -206,13 +206,13 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -228,7 +228,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/TestWMWork.java
index bb05534..de93bc1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/WorkDispatcher.java
index aec89be..75d7530 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -246,7 +246,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -261,14 +261,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -291,13 +291,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/XID.java
index 0cb77b2..2bea121 100755
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml-module-scope/ra/src/connector/XID.java
@@ -31,8 +31,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -50,10 +50,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -93,7 +93,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/build.xml
index ddd053e..f04f097 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/build.xml
@@ -36,18 +36,18 @@
<target name="all" depends="init-common, clean-common">
<ant dir="src" inheritAll="false" target="all"/>
<antcall target="ear-common">
- <param name="appname" value="simplemdb"/>
- <param name="application.xml" value="META-INF/application.xml"/>
- <param name="glassfish-resources-ear.xml" value="src/META-INF/glassfish-resources.xml"/>
+ <param name="appname" value="simplemdb"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="glassfish-resources-ear.xml" value="src/META-INF/glassfish-resources.xml"/>
</antcall>
</target>
<target name="setupJdbc" depends="init-common">
<!--
<antcall target="create-jdbc-conpool-connector">
- <param name="db.class" value="com.sun.sql.jdbcx.oracle.OracleDataSource"/>
+ <param name="db.class" value="com.sun.sql.jdbcx.oracle.OracleDataSource"/>
<param name="jdbc.conpool.name" value="jdbc-pointbase-pool1"/>
- <param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
+ <param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
</antcall>
<antcall target="create-jdbc-resource-common">
@@ -57,7 +57,7 @@
-->
<antcall target="execute-sql-connector">
<param name="sql.file" value="createdb.sql"/>
- </antcall>
+ </antcall>
</target>
<target name="unsetJdbc" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml
index 4bdcc6f..323c0ec 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml
index e46577f..cb8cd23 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:app/eis/testAdmin</jndi-name>
+ <jndi-name>java:app/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java
index 7d78c41..824e036 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java
@@ -43,7 +43,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -71,11 +71,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -83,22 +83,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -124,18 +124,18 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:app/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls = (MyAdminObject) ic.lookup("java:app/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
/*
try{
-
+
Context ic = new InitialContext();
Object ds = ic.lookup("java:app/jdbc/app-level-resource");
System.out.println("java:app/jdbc/app-level-resource : " + ds);
@@ -173,7 +173,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -184,7 +184,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/build.properties
index dad207b..0b38c19 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/client/Client.java
index 05c4265..ec77ce5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus(" Connector 1.5 test - " + testCount, stat.FAIL);
} else {
stat.addStatus(" Connector 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("simplemdb");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/mdb/MyMessageBean.java
index ea919dc..cbd7094 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,63 +103,63 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
/*
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:app/jdbc/XAPointbase");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:app/jdbc/XAPointbase");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:app/jdbc/XAPointbase");
//debug("Looked up Datasource\n");
@@ -170,7 +170,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -179,9 +179,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -197,9 +197,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -212,9 +212,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/build.xml
index 8b0380e..a068e1c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/build.xml
@@ -62,7 +62,7 @@
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="simplemdb" />
+ <param name="appname" value="simplemdb" />
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/build.xml
index 2b77489..783991d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/MyAdminObject.java
index 10483ed..1d02c62 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/MyAdminObject.java
@@ -38,13 +38,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java
index 6e5353f..3df7070 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,21 +68,21 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -92,14 +92,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -116,7 +116,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -124,7 +124,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -172,7 +172,7 @@
ex.printStackTrace();
}
}
-
+
debug("005. Simple RA start...");
}
@@ -206,13 +206,13 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -228,7 +228,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/TestWMWork.java
index bb05534..de93bc1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java
index aec89be..75d7530 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -246,7 +246,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -261,14 +261,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -291,13 +291,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/XID.java
index 0cb77b2..2bea121 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5-resourcesxml/ra/src/connector/XID.java
@@ -31,8 +31,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -50,10 +50,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -93,7 +93,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/build.xml
index cd0d193..67b9828 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/build.xml
@@ -36,16 +36,16 @@
<target name="all" depends="init-common, clean-common">
<ant dir="src" inheritAll="false" target="all"/>
<antcall target="ear-common">
- <param name="appname" value="simplemdb"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="simplemdb"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
</target>
<target name="setupJdbc" depends="init-common">
<antcall target="create-jdbc-conpool-connector">
- <param name="db.class" value="org.apache.derby.jdbc.ClientXADataSource"/>
+ <param name="db.class" value="org.apache.derby.jdbc.ClientXADataSource"/>
<param name="jdbc.conpool.name" value="jdbc-pointbase-pool1"/>
- <param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
+ <param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
</antcall>
<antcall target="create-jdbc-resource-common">
@@ -55,7 +55,7 @@
<antcall target="execute-sql-connector">
<param name="sql.file" value="createdb.sql"/>
- </antcall>
+ </antcall>
</target>
<target name="unsetJdbc" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/ejb-jar.xml
index 4bdcc6f..323c0ec 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/sun-ejb-jar.xml
index 1146a5a..0a7e0da 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/beans/MessageCheckerEJB.java
index b50d7e4..5429ea9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/beans/MessageCheckerEJB.java
@@ -43,7 +43,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -71,11 +71,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -83,22 +83,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -124,10 +124,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -162,7 +162,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -173,7 +173,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/build.properties
index dad207b..0b38c19 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/client/Client.java
index bbdecfa..24280d9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.5 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("connector1.5ID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/mdb/MyMessageBean.java
index b7d443b..cd9f108 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,63 +103,63 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
/*
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -170,7 +170,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -179,9 +179,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -197,9 +197,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -212,9 +212,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5/build.xml
index 32093c8..403d973 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/build.xml
@@ -60,7 +60,7 @@
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="simplemdb" />
+ <param name="appname" value="simplemdb" />
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/build.xml
index 2b77489..783991d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyAdminObject.java
index 862f9ff..d199d01 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyAdminObject.java
@@ -38,11 +38,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
index 6e5353f..3df7070 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,21 +68,21 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -92,14 +92,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -116,7 +116,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -124,7 +124,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -172,7 +172,7 @@
ex.printStackTrace();
}
}
-
+
debug("005. Simple RA start...");
}
@@ -206,13 +206,13 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -228,7 +228,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/TestWMWork.java
index bb05534..de93bc1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/WorkDispatcher.java
index 34a604f..cd98c45 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -243,7 +243,7 @@
break;
}
}
-
+
debug("LEAVE...");
}
@@ -258,14 +258,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -288,13 +288,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
@@ -310,7 +310,7 @@
Controls.done = true;
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
+ Controls.readyLock.notify();
}
} catch (Exception ex) {
ex.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/XID.java
index 4ed3087..1bb805d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/connector1.5/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml
index 696dd3e..5a5210e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/ejb-jar.xml
@@ -81,8 +81,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml
index 7d812d0..0d73a92 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/META-INF/sun-ejb-jar.xml
@@ -84,7 +84,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:app/eis/testAdmin</jndi-name>
+ <jndi-name>java:app/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java
index b50d7e4..5429ea9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/beans/MessageCheckerEJB.java
@@ -43,7 +43,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -71,11 +71,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -83,22 +83,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -124,10 +124,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -162,7 +162,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -173,7 +173,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/build.properties
index dad207b..0b38c19 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/client/Client.java
index cf25e7d..4e2536c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/client/Client.java
@@ -29,23 +29,23 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
- int testCount = 1;
+ debug("doTest() ENTER...");
+ int testCount = 1;
try{
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("java:app/jdbc/XAPointbase");
@@ -54,7 +54,7 @@
}catch(Exception e){
stat.addStatus("ID Connector Embedded 1.5 test - " + testCount++, stat.FAIL);
System.out.println("Exception during lookup of java:app/jdbc/XAPointbase : " + e.getMessage());
- //e.printStackTrace();
+ //e.printStackTrace();
}
try{
InitialContext ic = new InitialContext();
@@ -64,7 +64,7 @@
}catch(Exception e){
stat.addStatus("ID Connector Embedded 1.5 test - " + testCount++, stat.FAIL);
System.out.println("Exception during lookup of java:app/jdbc/test-resource: " + e.getMessage());
- //e.printStackTrace();
+ //e.printStackTrace();
}
/* try{
InitialContext ic = new InitialContext();
@@ -79,13 +79,13 @@
try {
res = "ALL TESTS PASSED";
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
@@ -93,11 +93,11 @@
break;
} else {
stat.addStatus("ID Connector Embedded 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount++;
+ testCount++;
}
} catch (Exception ex) {
@@ -118,14 +118,14 @@
stat.printSummary("connector1.5EmbeddedID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -134,7 +134,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -142,7 +142,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -150,7 +150,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/mdb/MyMessageBean.java
index d1d78f2..d806951 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/app/src/mdb/MyMessageBean.java
@@ -30,41 +30,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -75,7 +75,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -91,10 +91,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -104,63 +104,63 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
/*
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -171,7 +171,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -180,9 +180,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -198,9 +198,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -213,9 +213,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/build.xml
index 6c848a4..172b565 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/build.xml
@@ -52,7 +52,7 @@
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
<param name="appclient.classpath" value="${env.APS_HOME}/devtests/connector/embeddedConnector1.5-resourcesxml/ra/generic-ra.jar"/>
- <param name="appname" value="generic-embedded" />
+ <param name="appname" value="generic-embedded" />
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/build.xml
index 2b77489..783991d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyAdminObject.java
index 862f9ff..d199d01 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyAdminObject.java
@@ -38,11 +38,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java
index 946d987..bb7918e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -42,7 +42,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -51,7 +51,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -60,7 +60,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -76,7 +76,7 @@
this.resourceadapter = ra;
}
- public void validate() {}
+ public void validate() {}
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java
index 21e791d..1cf5ac1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,21 +68,21 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -92,14 +92,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -116,7 +116,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -124,7 +124,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -172,7 +172,7 @@
ex.printStackTrace();
}
}
-
+
debug("005. Simple RA start...");
}
@@ -204,12 +204,12 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -225,7 +225,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/TestWMWork.java
index 7e585a3..9cd0663 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java
index 34a604f..cd98c45 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -243,7 +243,7 @@
break;
}
}
-
+
debug("LEAVE...");
}
@@ -258,14 +258,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -288,13 +288,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
@@ -310,7 +310,7 @@
Controls.done = true;
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
+ Controls.readyLock.notify();
}
} catch (Exception ex) {
ex.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/XID.java
index 552873e..dc87bb4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5-resourcesxml/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/build.xml
index b3d7eb4..0d8f997 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/build.xml
@@ -38,8 +38,8 @@
<antcall target="build-ear"/>
<!--
<antcall target="ear-common">
- <param name="appname" value="generic-embedded"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="generic-embedded"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
-->
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/ejb-jar.xml
index 696dd3e..5a5210e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/ejb-jar.xml
@@ -81,8 +81,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/sun-ejb-jar.xml
index f72ad79..6e0daee 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/META-INF/sun-ejb-jar.xml
@@ -83,7 +83,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/beans/MessageCheckerEJB.java
index b50d7e4..5429ea9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/beans/MessageCheckerEJB.java
@@ -43,7 +43,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -71,11 +71,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -83,22 +83,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -124,10 +124,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -162,7 +162,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -173,7 +173,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/build.properties
index dad207b..0b38c19 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/client/Client.java
index 14c1693..30f6290 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/client/Client.java
@@ -28,34 +28,34 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
@@ -63,11 +63,11 @@
break;
} else {
stat.addStatus(" Embedded-Connector-1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount++;
+ testCount++;
}
} catch (Exception ex) {
@@ -78,14 +78,14 @@
stat.printSummary("Embedded-Connector-1.5");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -94,7 +94,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -102,7 +102,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -110,7 +110,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/mdb/MyMessageBean.java
index b7d443b..cd9f108 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,63 +103,63 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
/*
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -170,7 +170,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -179,9 +179,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -197,9 +197,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -212,9 +212,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/build.xml
index f9f0aee..861e7bb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/build.xml
@@ -48,7 +48,7 @@
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="generic-embedded" />
+ <param name="appname" value="generic-embedded" />
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/build.xml
index 2b77489..783991d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyAdminObject.java
index 862f9ff..d199d01 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyAdminObject.java
@@ -38,11 +38,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleActivationSpec.java
index 946d987..bb7918e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -42,7 +42,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -51,7 +51,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -60,7 +60,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -76,7 +76,7 @@
this.resourceadapter = ra;
}
- public void validate() {}
+ public void validate() {}
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
index 21e791d..1cf5ac1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,21 +68,21 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -92,14 +92,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -116,7 +116,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -124,7 +124,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -172,7 +172,7 @@
ex.printStackTrace();
}
}
-
+
debug("005. Simple RA start...");
}
@@ -204,12 +204,12 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -225,7 +225,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/TestWMWork.java
index 7e585a3..9cd0663 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/WorkDispatcher.java
index 34a604f..cd98c45 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -243,7 +243,7 @@
break;
}
}
-
+
debug("LEAVE...");
}
@@ -258,14 +258,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -288,13 +288,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
@@ -310,7 +310,7 @@
Controls.done = true;
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
+ Controls.readyLock.notify();
}
} catch (Exception ex) {
ex.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/XID.java
index 552873e..dc87bb4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedConnector1.5/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/META-INF/glassfish-resources.xml
index b03bbab..dae8cac 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/META-INF/glassfish-resources.xml
@@ -34,12 +34,12 @@
<property name="URL" value="jdbc:derby://localhost:1527/testdb;create=true;"/>
</connector-connection-pool>
-
+
<connector-resource jndi-name="jdbc/ejb-subclassing" pool-name="web-subclassingApp#jdbcra#javax.sql.DataSource"/>
<admin-object-resource jndi-name="eis/jdbcAdmin" res-type="com.sun.jdbcra.spi.JdbcSetupAdmin" res-adapter="web-subclassingApp#jdbcra">
<property name="TableName" value="customer2"/>
- <property name="JndiName" value="java:app/jdbc/ejb-subclassing"/>
+ <property name="JndiName" value="java:app/jdbc/ejb-subclassing"/>
<property name="SchemaName" value="DBUSER"/>
<property name="NoOfRows" value="1"/>
</admin-object-resource>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.properties b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.xml
index 9e0cb6b..b99b43f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/build.xml
@@ -32,7 +32,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<!--
<target name="all" depends="build,setup,deploy-war, run-war, undeploy-war, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -41,15 +41,15 @@
<target name="all" depends="build, setup, deploy-ear, run-ear, unsetup, undeploy-ear"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
@@ -57,12 +57,12 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
</antcall>
-
+
</target>
<target name="create-pool">
<antcall target="create-connector-connpool-common">
@@ -71,9 +71,9 @@
<param name="connector.conpool.name" value="embedded-ra-pool"/>
</antcall>
<antcall target="set-oracle-props">
- <param name="pool.type" value="connector"/>
- <param name="conpool.name" value="embedded-ra-pool"/>
- </antcall>
+ <param name="pool.type" value="connector"/>
+ <param name="conpool.name" value="embedded-ra-pool"/>
+ </antcall>
</target>
<target name="create-resource">
<antcall target="create-connector-resource-common">
@@ -86,18 +86,18 @@
<target name="create-admin-object" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-subclassing:SchemaName=connector:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- <!--antcall target="reconfig-common"/-->
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ <!--antcall target="reconfig-common"/-->
</target>
-
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -105,15 +105,15 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
<!--antcall target="reconfig-common"/-->
</target>
@@ -122,7 +122,7 @@
<param name="sql.file" value="sql/dropBankTables.sql"/>
</antcall>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -132,7 +132,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -148,9 +148,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -159,27 +159,27 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
@@ -187,9 +187,9 @@
<include name="META-INF/glassfish-resources.xml"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="deploy-common"/>
</target>
@@ -197,27 +197,27 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-ejb (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-ejb (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-ejb (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-ejb (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<!-- <antcall target="delete-ra-config"/>-->
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/descriptor/sun-ejb-jar.xml
index 7995ce3..51f3bec 100755
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>java:app/jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>java:app/jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/Customer.java
index 5922f31..3615e16 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/Customer.java
@@ -46,4 +46,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerChecking.java
index ff15e7e..89dc323 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerChecking.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerEJB.java
index 0520b60..07220db 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavings.java
index 2740692..c45a1c5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavings.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.properties
index ee2eca0..fd21c3d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.xml
index 3bb6c3f..fc54581 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
</classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index a956d97..11ad746 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/*
@@ -279,184 +279,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -506,162 +506,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 60e1e4e..65e8fb5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -122,136 +122,136 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>9092</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBUSER</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBPASSWORD</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DatabaseName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:pointbase:server://localhost:9092/sqe-samples,new</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>NetworkProtocol</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Delimiter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>com.pointbase.jdbc.jdbcDataSource</config-property-value>
</config-property>
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
-
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 411b73f..d9874a0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,55 +68,55 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
setIsolation(mc);
isValid(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -127,409 +127,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -539,35 +539,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DataSource.java
index 2068430..739ff4d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,91 +114,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/servlet/SimpleBankServlet.java
index 8295007..35b6e5c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/servlet/SimpleBankServlet.java
@@ -17,17 +17,17 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
import javax.rmi.PortableRemoteObject;
-import jakarta.ejb.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -43,14 +43,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -66,14 +66,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -90,7 +90,7 @@
customerSavings = customerSavingsHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -103,7 +103,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -115,7 +115,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -127,12 +127,12 @@
customerSavingsHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -142,7 +142,7 @@
customerSavings = (CustomerSavings)customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -151,7 +151,7 @@
customerChecking = (CustomerChecking)customerCheckingHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -211,9 +211,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb-resourcesxml-defaultconnpool/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.properties b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.xml
index 1dbf8d6..39ae042 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/build.xml
@@ -32,7 +32,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<!--
<target name="all" depends="build,setup,deploy-war, run-war, undeploy-war, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -41,15 +41,15 @@
<target name="all" depends="build, deploy-ear, setup, run-ear, unsetup, undeploy-ear"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
@@ -57,7 +57,7 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
@@ -65,7 +65,7 @@
<antcall target="create-pool"/>
<antcall target="create-resource"/>
<antcall target="create-admin-object"/>
-
+
</target>
<target name="create-pool">
<antcall target="create-connector-connpool-common">
@@ -74,9 +74,9 @@
<param name="connector.conpool.name" value="embedded-ra-pool"/>
</antcall>
<antcall target="set-oracle-props">
- <param name="pool.type" value="connector"/>
- <param name="conpool.name" value="embedded-ra-pool"/>
- </antcall>
+ <param name="pool.type" value="connector"/>
+ <param name="conpool.name" value="embedded-ra-pool"/>
+ </antcall>
</target>
<target name="create-resource">
<antcall target="create-connector-resource-common">
@@ -89,17 +89,17 @@
<target name="create-admin-object" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-subclassing:SchemaName=connector:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- </target>
-
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ </target>
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -107,16 +107,16 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
- </target>
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
+ </target>
<target name="unsetup">
<antcall target="execute-sql-connector">
@@ -127,7 +127,7 @@
<antcall target="delete-pool"/>
<antcall target="delete-admin-object"/>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -137,7 +137,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -153,9 +153,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -164,34 +164,34 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="create-ra-config"/>
<antcall target="deploy-common"/>
@@ -200,27 +200,27 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-ejb (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-ejb (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-ejb (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-ejb (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/descriptor/sun-ejb-jar.xml
index 1d1200d..df4bb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/Customer.java
index 5922f31..3615e16 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/Customer.java
@@ -46,4 +46,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerChecking.java
index ff15e7e..89dc323 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerChecking.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerEJB.java
index 0520b60..07220db 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavings.java
index 2740692..c45a1c5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavings.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.properties
index ee2eca0..fd21c3d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.xml
index cb66a45..3aceef2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
failonerror="true">
<classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
</classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index 4632ae1..b4fd124 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,404 +53,404 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
-
+
/**
* Retrieves the the first warning reported by calls on the underlying
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
@Override
@@ -536,141 +536,141 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
-
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 60e1e4e..65e8fb5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -122,136 +122,136 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>9092</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBUSER</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBPASSWORD</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DatabaseName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:pointbase:server://localhost:9092/sqe-samples,new</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>NetworkProtocol</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Delimiter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>com.pointbase.jdbc.jdbcDataSource</config-property-value>
</config-property>
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
-
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 411b73f..d9874a0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,55 +68,55 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
setIsolation(mc);
isValid(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -127,409 +127,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -539,35 +539,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
index 219a365..4bf8b7b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,22 +114,22 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
@Override
@@ -140,67 +140,67 @@
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
@Override
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/servlet/SimpleBankServlet.java
index ff76f00..882ada4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/servlet/SimpleBankServlet.java
@@ -17,17 +17,17 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
import javax.rmi.PortableRemoteObject;
-import jakarta.ejb.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -43,14 +43,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -66,14 +66,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -90,7 +90,7 @@
customerSavings = customerSavingsHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -103,7 +103,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -115,7 +115,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -127,12 +127,12 @@
customerSavingsHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -142,7 +142,7 @@
customerSavings = (CustomerSavings)customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -151,7 +151,7 @@
customerChecking = (CustomerChecking)customerCheckingHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -211,9 +211,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/simpleBank.sql b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/simpleBank.sql
index 6ef75c3..e17aef4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/simpleBank.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/embeddedweb/sql/simpleBank.sql
@@ -1,14 +1,14 @@
drop table customer2;
create table customer2 (
- SSN varchar2(9),
- lastNAme varchar2(20),
- firstname varchar2(20),
- address1 varchar2 (20),
- address2 varchar2(20),
- city varchar2(10),
- state varchar2(10),
- zipcode varchar2(5),
+ SSN varchar2(9),
+ lastNAme varchar2(20),
+ firstname varchar2(20),
+ address1 varchar2 (20),
+ address2 varchar2(20),
+ city varchar2(10),
+ state varchar2(10),
+ zipcode varchar2(5),
savingsbalance number(10) ,
checkingbalance number(10) );
diff --git a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/build.properties
index af24daf..20bc85d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/build.properties
@@ -15,19 +15,19 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="jdbc-markconnectionasbad.xa"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="appclient.application.args" value="12"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/client/Client.java
index e95a7d0..28dbfb5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/client/Client.java
@@ -117,14 +117,14 @@
stat.addStatus(" Mark-Connection-As-Bad [Local-XA -Shareable-Shareable - Read-Write] : ", stat.FAIL);
}
- if (simpleBMP.test11() && getMonitorablePropertyOfConnectionPool("java:app/jdbc-shareable-pool") == 15 &&
+ if (simpleBMP.test11() && getMonitorablePropertyOfConnectionPool("java:app/jdbc-shareable-pool") == 15 &&
getMonitorablePropertyOfConnectionPool("java:app/jdbc-local-pool") == 3) {
stat.addStatus(" Mark-Connection-As-Bad [Local-XA -Shareable-Shareable - Read-Read] : ", stat.PASS);
} else {
stat.addStatus(" Mark-Connection-As-Bad [Local-XA -Shareable-Shareable - Read-Read] : ", stat.FAIL);
}
- if (simpleBMP.test12() && getMonitorablePropertyOfConnectionPool("java:app/jdbc-shareable-pool") == 16 &&
+ if (simpleBMP.test12() && getMonitorablePropertyOfConnectionPool("java:app/jdbc-shareable-pool") == 16 &&
getMonitorablePropertyOfConnectionPool("java:app/jdbc-local-pool") == 4) {
stat.addStatus(" Mark-Connection-As-Bad [Local-XA -Shareable-Shareable - Write-Read] : ", stat.PASS);
} else {
@@ -139,20 +139,20 @@
public int getMonitorablePropertyOfConnectionPool(String poolName) throws Exception {
- final String urlStr = "service:jmx:rmi:///jndi/rmi://" + HOST_NAME + ":" + JMX_PORT + "/jmxrmi";
+ final String urlStr = "service:jmx:rmi:///jndi/rmi://" + HOST_NAME + ":" + JMX_PORT + "/jmxrmi";
final JMXServiceURL url = new JMXServiceURL(urlStr);
- final JMXConnector jmxConn = JMXConnectorFactory.connect(url);
- final MBeanServerConnection connection = jmxConn.getMBeanServerConnection();
+ final JMXConnector jmxConn = JMXConnectorFactory.connect(url);
+ final MBeanServerConnection connection = jmxConn.getMBeanServerConnection();
ObjectName objectName =
// new ObjectName("amx:pp=/mon/server-mon[server],type=jdbc-connection-pool-mon,name=resources/" + poolName);
// new ObjectName("amx:pp=/mon/server-mon[server],type=jdbc-connection-pool-mon,name=applications/jdbc-markconnectionasbad.xaApp/resources/"+ poolName);
new ObjectName("amx:pp=/mon/server-mon[server],type=jdbc-connection-pool-mon,name=\"applications/jdbc-markconnectionasbad.xaApp/resources//"+ poolName+"\"");
- javax.management.openmbean.CompositeDataSupport returnValue =
- (javax.management.openmbean.CompositeDataSupport)
- connection.getAttribute(objectName, NUM_CON_DESTROYED_COUNT);
+ javax.management.openmbean.CompositeDataSupport returnValue =
+ (javax.management.openmbean.CompositeDataSupport)
+ connection.getAttribute(objectName, NUM_CON_DESTROYED_COUNT);
return new Integer(returnValue.get("count").toString());
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/create_pointbase.sql
index 46be39f..6d9a7c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/create_pointbase.sql
@@ -1,8 +1,8 @@
-Drop table O_Customer;
-
-CREATE TABLE O_Customer (id integer , description char(50));
-
-drop table owner;
-
-create table owner ( id integer, description char(50));
-
+Drop table O_Customer;
+
+CREATE TABLE O_Customer (id integer , description char(50));
+
+drop table owner;
+
+create table owner ( id integer, description char(50));
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/drop_pointbase.sql
index a5ea2f8..d87d5de 100755
--- a/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/markconnectionasbad.xa.resources-xml/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table O_Customer;
-drop table owner;
+Drop table O_Customer;
+drop table owner;
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/build.xml
index 7fc4b5f..38ddf78 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/build.xml
@@ -86,16 +86,16 @@
</target>
<target name="usage">
- <echo> Usage:
- ant cmt (Executes the cmt test)
- ant all (Executes all the mq tests)
- ant clean (cleans all the mq tests)
- ant build (builds all the mq tests)
- ant setup (sets up all resources for mq tests)
- ant deploy (deploys all the mq apps)
- ant run (Executes all the mq tests)
- ant undeploy (undeploys all the mq apps)
- ant unsetup (unsets all resources for mq tests)
- </echo>
+ <echo> Usage:
+ ant cmt (Executes the cmt test)
+ ant all (Executes all the mq tests)
+ ant clean (cleans all the mq tests)
+ ant build (builds all the mq tests)
+ ant setup (sets up all resources for mq tests)
+ ant deploy (deploys all the mq apps)
+ ant run (Executes all the mq tests)
+ ant undeploy (undeploys all the mq apps)
+ ant unsetup (unsets all resources for mq tests)
+ </echo>
</target>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.properties
index 87140b8..987f76c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="mq-cmt"/>
-<property name="appname" value="${module}-excpt"/>
+<property name="appname" value="${module}-excpt"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="com.sun.s1peqe.mq.cmt.excpt.client.SimpleMessageClient"/>
+<property name="test.client"\u0020
+ value="com.sun.s1peqe.mq.cmt.excpt.client.SimpleMessageClient"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.xml
index 7e2d433..f18d1c9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/build.xml
@@ -40,7 +40,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -52,12 +52,12 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
</antcall>
- </target>
+ </target>
<target name="configure-container" depends="init-common">
<!-- Workaround for issue 18783 -->
@@ -67,12 +67,12 @@
value="mdb-container"/>
</antcall>
<antcall target="asadmin-common">
- <param name="admin.command" value="set"/>
- <param name="operand.props" value="server.mdb-container.property.cmt-max-runtime-exceptions=4"/>
- </antcall>
- <antcall target="restart-server-instance-common"/>
+ <param name="admin.command" value="set"/>
+ <param name="operand.props" value="server.mdb-container.property.cmt-max-runtime-exceptions=4"/>
+ </antcall>
+ <antcall target="restart-server-instance-common"/>
</target>
-
+
<target name="setup" depends="init-common">
<antcall target="deploy-jms-common"/>
</target>
@@ -83,27 +83,27 @@
</antcall>
<antcall target="deploy-common"/>
</target>
-
+
<target name="run" depends="init-common">
<property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
<exec executable="${APPCLIENT}" failonerror="false">
<env key="APPCPATH" value="${env.S1AS_HOME}/domains/domain1/lib/ext/Oranxo.jar:${env.APS_HOME}/lib/reporter.jar"/>
<arg line="-client ${assemble.dir}/${appname}AppClient.jar"/>
- <arg line="-name ${appname}Client"/>
- <arg line="-textauth"/>
- <arg line="-user j2ee"/>
- <arg line="-password j2ee"/>
- <arg line=" ${oracleForConnector.driver} ${oracleForConnector.url} ${oracleForConnector.user} ${oracleForConnector.pwd} "/>
- <arg line="-xml ${env.S1AS_HOME}/domains/${admin.domain}/config/glassfish-acc.xml"/>
+ <arg line="-name ${appname}Client"/>
+ <arg line="-textauth"/>
+ <arg line="-user j2ee"/>
+ <arg line="-password j2ee"/>
+ <arg line=" ${oracleForConnector.driver} ${oracleForConnector.url} ${oracleForConnector.user} ${oracleForConnector.pwd} "/>
+ <arg line="-xml ${env.S1AS_HOME}/domains/${admin.domain}/config/glassfish-acc.xml"/>
</exec>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/drop_pointbase.sql"/>
</antcall>
- </target>
+ </target>
<target name="unsetup" depends="init-common">
<antcall target="undeploy-jms-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/client/SimpleMessageClient.java b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/client/SimpleMessageClient.java
index 7c6a084..c836534 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/client/SimpleMessageClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/client/SimpleMessageClient.java
@@ -23,7 +23,7 @@
public class SimpleMessageClient {
- private static SimpleReporterAdapter stat =
+ private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
public static void main(String[] args) {
@@ -39,7 +39,7 @@
QueueSender queueSender = null;
TextMessage message = null;
final int NUM_MSGS = 3;
- boolean passed = true;
+ boolean passed = true;
try {
jndiContext = new InitialContext();
@@ -77,33 +77,33 @@
for (int i = 0; i < NUM_MSGS; i++) {
message.setText("This is message " + (i + 1));
- message.setIntProperty("Id",i);
+ message.setIntProperty("Id",i);
System.out.println("Sending message: " +
message.getText());
queueSender.send(message);
}
-
- for (int i=0; i< args.length; i++)
- System.out.println("Client: "+ args[i]);
+
+ for (int i=0; i< args.length; i++)
+ System.out.println("Client: "+ args[i]);
Thread.sleep(10000);
- Class.forName(args[0]);
- String url = args[1];
- java.sql.Connection con = DriverManager.getConnection(url,args[2],args[3]);
- ResultSet rs = con.createStatement().executeQuery("select exCount from mq_cmt_excpt");
- int count = 0;
- while (rs.next()){
- count = rs.getInt(1);
- }
+ Class.forName(args[0]);
+ String url = args[1];
+ java.sql.Connection con = DriverManager.getConnection(url,args[2],args[3]);
+ ResultSet rs = con.createStatement().executeQuery("select exCount from mq_cmt_excpt");
+ int count = 0;
+ while (rs.next()){
+ count = rs.getInt(1);
+ }
rs.close();
- con.close();
- if (count != 15) {
- throw new Exception("test failed because the exception count was " + count);
- }
- System.out.println("Each message got redelivered " + (count/NUM_MSGS -1) + " times successfully and then stopped delivery");
+ con.close();
+ if (count != 15) {
+ throw new Exception("test failed because the exception count was " + count);
+ }
+ System.out.println("Each message got redelivered " + (count/NUM_MSGS -1) + " times successfully and then stopped delivery");
} catch (Throwable e) {
System.out.println("Exception occurred: " + e.toString());
- passed = false;
+ passed = false;
stat.addStatus("simple mdb main", stat.FAIL);
} finally {
if (queueConnection != null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/ejb/SimpleMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/ejb/SimpleMessageBean.java
index 08402a5..aa18a7b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/cmt/ejb/SimpleMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/cmt/ejb/SimpleMessageBean.java
@@ -37,18 +37,18 @@
public void setMessageDrivenContext(MessageDrivenContext mdc) {
System.out.println("In "
+ "SimpleMessageBean.setMessageDrivenContext()");
- this.mdc = mdc;
+ this.mdc = mdc;
}
public void ejbCreate() {
- System.out.println("In SimpleMessageBean.ejbCreate()");
+ System.out.println("In SimpleMessageBean.ejbCreate()");
}
public void onMessage(Message inMessage) {
TextMessage msg = null;
System.out.println("MQ-CMT about to updateDB");
- updateDB();
+ updateDB();
System.out.println("MQ-CMT after updateDB");
try {
@@ -65,32 +65,32 @@
} catch (Throwable te) {
te.printStackTrace();
}
- throw new RuntimeException("Test exception");
+ throw new RuntimeException("Test exception");
} // onMessage
private void updateDB() {
synchronized(lock){
try {
- //Class.forName("com.inet.ora.OraDriver");
- Class.forName("org.apache.derby.jdbc.ClientDriver");
+ //Class.forName("com.inet.ora.OraDriver");
+ Class.forName("org.apache.derby.jdbc.ClientDriver");
//String url = "jdbc:inetora::wrx.india.sun.com:1521:dbsmpl1";
String url = "jdbc:derby://localhost:1527/testdb;create=true;";
- java.sql.Connection con = DriverManager.getConnection(url,"dbuser", "dbpassword");
+ java.sql.Connection con = DriverManager.getConnection(url,"dbuser", "dbpassword");
ResultSet rs = con.createStatement().executeQuery("select exCount from mq_cmt_excpt");
- int count = 0;
- while (rs.next()){
- count = rs.getInt(1);
+ int count = 0;
+ while (rs.next()){
+ count = rs.getInt(1);
System.out.println("MQ-CMT updateDB : " + count);
- }
- rs.close();
- count++;
- String qry = "update mq_cmt_excpt set exCount="+ count ;
+ }
+ rs.close();
+ count++;
+ String qry = "update mq_cmt_excpt set exCount="+ count ;
System.out.println("MQ-CMT updateDB : query : " + qry);
- con.createStatement().executeUpdate(qry);
- con.close();
- } catch(Exception e) {
+ con.createStatement().executeUpdate(qry);
+ con.close();
+ } catch(Exception e) {
System.out.println("Error:" + e.getMessage());
- }
+ }
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.properties
index 0878777..a4282ed 100755
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.properties
@@ -15,10 +15,10 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="ejb30-hello-mdb"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="test.client" value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
@@ -27,6 +27,6 @@
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
<property name="application-client.xml" value="descriptor/application-client.xml"/>
<property name="sun-application-client.xml" value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.xml
index b1a0a35..552d28c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/build.xml
@@ -34,7 +34,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -46,15 +46,15 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class,**/*Hello*" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
<param name="glassfish-resources-ear.xml" value="descriptor/glassfish-resources.xml"/>
</antcall>
- </target>
-
- <target name="deploy"
+ </target>
+
+ <target name="deploy"
depends="init-common">
<antcall target="deploy-common"/>
</target>
@@ -64,7 +64,7 @@
<param name="asadmin.file" value="create_resources.asadmin"/>
</antcall>
</target>
-
+
<target name="delete-resources" depends="init-common">
<antcall target="asadmin-batch-common">
<param name="asadmin.file" value="delete_resources.asadmin"/>
@@ -76,14 +76,14 @@
<param name="appclient.application.args" value="5"/>
</antcall>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
- <echo>
+ <echo>
ant create-resources Create all destinations and connection factories
ant delete-resources Delete all destinations and connection factories
</echo>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/client/Client.java
index adfaa84..2a62ecf 100755
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/client/Client.java
@@ -41,9 +41,9 @@
System.exit(0);
}
- @Resource(mappedName="java:app/jms/ejb_ejb30_hello_mdb_QCF")
+ @Resource(mappedName="java:app/jms/ejb_ejb30_hello_mdb_QCF")
private static QueueConnectionFactory queueConFactory;
-
+
//Target Queue
@Resource(mappedName="java:app/jms/ejb_ejb30_hello_mdb_InQueue")
private static jakarta.jms.Queue msgBeanQueue;
@@ -57,7 +57,7 @@
private QueueSender queueSender;
private QueueReceiver queueReceiver;
private int numMessages = 2;
-
+
public Client(String[] args) {
if( args.length == 1 ) {
numMessages = new Integer(args[0]).intValue();
@@ -80,10 +80,10 @@
public void setup() throws Exception {
queueCon = queueConFactory.createQueueConnection();
queueSession = queueCon.createQueueSession
- (false, Session.AUTO_ACKNOWLEDGE);
+ (false, Session.AUTO_ACKNOWLEDGE);
// Destination will be specified when actual msg is sent.
- queueSender = queueSession.createSender(null);
+ queueSender = queueSession.createSender(null);
queueReceiver = queueSession.createReceiver(clientQueue);
queueCon.start();
}
@@ -98,28 +98,28 @@
}
}
- public void sendMsgs(jakarta.jms.Queue queue, int num)
+ public void sendMsgs(jakarta.jms.Queue queue, int num)
throws JMSException {
for(int i = 0; i < num; i++) {
Message message = queueSession.createTextMessage("foo #" + (i + 1));
- System.out.println("Sending message " + i + " to " + queue +
+ System.out.println("Sending message " + i + " to " + queue +
" at time " + System.currentTimeMillis());
queueSender.send(queue, message);
-
- System.out.println("Sent message " + i + " to " + queue +
+
+ System.out.println("Sent message " + i + " to " + queue +
" at time " + System.currentTimeMillis());
}
}
- public void doTest(int num)
+ public void doTest(int num)
throws Exception {
sendMsgs((jakarta.jms.Queue) msgBeanQueue, num);
-
- //Now attempt to receive responses to our message
+
+ //Now attempt to receive responses to our message
System.out.println("Waiting for queue message");
Message recvdmessage = queueReceiver.receive(TIMEOUT);
if( recvdmessage != null ) {
- System.out.println("Received message : " +
+ System.out.println("Received message : " +
((TextMessage)recvdmessage).getText());
} else {
System.out.println("timeout after " + TIMEOUT + " seconds");
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/ejb/MessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/ejb/MessageBean.java
index 2b3bd18..bc436fa 100755
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/ejb/MessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb-resources-xml/ejb/MessageBean.java
@@ -24,9 +24,9 @@
@MessageDriven(mappedName="java:app/jms/ejb_ejb30_hello_mdb_InQueue")
public class MessageBean implements MessageListener {
- @Resource(mappedName="java:app/jms/ejb_ejb30_hello_mdb_QCF")
+ @Resource(mappedName="java:app/jms/ejb_ejb30_hello_mdb_QCF")
QueueConnectionFactory qcFactory;
-
+
//Destination Queue
@Resource(mappedName="java:app/jms/ejb_ejb30_hello_mdb_OutQueue")
Queue replyQueue;
@@ -35,14 +35,14 @@
System.out.println("MessageBean:: onMessage :: Got message!!!" + message);
QueueConnection connection = null;
- QueueSession session = null;
+ QueueSession session = null;
try {
connection = qcFactory.createQueueConnection();
session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(replyQueue);
TextMessage tmessage = session.createTextMessage();
- String msgText = "Reply for " + ((TextMessage) message).getText();
+ String msgText = "Reply for " + ((TextMessage) message).getText();
tmessage.setText(msgText);
System.out.println("Sending " + msgText);
sender.send(tmessage);
@@ -50,9 +50,9 @@
e.printStackTrace();
} finally {
try {
- if (session != null) {
- session.close();
- }
+ if (session != null) {
+ session.close();
+ }
if(connection != null) {
connection.close();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.properties
index 0878777..a4282ed 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.properties
@@ -15,10 +15,10 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="ejb30-hello-mdb"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="test.client" value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
@@ -27,6 +27,6 @@
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
<property name="application-client.xml" value="descriptor/application-client.xml"/>
<property name="sun-application-client.xml" value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.xml
index d4549fa..4e6f0a8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/build.xml
@@ -34,7 +34,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -46,14 +46,14 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class,**/*Hello*" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
</antcall>
- </target>
-
- <target name="deploy"
+ </target>
+
+ <target name="deploy"
depends="init-common">
<antcall target="deploy-common"/>
</target>
@@ -63,7 +63,7 @@
<param name="asadmin.file" value="create_resources.asadmin"/>
</antcall>
</target>
-
+
<target name="delete-resources" depends="init-common">
<antcall target="asadmin-batch-common">
<param name="asadmin.file" value="delete_resources.asadmin"/>
@@ -75,14 +75,14 @@
<param name="appclient.application.args" value="5"/>
</antcall>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
- <echo>
+ <echo>
ant create-resources Create all destinations and connection factories
ant delete-resources Delete all destinations and connection factories
</echo>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/client/Client.java
index 2c8721e..f25e2b7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/client/Client.java
@@ -41,9 +41,9 @@
System.exit(0);
}
- @Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
+ @Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
private static QueueConnectionFactory queueConFactory;
-
+
//Target Queue
@Resource(mappedName="jms/ejb_ejb30_hello_mdb_InQueue")
private static jakarta.jms.Queue msgBeanQueue;
@@ -57,7 +57,7 @@
private QueueSender queueSender;
private QueueReceiver queueReceiver;
private int numMessages = 2;
-
+
public Client(String[] args) {
if( args.length == 1 ) {
numMessages = new Integer(args[0]).intValue();
@@ -80,10 +80,10 @@
public void setup() throws Exception {
queueCon = queueConFactory.createQueueConnection();
queueSession = queueCon.createQueueSession
- (false, Session.AUTO_ACKNOWLEDGE);
+ (false, Session.AUTO_ACKNOWLEDGE);
// Destination will be specified when actual msg is sent.
- queueSender = queueSession.createSender(null);
+ queueSender = queueSession.createSender(null);
queueReceiver = queueSession.createReceiver(clientQueue);
queueCon.start();
}
@@ -98,28 +98,28 @@
}
}
- public void sendMsgs(jakarta.jms.Queue queue, int num)
+ public void sendMsgs(jakarta.jms.Queue queue, int num)
throws JMSException {
for(int i = 0; i < num; i++) {
Message message = queueSession.createTextMessage("foo #" + (i + 1));
- System.out.println("Sending message " + i + " to " + queue +
+ System.out.println("Sending message " + i + " to " + queue +
" at time " + System.currentTimeMillis());
queueSender.send(queue, message);
-
- System.out.println("Sent message " + i + " to " + queue +
+
+ System.out.println("Sent message " + i + " to " + queue +
" at time " + System.currentTimeMillis());
}
}
- public void doTest(int num)
+ public void doTest(int num)
throws Exception {
sendMsgs((jakarta.jms.Queue) msgBeanQueue, num);
-
- //Now attempt to receive responses to our message
+
+ //Now attempt to receive responses to our message
System.out.println("Waiting for queue message");
Message recvdmessage = queueReceiver.receive(TIMEOUT);
if( recvdmessage != null ) {
- System.out.println("Received message : " +
+ System.out.println("Received message : " +
((TextMessage)recvdmessage).getText());
} else {
System.out.println("timeout after " + TIMEOUT + " seconds");
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/ejb/MessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/ejb/MessageBean.java
index 90a14a2..9aefcac 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/ejb/MessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/ejb30mdb/ejb/MessageBean.java
@@ -24,9 +24,9 @@
@MessageDriven(mappedName="jms/ejb_ejb30_hello_mdb_InQueue")
public class MessageBean implements MessageListener {
- @Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
+ @Resource(mappedName="jms/ejb_ejb30_hello_mdb_QCF")
QueueConnectionFactory qcFactory;
-
+
//Destination Queue
@Resource(mappedName="jms/ejb_ejb30_hello_mdb_OutQueue")
Queue replyQueue;
@@ -35,14 +35,14 @@
System.out.println("MessageBean:: onMessage :: Got message!!!" + message);
QueueConnection connection = null;
- QueueSession session = null;
+ QueueSession session = null;
try {
connection = qcFactory.createQueueConnection();
session = connection.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(replyQueue);
TextMessage tmessage = session.createTextMessage();
- String msgText = "Reply for " + ((TextMessage) message).getText();
+ String msgText = "Reply for " + ((TextMessage) message).getText();
tmessage.setText(msgText);
System.out.println("Sending " + msgText);
sender.send(tmessage);
@@ -50,9 +50,9 @@
e.printStackTrace();
} finally {
try {
- if (session != null) {
- session.close();
- }
+ if (session != null) {
+ session.close();
+ }
if(connection != null) {
connection.close();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.properties
index 87140b8..987f76c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="mq-cmt"/>
-<property name="appname" value="${module}-excpt"/>
+<property name="appname" value="${module}-excpt"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="com.sun.s1peqe.mq.cmt.excpt.client.SimpleMessageClient"/>
+<property name="test.client"\u0020
+ value="com.sun.s1peqe.mq.cmt.excpt.client.SimpleMessageClient"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.xml
index 8591a05..b0337b5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/build.xml
@@ -38,7 +38,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -50,17 +50,17 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
</antcall>
- </target>
+ </target>
<target name="restart-appserver" depends="init-common">
- <antcall target="restart-server-instance-common"/>
+ <antcall target="restart-server-instance-common"/>
</target>
-
+
<target name="setup" depends="init-common">
<antcall target="deploy-jms-common"/>
</target>
@@ -68,18 +68,18 @@
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
</target>
-
+
<target name="run" depends="init-common">
<property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/>
<exec executable="${APPCLIENT}" failonerror="true">
<env key="APPCPATH" value="${env.S1AS_HOME}/domains/domain1/lib/ext/Oranxo.jar:${env.APS_HOME}/lib/reporter.jar"/>
<arg line="-client ${assemble.dir}/${appname}AppClient.jar"/>
- <arg line="-name ${appname}Client"/>
- <arg line="-textauth"/>
- <arg line="-user j2ee"/>
- <arg line="-password j2ee"/>
+ <arg line="-name ${appname}Client"/>
+ <arg line="-textauth"/>
+ <arg line="-user j2ee"/>
+ <arg line="-password j2ee"/>
<arg line=" ${oracleForConnector.driver} ${oracleForConnector.url} ${oracleForConnector.user} ${oracleForConnector.pwd} "/>
- <arg line="-xml ${env.S1AS_HOME}/domains/${admin.domain}/config/glassfish-acc.xml"/>
+ <arg line="-xml ${env.S1AS_HOME}/domains/${admin.domain}/config/glassfish-acc.xml"/>
</exec>
</target>
@@ -110,10 +110,10 @@
<param name="sql.file" value="sql/drop_pointbase.sql"/>
</antcall>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="unsetup" depends="init-common">
<antcall target="undeploy-jms-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/client/SimpleMessageClient.java b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/client/SimpleMessageClient.java
index b3b7d30..90bd4a9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/client/SimpleMessageClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/client/SimpleMessageClient.java
@@ -23,7 +23,7 @@
public class SimpleMessageClient {
- private static SimpleReporterAdapter stat =
+ private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
public static void main(String[] args) {
@@ -32,23 +32,23 @@
boolean passed = false;
try {
- Class.forName(args[0]);
- String url = args[1];
- java.sql.Connection con = DriverManager.getConnection(url,args[2],args[3]);
- ResultSet rs = con.createStatement().executeQuery("select status from lifecycle_test1");
- int count = 0;
- while (rs.next()){
- count = rs.getInt(1);
- }
+ Class.forName(args[0]);
+ String url = args[1];
+ java.sql.Connection con = DriverManager.getConnection(url,args[2],args[3]);
+ ResultSet rs = con.createStatement().executeQuery("select status from lifecycle_test1");
+ int count = 0;
+ while (rs.next()){
+ count = rs.getInt(1);
+ }
rs.close();
- con.close();
- if (count == 0) {
- throw new Exception("test failed because status : " + 0);
- }
+ con.close();
+ if (count == 0) {
+ throw new Exception("test failed because status : " + 0);
+ }
passed = true;
} catch (Throwable e) {
System.out.println("Exception occurred: " + e.toString());
- passed = false;
+ passed = false;
stat.addStatus("simple lifecycle test1", stat.FAIL);
} finally {
if (passed) stat.addStatus("simple lifecycle test1", stat.PASS);
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/ejb/SimpleMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/ejb/SimpleMessageBean.java
index 60a7e5f..5225884 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/ejb/SimpleMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/ejb/SimpleMessageBean.java
@@ -38,17 +38,17 @@
public void setMessageDrivenContext(MessageDrivenContext mdc) {
System.out.println("In "
+ "SimpleMessageBean.setMessageDrivenContext()");
- this.mdc = mdc;
+ this.mdc = mdc;
}
public void ejbCreate() {
- System.out.println("In SimpleMessageBean.ejbCreate()");
+ System.out.println("In SimpleMessageBean.ejbCreate()");
}
public void onMessage(Message inMessage) {
TextMessage msg = null;
- updateDB();
+ updateDB();
try {
if (inMessage instanceof TextMessage) {
@@ -64,7 +64,7 @@
} catch (Throwable te) {
te.printStackTrace();
}
- throw new RuntimeException("Test exception");
+ throw new RuntimeException("Test exception");
} // onMessage
private void updateDB() {
@@ -76,18 +76,18 @@
java.sql.Connection con = DriverManager.getConnection(url,"dbuser", "dbpassword");
//java.sql.Connection con = DriverManager.getConnection(url,"connector", "connector");
ResultSet rs = con.createStatement().executeQuery("select exCount from mq_cmt_excpt");
- int count = 0;
- while (rs.next()){
- count = rs.getInt(1);
- }
- rs.close();
- count++;
- String qry = "update mq_cmt_excpt set exCount="+ count ;
- con.createStatement().executeUpdate(qry);
- con.close();
- } catch(Exception e) {
+ int count = 0;
+ while (rs.next()){
+ count = rs.getInt(1);
+ }
+ rs.close();
+ count++;
+ String qry = "update mq_cmt_excpt set exCount="+ count ;
+ con.createStatement().executeUpdate(qry);
+ con.close();
+ } catch(Exception e) {
System.out.println("Error:" + e.getMessage());
- }
+ }
}
public void ejbRemove() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/src/LifecycleListenerImpl.java b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/src/LifecycleListenerImpl.java
index c0668eb..990a278 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/src/LifecycleListenerImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/lifecycle/src/LifecycleListenerImpl.java
@@ -34,8 +34,8 @@
* 3. READY_EVENT: Server started up applications and is ready to service requests
* 4. SHUTDOWN_EVENT: Server is shutting down applications
* 5. TERMINATION_EVENT: Server is terminating the subsystems and the runtime environment.
- *
- * In this sample, on STARTUP_EVENT, a thread is started which sends a simple JMS message to
+ *
+ * In this sample, on STARTUP_EVENT, a thread is started which sends a simple JMS message to
* sampleTopic every minute. On SHUTDOWN_EVENT, this thread is stopped.
* </p>
*/
@@ -47,37 +47,37 @@
*/
LifecycleEventContext ctx;
- /**
- * Receives a server lifecycle event
+ /**
+ * Receives a server lifecycle event
* @param event associated event
* @throws <code>ServerLifecycleException</code> for exceptional condition.
*/
- public void handleEvent(LifecycleEvent event)
+ public void handleEvent(LifecycleEvent event)
throws ServerLifecycleException {
ctx = event.getLifecycleEventContext();
- switch(event.getEventType()) {
- case LifecycleEvent.INIT_EVENT:
- onInitTask();
- break;
+ switch(event.getEventType()) {
+ case LifecycleEvent.INIT_EVENT:
+ onInitTask();
+ break;
- case LifecycleEvent.STARTUP_EVENT:
- onStartTask();
- break;
+ case LifecycleEvent.STARTUP_EVENT:
+ onStartTask();
+ break;
case LifecycleEvent.READY_EVENT:
onReadyTask();
break;
- case LifecycleEvent.SHUTDOWN_EVENT:
- onShutdownTask();
- break;
+ case LifecycleEvent.SHUTDOWN_EVENT:
+ onShutdownTask();
+ break;
- case LifecycleEvent.TERMINATION_EVENT:
- onTerminationTask();
- break;
- }
+ case LifecycleEvent.TERMINATION_EVENT:
+ onTerminationTask();
+ break;
+ }
}
@@ -98,47 +98,47 @@
// my code
QueueSession qsession[] = new QueueSession[10];
Queue queue[] = new Queue[10];
-
+
try{
for (int i =0; i < 10; i++) {
// Get initial context
ctx.log("Get initial context");
InitialContext initialContext = new InitialContext();
-
+
// look up the connection factory from the object store
ctx.log("Looking up the queue connection factory from JNDI");
QueueConnectionFactory factory = (QueueConnectionFactory) initialContext.lookup("jms/QCFactory");
-
+
// look up queue from the object store
ctx.log("Create queue connection");
QueueConnection qconn = factory.createQueueConnection();
-
+
ctx.log("Create queue session");
qsession[i] = qconn.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
-
+
ctx.log("Looking up the queue from JNDI");
queue[i] = (Queue) initialContext.lookup("jms/SampleQueue");
}
updateDB();
-
+
}
catch( Exception e ){
ctx.log( "Exception caught in test code" );
e.printStackTrace();
}
-
-
- // end my code
-
+
+
+ // end my code
+
// my code
//createAccount();
- // end my code
+ // end my code
}
/**
- * Tasks to be carried out in the READY_EVENT.
+ * Tasks to be carried out in the READY_EVENT.
* Logs a message.
*/
private void onReadyTask() {
@@ -146,7 +146,7 @@
}
/**
- * Tasks to be carried out in the SHUTDOWN_EVENT.
+ * Tasks to be carried out in the SHUTDOWN_EVENT.
* Logs a message
*/
private void onShutdownTask() {
@@ -170,7 +170,7 @@
/**
- * Tasks to be carried out in the TERMINATION_EVENT.
+ * Tasks to be carried out in the TERMINATION_EVENT.
* Log a message.
*/
private void onTerminationTask() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.properties
index 61ce3c3..f996b22 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector-mq"/>
-<property name="appname" value="${module}-simplestress"/>
+<property name="appname" value="${module}-simplestress"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="com.sun.s1peqe.connector.mq.simplestress.client.SimpleMessageClient"/>
+<property name="test.client"\u0020
+ value="com.sun.s1peqe.connector.mq.simplestress.client.SimpleMessageClient"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.xml
index 82378b1..874369c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/build.xml
@@ -35,7 +35,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -47,13 +47,13 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
</antcall>
- </target>
-
+ </target>
+
<target name="setup" depends="init-common">
<antcall target="deploy-jms-common">
<param name="jms.factory.name"
@@ -76,14 +76,14 @@
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
</target>
-
+
<target name="run" depends="init-common">
<antcall target="runclient-common"/>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="unsetup" depends="init-common">
<antcall target="delete-jms-resource-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/client/SimpleMessageClient.java b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/client/SimpleMessageClient.java
index 057c998..510d1f1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/client/SimpleMessageClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/client/SimpleMessageClient.java
@@ -22,7 +22,7 @@
public class SimpleMessageClient implements Runnable{
- private static SimpleReporterAdapter stat =
+ private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
int id =0;
@@ -84,7 +84,7 @@
stat.printSummary("simple stress program");
System.exit(0);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/descriptor/ejb-jar.xml
index a47bc90..7b90699 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/descriptor/ejb-jar.xml
@@ -37,7 +37,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>jms/clientQueue</resource-env-ref-name>
- <resource-env-ref-type>jakarta.jms.Queue</resource-env-ref-type>
+ <resource-env-ref-type>jakarta.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/ejb/SimpleMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/ejb/SimpleMessageBean.java
index 9d2845b..0bd1993 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/ejb/SimpleMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/simplestress/ejb/SimpleMessageBean.java
@@ -42,11 +42,11 @@
public void setMessageDrivenContext(MessageDrivenContext mdc) {
System.out.println("In "
+ "SimpleMessageBean.setMessageDrivenContext()");
- this.mdc = mdc;
+ this.mdc = mdc;
}
public void ejbCreate() {
- System.out.println("In SimpleMessageBean.ejbCreate()");
+ System.out.println("In SimpleMessageBean.ejbCreate()");
try {
jndiContext = new InitialContext();
connectionFactory = (ConnectionFactory)
@@ -67,18 +67,18 @@
msg = (TextMessage) inMessage;
System.out.println("MESSAGE BEAN: Message received: "
+ msg.getText());
- connection =
- connectionFactory.createConnection();
- session =
- connection.createSession(false,
- Session.AUTO_ACKNOWLEDGE);
- MessageProducer msgProducer= session.createProducer(queue);
- TextMessage message = session.createTextMessage();
+ connection =
+ connectionFactory.createConnection();
+ session =
+ connection.createSession(false,
+ Session.AUTO_ACKNOWLEDGE);
+ MessageProducer msgProducer= session.createProducer(queue);
+ TextMessage message = session.createTextMessage();
- message.setText("Reply for : " + msg.getText());
- System.out.println("Sending message: " +
- message.getText());
- msgProducer.send(message);
+ message.setText("Reply for : " + msg.getText());
+ System.out.println("Sending message: " +
+ message.getText());
+ msgProducer.send(message);
} else {
System.out.println("Message of wrong type: "
+ inMessage.getClass().getName());
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.properties
index 61ce3c3..f996b22 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector-mq"/>
-<property name="appname" value="${module}-simplestress"/>
+<property name="appname" value="${module}-simplestress"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="com.sun.s1peqe.connector.mq.simplestress.client.SimpleMessageClient"/>
+<property name="test.client"\u0020
+ value="com.sun.s1peqe.connector.mq.simplestress.client.SimpleMessageClient"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.xml
index fa76f10..2a38170 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/stress/build.xml
@@ -35,7 +35,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -47,13 +47,13 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
</antcall>
- </target>
-
+ </target>
+
<target name="setup" depends="init-common">
<antcall target="deploy-jms-common"/>
<antcall target="create-jms-resource-common">
@@ -71,14 +71,14 @@
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
</target>
-
+
<target name="run" depends="init-common">
<antcall target="runclient-common"/>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="unsetup" depends="init-common">
<antcall target="undeploy-jms-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/stress/client/SimpleMessageClient.java b/appserver/tests/appserv-tests/devtests/connector/mq/stress/client/SimpleMessageClient.java
index 942a0e9..0d830d5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/stress/client/SimpleMessageClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/stress/client/SimpleMessageClient.java
@@ -29,7 +29,7 @@
static long MDB_SLEEP_TIME = 2000;
static boolean debug = false;
- private static SimpleReporterAdapter stat =
+ private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
int id =0;
@@ -40,13 +40,13 @@
public static void main(String[] args) {
/**
- * Start the threads that will send messages to MDB
- */
+ * Start the threads that will send messages to MDB
+ */
ArrayList al = new ArrayList();
try {
for (int i =0; i < NUM_CLIENTS; i++) {
Thread client = new Thread(new SimpleMessageClient(i));
- al.add(client);
+ al.add(client);
client.start();
}
} catch (Throwable t) {
@@ -76,66 +76,66 @@
queueConnection.start();
queueReceiver = queueSession.createReceiver(queue);
- HashMap map = new HashMap();
+ HashMap map = new HashMap();
long startTime = System.currentTimeMillis();
boolean pass = true;
- //
- // Receives all the messages and keep in the data structure
- //
+ //
+ // Receives all the messages and keep in the data structure
+ //
for (int i =0; i < NUM_CLIENTS * NUM_CYCLES; i++) {
TextMessage msg = (TextMessage) queueReceiver.receive(TIME_OUT);
- Integer id = new Integer(msg.getIntProperty("replyid"));
- if (map.containsKey(id)) {
- pass = false;
- debug("Duplicate :" + id);
- }
- map.put(id, msg.getText());
+ Integer id = new Integer(msg.getIntProperty("replyid"));
+ if (map.containsKey(id)) {
+ pass = false;
+ debug("Duplicate :" + id);
+ }
+ map.put(id, msg.getText());
}
long totalTime = System.currentTimeMillis() - startTime;
- System.out.println("Received all messages in :" + totalTime + " milliseconds");
- System.out.println("------------------------------------------------------");
+ System.out.println("Received all messages in :" + totalTime + " milliseconds");
+ System.out.println("------------------------------------------------------");
- //
- // Now examine the received data
- //
+ //
+ // Now examine the received data
+ //
for (int i =0; i < NUM_CLIENTS * NUM_CYCLES; i++) {
- String reply = (String) map.get(new Integer(i));
- if (!reply.equals("REPLIED:CLIENT")) {
- pass = false;
- }
- System.out.println("Receeived :" + i + ":" + reply);
- }
-
- // Try to receive one more message than expected.
+ String reply = (String) map.get(new Integer(i));
+ if (!reply.equals("REPLIED:CLIENT")) {
+ pass = false;
+ }
+ System.out.println("Receeived :" + i + ":" + reply);
+ }
+
+ // Try to receive one more message than expected.
TextMessage msg = (TextMessage) queueReceiver.receive(TIME_OUT);
- if (msg != null) {
- pass = false;
- System.out.println("Received more than expected number of messages :" + msg.getText());
- }
+ if (msg != null) {
+ pass = false;
+ System.out.println("Received more than expected number of messages :" + msg.getText());
+ }
if (pass) {
stat.addStatus("Concurrent message delivery test", stat.PASS);
} else {
stat.addStatus("Concurrent message delivery test", stat.FAIL);
- }
+ }
}catch (Throwable t) {
t.printStackTrace();
stat.addStatus("Concurrent message delivery test", stat.FAIL);
}finally {
stat.printSummary("Concurrent message delivery test");
- for (int i=0; i <al.size(); i++) {
- Thread client = (Thread) al.get(i);
- try {
- client.join();
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
+ for (int i=0; i <al.size(); i++) {
+ Thread client = (Thread) al.get(i);
+ try {
+ client.join();
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ }
+ }
System.exit(0);
}
-
+
}
@@ -156,9 +156,9 @@
("java:comp/env/jms/QCFactory");
queue = (Queue) jndiContext.lookup("java:comp/env/jms/SampleQueue");
- int startId = id * NUM_CYCLES;
- int endId = (id * NUM_CYCLES) + NUM_CYCLES;
- for (int i= startId;i < endId; i ++) {
+ int startId = id * NUM_CYCLES;
+ int endId = (id * NUM_CYCLES) + NUM_CYCLES;
+ for (int i= startId;i < endId; i ++) {
try {
queueConnection =
queueConnectionFactory.createQueueConnection();
@@ -169,10 +169,10 @@
queueSender = queueSession.createSender(queue);
message = queueSession.createTextMessage();
message.setText("CLIENT");
- message.setIntProperty("id",i);
- message.setLongProperty("sleeptime",MDB_SLEEP_TIME);
+ message.setIntProperty("id",i);
+ message.setLongProperty("sleeptime",MDB_SLEEP_TIME);
queueSender.send(message);
- debug("Send the message :" + message.getIntProperty("id") + ":" + message.getText());
+ debug("Send the message :" + message.getIntProperty("id") + ":" + message.getText());
} catch (Exception e) {
System.out.println("Exception occurred: " + e.toString());
} finally {
@@ -190,8 +190,8 @@
static void debug(String msg) {
if (debug) {
- System.out.println(msg);
- }
+ System.out.println(msg);
+ }
}
} // class
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/stress/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/mq/stress/descriptor/ejb-jar.xml
index 3811a29..dba222a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/stress/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/stress/descriptor/ejb-jar.xml
@@ -37,7 +37,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>jms/clientQueue</resource-env-ref-name>
- <resource-env-ref-type>jakarta.jms.Queue</resource-env-ref-type>
+ <resource-env-ref-type>jakarta.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/stress/ejb/SimpleMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/stress/ejb/SimpleMessageBean.java
index 5645b91..c33b753 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/stress/ejb/SimpleMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/stress/ejb/SimpleMessageBean.java
@@ -42,11 +42,11 @@
public void setMessageDrivenContext(MessageDrivenContext mdc) {
System.out.println("In "
+ "SimpleMessageBean.setMessageDrivenContext()");
- this.mdc = mdc;
+ this.mdc = mdc;
}
public void ejbCreate() {
- System.out.println("In SimpleMessageBean.ejbCreate()");
+ System.out.println("In SimpleMessageBean.ejbCreate()");
try {
jndiContext = new InitialContext();
queueConnectionFactory = (QueueConnectionFactory)
@@ -67,22 +67,22 @@
msg = (TextMessage) inMessage;
System.out.println("MESSAGE BEAN: Message received: "
+ msg.getText());
- long sleepTime = msg.getLongProperty("sleeptime");
- System.out.println("Sleeping for : " + sleepTime + " milli seconds ");
- Thread.sleep(sleepTime);
- queueConnection =
- queueConnectionFactory.createQueueConnection();
- queueSession =
- queueConnection.createQueueSession(false,
- Session.AUTO_ACKNOWLEDGE);
- queueSender = queueSession.createSender(queue);
- TextMessage message = queueSession.createTextMessage();
+ long sleepTime = msg.getLongProperty("sleeptime");
+ System.out.println("Sleeping for : " + sleepTime + " milli seconds ");
+ Thread.sleep(sleepTime);
+ queueConnection =
+ queueConnectionFactory.createQueueConnection();
+ queueSession =
+ queueConnection.createQueueSession(false,
+ Session.AUTO_ACKNOWLEDGE);
+ queueSender = queueSession.createSender(queue);
+ TextMessage message = queueSession.createTextMessage();
- message.setText("REPLIED:" + msg.getText());
- message.setIntProperty("replyid", msg.getIntProperty("id") );
- System.out.println("Sending message: " +
- message.getText());
- queueSender.send(message);
+ message.setText("REPLIED:" + msg.getText());
+ message.setIntProperty("replyid", msg.getIntProperty("id") );
+ System.out.println("Sending message: " +
+ message.getText());
+ queueSender.send(message);
} else {
System.out.println("Message of wrong type: "
+ inMessage.getClass().getName());
@@ -92,12 +92,12 @@
} catch (Throwable te) {
te.printStackTrace();
} finally {
- try {
- queueSession.close();
- queueConnection.close();
- } catch (Exception e) {
- }
- }
+ try {
+ queueSession.close();
+ queueConnection.close();
+ } catch (Exception e) {
+ }
+ }
} // onMessage
public void ejbRemove() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.properties b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.properties
index 61ce3c3..f996b22 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector-mq"/>
-<property name="appname" value="${module}-simplestress"/>
+<property name="appname" value="${module}-simplestress"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="com.sun.s1peqe.connector.mq.simplestress.client.SimpleMessageClient"/>
+<property name="test.client"\u0020
+ value="com.sun.s1peqe.connector.mq.simplestress.client.SimpleMessageClient"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.xml b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.xml
index 8fd4b6f..476baa6 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/build.xml
@@ -37,7 +37,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -49,13 +49,13 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*Client*.class" />
</antcall>
- </target>
-
+ </target>
+
<target name="setup" depends="init-common">
<antcall target="deploy-jms-common"/>
<antcall target="create-jms-resource-common">
@@ -73,16 +73,16 @@
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
</target>
-
+
<target name="run" depends="init-common" >
<antcall target="test-send-receive-message"/>
<antcall target="test-send-recreate-fail"/>
<antcall target="test-send-create-newdomain"/>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="unsetup" depends="init-common">
<antcall target="undeploy-jms-common"/>
@@ -103,67 +103,67 @@
<param name="userPassword" value="password1"/>
<param name="jmsServer" value=""/>
<param name="vardir" value=""/>
- </antcall>
+ </antcall>
<antcall target="runclient-common">
- <param name="appclient.application.args"
- value="TestNewUser SENDRECEIVE VERIFY user1 password1"/>
- </antcall>
+ <param name="appclient.application.args"
+ value="TestNewUser SENDRECEIVE VERIFY user1 password1"/>
+ </antcall>
</target>
<target name="test-send-recreate-fail">
<antcall target="runclient-common">
- <param name="appclient.application.args"
- value="SettingupLooseMessageOnRecreate SEND NOVERIFY user1 password1"/>
- </antcall>
- <antcall target="start-clean-server"/>
- <antcall target="setup"/>
- <antcall target="deploy-common"/>
+ <param name="appclient.application.args"
+ value="SettingupLooseMessageOnRecreate SEND NOVERIFY user1 password1"/>
+ </antcall>
+ <antcall target="start-clean-server"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-common"/>
<antcall target="create-jms-user">
<param name="userName" value="user1"/>
<param name="userPassword" value="password1"/>
<param name="jmsServer" value=""/>
<param name="vardir" value=""/>
<param name="FAILONERR" value="true"/>
- </antcall>
+ </antcall>
<antcall target="runclient-common">
- <param name="appclient.application.args"
- value="TestLooseMessageOnRecreate RECEIVE NOVERIFY user1 password1"/>
- </antcall>
+ <param name="appclient.application.args"
+ value="TestLooseMessageOnRecreate RECEIVE NOVERIFY user1 password1"/>
+ </antcall>
</target>
<target name="test-send-create-newdomain">
- <antcall target="stopDomain"/>
- <antcall target="create-domain-common">
+ <antcall target="stopDomain"/>
+ <antcall target="create-domain-common">
<param name="admin.domain" value="domain2"/>
<param name="http.port" value="48080"/>
- <param name="orb.port" value="43700"/>
- </antcall>
- <antcall target="startDomain">
+ <param name="orb.port" value="43700"/>
+ </antcall>
+ <antcall target="startDomain">
<param name="admin.domain" value="domain2"/>
- </antcall>
+ </antcall>
<antcall target="create-jms-user">
<param name="userName" value="user1"/>
<param name="userPassword" value="password1"/>
<param name="jmsServer" value=""/>
<param name="vardir" value="-varhome ${env.S1AS_HOME}/domains/domain2/imq"/>
<param name="FAILONERR" value="true"/>
- </antcall>
- <antcall target="setup"/>
+ </antcall>
+ <antcall target="setup"/>
<antcall target="runclient-common">
- <param name="appclient.application.args"
- value="SendMessageToNewDomainMQStore SEND NOVERIFY user1 password1"/>
- </antcall>
- <antcall target="deploy-common"/>
+ <param name="appclient.application.args"
+ value="SendMessageToNewDomainMQStore SEND NOVERIFY user1 password1"/>
+ </antcall>
+ <antcall target="deploy-common"/>
<antcall target="runclient-common">
- <param name="appclient.application.args"
- value="TestReceiveNewDomainMQStore RECEIVE VERIFY user1 password1"/>
- </antcall>
- <antcall target="stopDomain">
+ <param name="appclient.application.args"
+ value="TestReceiveNewDomainMQStore RECEIVE VERIFY user1 password1"/>
+ </antcall>
+ <antcall target="stopDomain">
<param name="admin.domain" value="domain2"/>
- </antcall>
- <antcall target="delete-domain-common">
+ </antcall>
+ <antcall target="delete-domain-common">
<param name="admin.domain" value="domain2"/>
- </antcall>
- <antcall target="startDomain"/>
+ </antcall>
+ <antcall target="startDomain"/>
</target>
<target name="create-jms-user" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/client/SimpleMessageClient.java b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/client/SimpleMessageClient.java
index 967c8d3..d5b2321 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/client/SimpleMessageClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/client/SimpleMessageClient.java
@@ -28,7 +28,7 @@
static String user = null;
static String password = null;
- private static SimpleReporterAdapter stat =
+ private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
int id =0;
@@ -40,38 +40,38 @@
public static void main(String[] args) {
System.out.println(args);
- //if (args.length >0) return;
-
- String testId = args[0];
- String testString = args[1];
- String verify = args[2];
- user = args[3];
- password = args[4];
+ //if (args.length >0) return;
+
+ String testId = args[0];
+ String testString = args[1];
+ String verify = args[2];
+ user = args[3];
+ password = args[4];
try {
boolean pass = true;
- System.out.println("Running the test : " + testId);
+ System.out.println("Running the test : " + testId);
- if (testString.startsWith("SEND")) {
- sendMessage();
- }
-
- String output = null;
- if (testString.endsWith("RECEIVE")) {
- output = receiveMessage();
- }
+ if (testString.startsWith("SEND")) {
+ sendMessage();
+ }
- if (verify.equals("VERIFY")) {
- pass = output.equals("REPLIED:CLIENT");
- } else {
- pass = (output == null);
- }
+ String output = null;
+ if (testString.endsWith("RECEIVE")) {
+ output = receiveMessage();
+ }
+
+ if (verify.equals("VERIFY")) {
+ pass = output.equals("REPLIED:CLIENT");
+ } else {
+ pass = (output == null);
+ }
if (pass) {
stat.addStatus(testId, stat.PASS);
} else {
stat.addStatus(testId, stat.FAIL);
- }
+ }
}catch (Throwable t) {
t.printStackTrace();
stat.addStatus(testId, stat.FAIL);
@@ -79,7 +79,7 @@
stat.printSummary(testId);
System.exit(0);
}
-
+
}
public static String receiveMessage() {
@@ -106,16 +106,16 @@
queueConnection.start();
queueReceiver = queueSession.createReceiver(queue);
- HashMap map = new HashMap();
+ HashMap map = new HashMap();
long startTime = System.currentTimeMillis();
boolean pass = true;
TextMessage msg = (TextMessage) queueReceiver.receive(TIME_OUT);
- if (msg == null) {
- return null;
- }
- Integer id = new Integer(msg.getIntProperty("replyid"));
- return msg.getText();
+ if (msg == null) {
+ return null;
+ }
+ Integer id = new Integer(msg.getIntProperty("replyid"));
+ return msg.getText();
}catch (Throwable t) {
t.printStackTrace();
}finally {
@@ -153,9 +153,9 @@
queueSender = queueSession.createSender(queue);
message = queueSession.createTextMessage();
message.setText("CLIENT");
- message.setIntProperty("id",1);
+ message.setIntProperty("id",1);
queueSender.send(message);
- debug("Send the message :" + message.getIntProperty("id") + ":" + message.getText());
+ debug("Send the message :" + message.getIntProperty("id") + ":" + message.getText());
} catch (Throwable e) {
System.out.println("Exception occurred: " + e.toString());
} finally {
@@ -169,8 +169,8 @@
static void debug(String msg) {
if (debug) {
- System.out.println(msg);
- }
+ System.out.println(msg);
+ }
}
} // class
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/descriptor/ejb-jar.xml
index 3811a29..dba222a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/descriptor/ejb-jar.xml
@@ -37,7 +37,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>jms/clientQueue</resource-env-ref-name>
- <resource-env-ref-type>jakarta.jms.Queue</resource-env-ref-type>
+ <resource-env-ref-type>jakarta.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</message-driven>
</enterprise-beans>
diff --git a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/ejb/SimpleMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/ejb/SimpleMessageBean.java
index 07b3184..a83ec56 100644
--- a/appserver/tests/appserv-tests/devtests/connector/mq/varhome/ejb/SimpleMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/mq/varhome/ejb/SimpleMessageBean.java
@@ -42,11 +42,11 @@
public void setMessageDrivenContext(MessageDrivenContext mdc) {
System.out.println("In "
+ "SimpleMessageBean.setMessageDrivenContext()");
- this.mdc = mdc;
+ this.mdc = mdc;
}
public void ejbCreate() {
- System.out.println("In SimpleMessageBean.ejbCreate()");
+ System.out.println("In SimpleMessageBean.ejbCreate()");
try {
jndiContext = new InitialContext();
queueConnectionFactory = (QueueConnectionFactory)
@@ -67,19 +67,19 @@
msg = (TextMessage) inMessage;
System.out.println("MESSAGE BEAN: Message received: "
+ msg.getText());
- queueConnection =
- queueConnectionFactory.createQueueConnection();
- queueSession =
- queueConnection.createQueueSession(false,
- Session.AUTO_ACKNOWLEDGE);
- queueSender = queueSession.createSender(queue);
- TextMessage message = queueSession.createTextMessage();
+ queueConnection =
+ queueConnectionFactory.createQueueConnection();
+ queueSession =
+ queueConnection.createQueueSession(false,
+ Session.AUTO_ACKNOWLEDGE);
+ queueSender = queueSession.createSender(queue);
+ TextMessage message = queueSession.createTextMessage();
- message.setText("REPLIED:" + msg.getText());
- message.setIntProperty("replyid", msg.getIntProperty("id") );
- System.out.println("Sending message: " +
- message.getText());
- queueSender.send(message);
+ message.setText("REPLIED:" + msg.getText());
+ message.setIntProperty("replyid", msg.getIntProperty("id") );
+ System.out.println("Sending message: " +
+ message.getText());
+ queueSender.send(message);
} else {
System.out.println("Message of wrong type: "
+ inMessage.getClass().getName());
@@ -89,12 +89,12 @@
} catch (Throwable te) {
te.printStackTrace();
} finally {
- try {
- queueSession.close();
- queueConnection.close();
- } catch (Exception e) {
- }
- }
+ try {
+ queueSession.close();
+ queueConnection.close();
+ } catch (Exception e) {
+ }
+ }
} // onMessage
public void ejbRemove() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonacc/build.properties b/appserver/tests/appserv-tests/devtests/connector/nonacc/build.properties
index ce9e1bf..7a964dc 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonacc/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/nonacc/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="nonacc"/>
-<property name="appname" value="${module}-simple"/>
+<property name="appname" value="${module}-simple"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="com.sun.s1peqe.nonacc.simple.client.SimpleMessageClient"/>
+<property name="test.client"\u0020
+ value="com.sun.s1peqe.nonacc.simple.client.SimpleMessageClient"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
<property name="jmsra.jar" value="${env.S1AS_HOME}/lib/install/applications/jmsra/imqjmsra.jar"/>
<property name="app.type" value="application"/>
<property name="orb.host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonacc/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonacc/build.xml
index 02f1d4e..f88f823 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonacc/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonacc/build.xml
@@ -21,7 +21,7 @@
<!ENTITY testproperties SYSTEM "./build.properties">
<!ENTITY common SYSTEM "../../../config/common.xml">
<!ENTITY testcommon SYSTEM "../../../config/properties.xml">
-
+
]>
<project name="simpleApp" default="usage" basedir=".">
@@ -40,7 +40,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -52,17 +52,17 @@
<target name="build" depends="compile">
<antcall target="ejb-jar-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*Bean*.class" />
- </antcall>
- <echo message="Preparing Jar file to execute in the client ${build.classes.dir}" />
- <jar jarfile="${assemble.dir}/${appname}-client.jar" basedir="${build.classes.dir}"
- update="true" includes ="**/*Client*.class"
+ </antcall>
+ <echo message="Preparing Jar file to execute in the client ${build.classes.dir}" />
+ <jar jarfile="${assemble.dir}/${appname}-client.jar" basedir="${build.classes.dir}"
+ update="true" includes ="**/*Client*.class"
manifest="./client/MANIFEST.MF" />
<antcall target="ear-common">
</antcall>
- </target>
-
+ </target>
+
<target name="setup" depends="init-common">
<antcall target="deploy-jms-common"/>
</target>
@@ -70,25 +70,25 @@
<target name="deploy" depends="init-common">
<antcall target="deploy-common"/>
</target>
-
+
<target name="run" depends="init-common">
<java classname="${test.client}" fork="true">
- <classpath>
- <pathelement location="${assemble.dir}/${appname}-client.jar"/>
-<!-- <pathelement location="${jmsra.jar}"/>-->
- <pathelement location="${env.APS_HOME}/lib/reporter.jar"/>
- <pathelement location="${java.home}/lib/jsse.jar"/>
- <pathelement location="${env.S1AS_HOME}/lib/gf-client.jar"/>
-<!-- <pathelement path="${s1astest.classpath}"/>-->
- </classpath>
- <sysproperty key="org.omg.CORBA.ORBInitialHost" value="${orb.host}"/>
- <sysproperty key="org.omg.CORBA.ORBInitialPort" value="${orb.port}"/>
- </java>
+ <classpath>
+ <pathelement location="${assemble.dir}/${appname}-client.jar"/>
+<!-- <pathelement location="${jmsra.jar}"/>-->
+ <pathelement location="${env.APS_HOME}/lib/reporter.jar"/>
+ <pathelement location="${java.home}/lib/jsse.jar"/>
+ <pathelement location="${env.S1AS_HOME}/lib/gf-client.jar"/>
+<!-- <pathelement path="${s1astest.classpath}"/>-->
+ </classpath>
+ <sysproperty key="org.omg.CORBA.ORBInitialHost" value="${orb.host}"/>
+ <sysproperty key="org.omg.CORBA.ORBInitialPort" value="${orb.port}"/>
+ </java>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="unsetup" depends="init-common">
<antcall target="undeploy-jms-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonacc/client/SimpleMessageClient.java b/appserver/tests/appserv-tests/devtests/connector/nonacc/client/SimpleMessageClient.java
index a6f7695..9355415 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonacc/client/SimpleMessageClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonacc/client/SimpleMessageClient.java
@@ -22,7 +22,7 @@
public class SimpleMessageClient {
- private static SimpleReporterAdapter stat =
+ private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
public static void main(String[] args) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonacc/ejb/SimpleMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/nonacc/ejb/SimpleMessageBean.java
index abe85d8..6d33e64 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonacc/ejb/SimpleMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonacc/ejb/SimpleMessageBean.java
@@ -34,11 +34,11 @@
public void setMessageDrivenContext(MessageDrivenContext mdc) {
System.out.println("In "
+ "SimpleMessageBean.setMessageDrivenContext()");
- this.mdc = mdc;
+ this.mdc = mdc;
}
public void ejbCreate() {
- System.out.println("In SimpleMessageBean.ejbCreate()");
+ System.out.println("In SimpleMessageBean.ejbCreate()");
}
public void onMessage(Message inMessage) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.properties b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.xml
index 7fcecae..46e9b70 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/build.xml
@@ -31,7 +31,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<!--
<target name="all" depends="build,setup,deploy-war, run-war, undeploy-war, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -40,15 +40,15 @@
<target name="all" depends="build, deploy-ear, setup, run-ear, unsetup, undeploy-ear"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
@@ -56,7 +56,7 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
@@ -64,7 +64,7 @@
<antcall target="create-pool"/>
<antcall target="create-resource"/>
<antcall target="create-admin-object"/>
-
+
</target>
<target name="create-pool">
<antcall target="create-connector-connpool-common">
@@ -89,17 +89,17 @@
<property file="../config/oracle.properties"/>
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-subclassing:SchemaName=connector:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- </target>
-
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ </target>
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -107,15 +107,15 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
</target>
<target name="unsetup">
@@ -127,7 +127,7 @@
<antcall target="delete-pool"/>
<antcall target="delete-admin-object"/>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -137,7 +137,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -153,9 +153,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -164,34 +164,34 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="create-ra-config"/>
<antcall target="deploy-common"/>
@@ -200,27 +200,27 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-ejb (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-ejb (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-ejb (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-ejb (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/descriptor/sun-ejb-jar.xml
index 1d1200d..df4bb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/Customer.java
index 5922f31..3615e16 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/Customer.java
@@ -46,4 +46,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerChecking.java
index ff15e7e..89dc323 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerChecking.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerEJB.java
index 0520b60..07220db 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavings.java
index 2740692..c45a1c5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavings.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.properties
index ee2eca0..fd21c3d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.xml
index cb66a45..3aceef2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
failonerror="true">
<classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
</classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index 4632ae1..b4fd124 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,404 +53,404 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
-
+
/**
* Retrieves the the first warning reported by calls on the underlying
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
@Override
@@ -536,141 +536,141 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
-
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 79fb933..a7d35be 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -122,86 +122,86 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>9092</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBUSER</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBPASSWORD</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DatabaseName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:pointbase:server://localhost:9092/sqe-samples,new</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>NetworkProtocol</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Delimiter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>com.pointbase.jdbc.jdbcDataSource</config-property-value>
</config-property>
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
<!-- properties to test setting of a non-String value with overridden setters -->
<config-property>
<config-property-name>NonStringWithNoOverriddenSetter</config-property-name>
@@ -215,54 +215,54 @@
</config-property>
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 4bf9fed..3234032 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,14 +31,14 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -49,19 +49,19 @@
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -69,55 +69,55 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
setIsolation(mc);
isValid(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -128,409 +128,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -538,19 +538,19 @@
public Double getNonStringWithNoOverriddenSetter(){
System.out.println("DSManagedConnectionFactory : getNonStringWithNoOverriddenSetter() called");
- return this.nonStringWithNoOverriddenSetter;
+ return this.nonStringWithNoOverriddenSetter;
}
public void setNonStringWithNoOverriddenSetter(Double dbl) {
System.out.println("DSManagedConnectionFactory : setNonStringWithNoOverriddenSetter() called");
- this.nonStringWithNoOverriddenSetter = dbl;
+ this.nonStringWithNoOverriddenSetter = dbl;
}
public Double getNonStringWithOverriddenSetter(){
System.out.println("DSManagedConnectionFactory : getNonStringWithOverriddenSetter() called");
return this.nonStringWithOverriddenSetter;
}
-
+
public void setNonStringWithOverriddenSetter(Double dbl) {
System.out.println("DSManagedConnectionFactory : setNonStringWithOverriddenSetter(Double) called");
this.nonStringWithOverriddenSetter = dbl;
@@ -567,35 +567,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java
index 219a365..4bf8b7b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,22 +114,22 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
@Override
@@ -140,67 +140,67 @@
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
@Override
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/servlet/SimpleBankServlet.java
index ff76f00..882ada4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/servlet/SimpleBankServlet.java
@@ -17,17 +17,17 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
import javax.rmi.PortableRemoteObject;
-import jakarta.ejb.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -43,14 +43,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -66,14 +66,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -90,7 +90,7 @@
customerSavings = customerSavingsHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -103,7 +103,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -115,7 +115,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -127,12 +127,12 @@
customerSavingsHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -142,7 +142,7 @@
customerSavings = (CustomerSavings)customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -151,7 +151,7 @@
customerChecking = (CustomerChecking)customerCheckingHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -211,9 +211,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/simpleBank.sql b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/simpleBank.sql
index 6ef75c3..e17aef4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/simpleBank.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringmcfproperties/sql/simpleBank.sql
@@ -1,14 +1,14 @@
drop table customer2;
create table customer2 (
- SSN varchar2(9),
- lastNAme varchar2(20),
- firstname varchar2(20),
- address1 varchar2 (20),
- address2 varchar2(20),
- city varchar2(10),
- state varchar2(10),
- zipcode varchar2(5),
+ SSN varchar2(9),
+ lastNAme varchar2(20),
+ firstname varchar2(20),
+ address1 varchar2 (20),
+ address2 varchar2(20),
+ city varchar2(10),
+ state varchar2(10),
+ zipcode varchar2(5),
savingsbalance number(10) ,
checkingbalance number(10) );
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/META-INF/ra.xml
index 866ebbc..ed74085 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/META-INF/ra.xml
@@ -83,7 +83,7 @@
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -94,7 +94,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/build.xml
index 2b77489..783991d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyAdminObject.java
index 862f9ff..d199d01 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyAdminObject.java
@@ -38,11 +38,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleActivationSpec.java
index 946d987..bb7918e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -42,7 +42,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -51,7 +51,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -60,7 +60,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -76,7 +76,7 @@
this.resourceadapter = ra;
}
- public void validate() {}
+ public void validate() {}
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleResourceAdapterImpl.java
index 4cd599c..cef6a56 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,15 +40,15 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
private WorkManager wm;
private String testName;
-
+
private Double nonStringPropWithoutOverridedSetter = null;
private Double nonStringPropWithOverridedSetter = null;
private String stringPropWithOverridedSetter = null;
@@ -62,7 +62,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -72,21 +72,21 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -96,14 +96,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -120,7 +120,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -128,7 +128,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -176,7 +176,7 @@
ex.printStackTrace();
}
}
-
+
debug("005. Simple RA start...");
}
@@ -208,12 +208,12 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -227,34 +227,34 @@
debug ("getNonStringPropWithoutOverridedSetter called...");
return this.nonStringPropWithoutOverridedSetter;
}
-
+
public void setNonStringPropWithoutOverridedSetter(Double d) {
debug ("setNonStringPropWithoutOverridedSetter(Double) called...");
this.nonStringPropWithoutOverridedSetter = d;
}
-//
+//
public Double getNonStringPropWithOverridedSetter(){
debug ("getNonStringPropWithOverridedSetter called...");
return this.nonStringPropWithOverridedSetter;
}
-
+
public void setNonStringPropWithOverridedSetter(Double d) {
debug ("setNonStringPropWithOverridedSetter(Double) called...");
this.nonStringPropWithOverridedSetter = d;
}
-
+
public void setNonStringPropWithOverridedSetter(String s) {
debug ("setNonStringPropWithOverridedSetter(String) called..." +
"throwing unsupportedexception");
throw new UnsupportedOperationException();
}
-//
+//
public String getStringPropWithOverridedSetter(){
debug ("getStringPropWithOverridedSetter called...");
return this.stringPropWithOverridedSetter;
}
-
+
public void setStringPropWithOverridedSetter(String s){
debug ("setStringPropWithOverridedSetter(String) called...");
this.stringPropWithOverridedSetter = s;
@@ -265,14 +265,14 @@
"throwing unsupportedOperationException");
throw new UnsupportedOperationException();
}
-
-
+
+
public void debug (String message) {
if (debug)
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/TestWMWork.java
index 7e585a3..9cd0663 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/WorkDispatcher.java
index 34a604f..cd98c45 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -243,7 +243,7 @@
break;
}
}
-
+
debug("LEAVE...");
}
@@ -258,14 +258,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -288,13 +288,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
@@ -310,7 +310,7 @@
Controls.done = true;
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
+ Controls.readyLock.notify();
}
} catch (Exception ex) {
ex.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/XID.java
index 6a6f84f..f5b977c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/nonstringraproperties/ra/src/connector/XID.java
@@ -31,8 +31,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -50,10 +50,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -93,7 +93,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/build.xml
index 6c58efb..edecbae 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/build.xml
@@ -34,8 +34,8 @@
<target name="all" depends="init-common, clean-common">
<ant dir="src" inheritAll="false" target="all"/>
<antcall target="ear-common">
- <param name="appname" value="worktest"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="worktest"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/ejb-jar.xml
index 8c12144..0c619e8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/ejb-jar.xml
@@ -33,8 +33,8 @@
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/sun-ejb-jar.xml
index 9fc2b60..80a1dc3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/META-INF/sun-ejb-jar.xml
@@ -43,7 +43,7 @@
</ior-security-config>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/beans/WorkTestEJB.java b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/beans/WorkTestEJB.java
index 1987ead..e591cb4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/beans/WorkTestEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/beans/WorkTestEJB.java
@@ -32,13 +32,13 @@
public WorkTestEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean removed");
}
public void executeTest() {
- try {
+ try {
Controls.setup();
Controls.submit();
Controls.triggerWork();
@@ -46,13 +46,13 @@
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
public void setSessionContext(SessionContext context) {
try {
Context ic = new InitialContext();
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
} catch (Exception ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/build.properties
index dad207b..0b38c19 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/client/Client.java
index b81bcee..efa7750 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/app/src/client/Client.java
@@ -28,22 +28,22 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector ThreadPool "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("Starting the thread pool test=> Please wait...");
+ debug("Starting the thread pool test=> Please wait...");
boolean pass = false;
try {
res = " TEST PASSED";
@@ -58,14 +58,14 @@
stat.printSummary("Connector-ThreadPool");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private void test() throws Exception {
Object o = (new InitialContext()).lookup("WorkTest");
- WorkTestHome home = (WorkTestHome)
+ WorkTestHome home = (WorkTestHome)
PortableRemoteObject.narrow(o, WorkTestHome.class);
WorkTest wt = home.create();
wt.executeTest();
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/build.xml b/appserver/tests/appserv-tests/devtests/connector/threadpool/build.xml
index 7407039..504cd41 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/build.xml
@@ -61,7 +61,7 @@
<target name="run" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="worktest" />
+ <param name="appname" value="worktest" />
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/build.xml
index 30bfb81..0959d84 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../threadpooltest-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/Controls.java
index 2ae3c32..74fee06 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/Controls.java
@@ -42,7 +42,7 @@
public boolean error = false;
private Work[] sWorks = new Work[setupWorks];
-
+
private Controls(WorkManager wm) {
this.wm = wm;
}
@@ -52,7 +52,7 @@
}
public static Controls getControls() {
- return control;
+ return control;
}
public void setupInitialWorks() {
@@ -80,7 +80,7 @@
public void trigger() {
if (completedCount > 0 || rejectedCount > 0 || error) {
- releaseAll();
+ releaseAll();
debug("Completed count => " + completedCount + " Rejected count:"+ rejectedCount + "error: " + error);
throw new RuntimeException("Error while triggering the actual tests");
}
@@ -161,7 +161,7 @@
event.getException().printStackTrace();
} else {
error = true;
- }
+ }
}
}
@@ -211,7 +211,7 @@
}
public void run() {
synchronized (this) {
- try {
+ try {
wait(TIME_OUT+BUFFER);
} catch (Exception e) {
e.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/MyAdminObject.java
index e64d053..1760bba 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/MyAdminObject.java
@@ -39,15 +39,15 @@
public void setNumberOfSetupWorks(int count) {
control.setNumberOfSetupWorks(count);
}
-
+
public int getNumberOfSetupWorks() {
return control.getNumberOfSetupWorks();
}
-
+
public void setNumberOfActualWorks(int num) {
control.setNumberOfActualWorks(num);
}
-
+
public int getNumberOfActualWorks() {
return control.getNumberOfActualWorks();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/ThreadPoolTestRA.java b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/ThreadPoolTestRA.java
index 6bf7f2a..b4b9c32 100644
--- a/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/ThreadPoolTestRA.java
+++ b/appserver/tests/appserv-tests/devtests/connector/threadpool/ra/src/connector/ThreadPoolTestRA.java
@@ -70,18 +70,18 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
throw new UnsupportedOperationException();
}
-
+
void debug (String message) {
if (debug)
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.properties b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.properties
index 4686618..db1d575 100644
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.properties
@@ -15,19 +15,19 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector-txlevelswitch-test1"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="rarfile" value="jdbc-ra-xa.rar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.xml
index b476022..c4882be 100644
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/build.xml
@@ -38,9 +38,9 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
- <ant dir="ra" target="clean"/>
+ <ant dir="ra" target="clean"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -54,25 +54,25 @@
<target name="build" depends="compile">
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/*.class" />
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/*.class" />
</antcall>
<antcall target="build-ra"/>
- <ant dir="ra" target="assemble"/>
- </target>
-
+ <ant dir="ra" target="assemble"/>
+ </target>
+
<target name="deploy" depends="init-common">
- <antcall target="create-ra-config"/>
+ <antcall target="create-ra-config"/>
<antcall target="deploy-rar-common">
- <param name="rarfile" value="ra/publish/lib/jdbc-ra-xa.rar"/>
+ <param name="rarfile" value="ra/publish/lib/jdbc-ra-xa.rar"/>
</antcall>
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jdbc-ra-xa"/>
- <param name="connection.defname" value="javax.sql.XADataSource"/>
- <param name="extra-params" value="--matchconnections=false"/>
- <param name="connector.conpool.name" value="txlevelswitch-pool-1"/>
+ <param name="connection.defname" value="javax.sql.XADataSource"/>
+ <param name="extra-params" value="--matchconnections=false"/>
+ <param name="connector.conpool.name" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-oracle-props">
<param name="pool.type" value="connector"/>
@@ -81,9 +81,9 @@
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jdbc-ra-xa"/>
- <param name="connection.defname" value="javax.sql.XADataSource"/>
- <param name="extra-params" value="--matchconnections=false"/>
- <param name="connector.conpool.name" value="txlevelswitch-pool-2"/>
+ <param name="connection.defname" value="javax.sql.XADataSource"/>
+ <param name="extra-params" value="--matchconnections=false"/>
+ <param name="connector.conpool.name" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="set-oracle-props">
<param name="pool.type" value="connector"/>
@@ -92,28 +92,28 @@
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-1"/>
- <param name="connector.jndi.name" value="test-res-1"/>
+ <param name="connector.jndi.name" value="test-res-1"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-2"/>
- <param name="connector.jndi.name" value="test-res-2"/>
+ <param name="connector.jndi.name" value="test-res-2"/>
</antcall>
<antcall target="deploy-common"/>
</target>
-
+
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="jdbc-ra-xa"/>
+ <param name="operand.props" value="jdbc-ra-xa"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="jdbc-ra-xa"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="jdbc-ra-xa"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
<target name="run" depends="init-common">
@@ -124,7 +124,7 @@
<antcall target="run-test-3"/>
<antcall target="run-test-2"/>
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/drop_pointbase.sql"/>
@@ -144,8 +144,8 @@
</antcall>
<antcall target="undeploy-common"/>
<antcall target="undeploy-rar-common"/>
- <antcall target="delete-ra-config"/>
- </target>
+ <antcall target="delete-ra-config"/>
+ </target>
<target name="build-ra">
<ant dir="ra" target="build"/>
</target>
@@ -153,15 +153,15 @@
<target name="usage">
<antcall target="usage-common"/>
</target>
-
+
<target name="run-test-1" depends="init-common">
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="XATransaction"/>
- <param name="poolName" value="txlevelswitch-pool-1"/>
+ <param name="tx-support" value="XATransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="XATransaction"/>
- <param name="poolName" value="txlevelswitch-pool-2"/>
+ <param name="tx-support" value="XATransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="1"/>
@@ -170,16 +170,16 @@
<target name="run-test-2" depends="init-common">
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="txlevelswitch-pool-1"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="txlevelswitch-pool-2"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="txlevelswitch-pool-1"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="2"/>
@@ -188,12 +188,12 @@
<target name="run-test-3" depends="init-common">
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="txlevelswitch-pool-1"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-1"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="XATransaction"/>
- <param name="poolName" value="txlevelswitch-pool-2"/>
+ <param name="tx-support" value="XATransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-2"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="1"/>
@@ -214,13 +214,13 @@
<antcall target="deploy-rar-common"/>
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jdbc-ra-xa"/>
- <param name="connection.defname" value="javax.sql.XADataSource"/>
- <param name="extra-params" value="--matchconnections=false"/>
- <param name="connector.conpool.name" value="txlevelswitch-pool-3"/>
+ <param name="connection.defname" value="javax.sql.XADataSource"/>
+ <param name="extra-params" value="--matchconnections=false"/>
+ <param name="connector.conpool.name" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="txlevelswitch-pool-3"/>
- <param name="connector.jndi.name" value="test-res-3"/>
+ <param name="connector.jndi.name" value="test-res-3"/>
</antcall>
<!--
<antcall target="deploy-jms-common">
@@ -229,20 +229,20 @@
-->
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="jmsra"/>
- <param name="connection.defname" value="jakarta.jms.QueueConnectionFactory"/>
- <param name="extra-params" value="--matchconnections=false"/>
- <param name="connector.conpool.name" value="jms-jdbc-res-1"/>
- <param name="operand.props" value="--transactionsupport LocalTransaction"/>
+ <param name="connection.defname" value="jakarta.jms.QueueConnectionFactory"/>
+ <param name="extra-params" value="--matchconnections=false"/>
+ <param name="connector.conpool.name" value="jms-jdbc-res-1"/>
+ <param name="operand.props" value="--transactionsupport LocalTransaction"/>
</antcall>
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="jms-jdbc-res-1"/>
- <param name="connector.jndi.name" value="jms/jms-jdbc-res-1"/>
+ <param name="connector.jndi.name" value="jms/jms-jdbc-res-1"/>
</antcall>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="create-admin-object"/>
- <arg line="--target ${appserver.instance.name}"/>
+ <arg line="--target ${appserver.instance.name}"/>
<arg line="--restype jakarta.jms.Queue"/>
- <arg line="--raname jmsra"/>
+ <arg line="--raname jmsra"/>
<arg line="${as.props}"/>
<arg line="--property maxNumActiveConsumers=${activeconsumer.maxnum}"/>
<arg line="jms/SampleQueue"/>
@@ -250,7 +250,7 @@
<antcall target="deploy-common"/>
</target>
-
+
<target name="run-for-jms" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/create_pointbase.sql"/>
@@ -264,7 +264,7 @@
<!-- negative test : JMS=JDBC=non-xa -->
<antcall target="run-test-3-for-jms"/>
</target>
-
+
<target name="undeploy-for-jms" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/drop_pointbase.sql"/>
@@ -285,25 +285,25 @@
</antcall>
<exec executable="${ASADMIN}" failonerror="false">
<arg line="delete-admin-object"/>
- <arg line="--target ${appserver.instance.name}"/>
+ <arg line="--target ${appserver.instance.name}"/>
<arg line="${as.props}"/>
<arg line="jms/SampleQueue"/>
</exec>
-
+
<antcall target="undeploy-common"/>
<antcall target="undeploy-rar-common"/>
- </target>
+ </target>
<target name="run-test-1-for-jms" depends="init-common">
<!--
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="txlevelswitch-pool-3"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="XATransaction"/>
- <param name="poolName" value="jms-jdbc-res-1"/>
+ <param name="tx-support" value="XATransaction"/>
+ <param name="poolName" value="jms-jdbc-res-1"/>
</antcall>
-->
<antcall target="runclient-common">
@@ -313,12 +313,12 @@
<target name="run-test-2-for-jms" depends="init-common">
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="XATransaction"/>
- <param name="poolName" value="txlevelswitch-pool-3"/>
+ <param name="tx-support" value="XATransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="jms-jdbc-res-1"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="jms-jdbc-res-1"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="jms-jdbc-2"/>
@@ -327,12 +327,12 @@
<target name="run-test-3-for-jms" depends="init-common">
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="txlevelswitch-pool-3"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="txlevelswitch-pool-3"/>
</antcall>
<antcall target="set-pool-tx-support">
- <param name="tx-support" value="LocalTransaction"/>
- <param name="poolName" value="jms-jdbc-res-1"/>
+ <param name="tx-support" value="LocalTransaction"/>
+ <param name="poolName" value="jms-jdbc-res-1"/>
</antcall>
<antcall target="runclient-common">
<param name="appclient.application.args" value="jms-jdbc-3"/>
@@ -344,8 +344,8 @@
<param name="sql.file" value="sql/create_pointbase.sql"/>
</antcall>
</target>
-
+
<target name="drop-sql">
-
+
</target>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/client/Client.java
index f577f57..2b4ea60 100644
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/client/Client.java
@@ -26,132 +26,132 @@
import jakarta.jms.*;
public class Client {
-
+
public static void main(String[] args)
throws Exception {
- SimpleReporterAdapter stat = new SimpleReporterAdapter();
- String testSuite = "txlevelswitch-test1 ";
+ SimpleReporterAdapter stat = new SimpleReporterAdapter();
+ String testSuite = "txlevelswitch-test1 ";
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/ejb/SimpleSessionHome");
- SimpleSessionHome simpleSessionHome = (SimpleSessionHome)
+ SimpleSessionHome simpleSessionHome = (SimpleSessionHome)
javax.rmi.PortableRemoteObject.narrow(objRef, SimpleSessionHome.class);
-
- stat.addDescription("Running txlevelswitch testSuite1 ");
+
+ stat.addDescription("Running txlevelswitch testSuite1 ");
SimpleSession simpleSession = simpleSessionHome.create();
- if ( "2".equals(args[0]) ) {
- //Here we are using 2 non-XA datasources
- try {
+ if ( "2".equals(args[0]) ) {
+ //Here we are using 2 non-XA datasources
+ try {
if (simpleSession.test2() ) {
- stat.addStatus( testSuite + " test2 : " , stat.PASS );
- } else {
- stat.addStatus( testSuite + " test2 : " , stat.FAIL );
- }
- } catch( Exception e) {
- System.out.println("app threw exception********");
- stat.addStatus(testSuite + " test2 : ", stat.PASS);
- }
- } else if ( "1".equals(args[0]) || "3".equals(args[0])) {
- //Here we are using 2 XA datasources
+ stat.addStatus( testSuite + " test2 : " , stat.PASS );
+ } else {
+ stat.addStatus( testSuite + " test2 : " , stat.FAIL );
+ }
+ } catch( Exception e) {
+ System.out.println("app threw exception********");
+ stat.addStatus(testSuite + " test2 : ", stat.PASS);
+ }
+ } else if ( "1".equals(args[0]) || "3".equals(args[0])) {
+ //Here we are using 2 XA datasources
if (simpleSession.test1() ) {
- stat.addStatus( testSuite + " test1 : " , stat.PASS );
- } else {
- stat.addStatus( testSuite + " test1 : " , stat.FAIL );
- }
-
- } else if ("jms-jdbc-1".equals(args[0]) ) {
- if (simpleSession.jmsJdbcTest1() ) {
-
- System.out.println(" Now waiting for message in client ");
- System.out.println(" Before Lookup of QCF");
- QueueConnectionFactory qcf = (QueueConnectionFactory)
- //ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
- ic.lookup("jms/jms-jdbc-res-1");
- System.out.println(" After Lookup of QCF");
-
- System.out.println(" Before lookup of Q");
- jakarta.jms.Queue queue = (jakarta.jms.Queue) ic.lookup("jms/SampleQueue");
- System.out.println(" After lookup of Q");
- System.out.println(" Before createQueueConnection");
- QueueConnection qConn = qcf.createQueueConnection("guest", "guest");
- qConn.start();
- System.out.println(" After createQueueConnection");
-
- System.out.println(" Before createQueueSession");
- QueueSession qSess = qConn.createQueueSession(false,
- Session.AUTO_ACKNOWLEDGE);
- System.out.println(" After createQueueSession");
- QueueReceiver qRecv = qSess.createReceiver(queue);
- TextMessage textMsg = (TextMessage) qRecv.receive( 20000 );
- //if ( textMsg != null && "Hello World".equals( textMsg.getText() ) ) {
- if ( textMsg != null ) {
- System.out.println(" Text message is : " + textMsg.getText() );
-
- stat.addStatus( testSuite + " jms-jdbc-test1 : " , stat.PASS );
- } else {
- System.out.println(" TextMEssage is null");
- stat.addStatus( testSuite + " jms-jdbc-test1 : ", stat.FAIL );
- }
- qSess.close();
- qConn.close();
-
- stat.addStatus( testSuite + " jms-jdbc-test1 : " , stat.PASS );
- } else {
- stat.addStatus( testSuite + " jms-jdbc-test1 : " , stat.FAIL );
- }
+ stat.addStatus( testSuite + " test1 : " , stat.PASS );
+ } else {
+ stat.addStatus( testSuite + " test1 : " , stat.FAIL );
+ }
- } else if ("jms-jdbc-2".equals(args[0]) ) {
- if ( simpleSession.jmsJdbcTest2() ) {
- stat.addStatus( testSuite + " jms-jdbc-test2 : " , stat.PASS );
-
- System.out.println(" Now waiting for message in client ");
- System.out.println(" Before Lookup of QCF");
- QueueConnectionFactory qcf = (QueueConnectionFactory)
- //ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
- ic.lookup("jms/jms-jdbc-res-1");
- System.out.println(" After Lookup of QCF");
-
- System.out.println(" Before lookup of Q");
- jakarta.jms.Queue queue = (jakarta.jms.Queue) ic.lookup("jms/SampleQueue");
- System.out.println(" After lookup of Q");
- System.out.println(" Before createQueueConnection");
- QueueConnection qConn = qcf.createQueueConnection("guest", "guest");
- qConn.start();
- System.out.println(" After createQueueConnection");
-
- System.out.println(" Before createQueueSession");
- QueueSession qSess = qConn.createQueueSession(false,
- Session.AUTO_ACKNOWLEDGE);
- System.out.println(" After createQueueSession");
- QueueReceiver qRecv = qSess.createReceiver(queue);
- TextMessage textMsg = (TextMessage) qRecv.receive( 20000 );
- //if ( textMsg != null && "Hello World".equals( textMsg.getText() ) ) {
- if ( textMsg != null ) {
- System.out.println(" Text message is : " + textMsg.getText() );
-
- stat.addStatus( testSuite + " jms-jdbc-test2 : " , stat.PASS );
- } else {
- System.out.println(" TextMessage is null");
- stat.addStatus( testSuite + " jms-jdbc-test2 : ", stat.FAIL );
- }
- qSess.close();
- qConn.close();
+ } else if ("jms-jdbc-1".equals(args[0]) ) {
+ if (simpleSession.jmsJdbcTest1() ) {
+
+ System.out.println(" Now waiting for message in client ");
+ System.out.println(" Before Lookup of QCF");
+ QueueConnectionFactory qcf = (QueueConnectionFactory)
+ //ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
+ ic.lookup("jms/jms-jdbc-res-1");
+ System.out.println(" After Lookup of QCF");
+
+ System.out.println(" Before lookup of Q");
+ jakarta.jms.Queue queue = (jakarta.jms.Queue) ic.lookup("jms/SampleQueue");
+ System.out.println(" After lookup of Q");
+ System.out.println(" Before createQueueConnection");
+ QueueConnection qConn = qcf.createQueueConnection("guest", "guest");
+ qConn.start();
+ System.out.println(" After createQueueConnection");
+
+ System.out.println(" Before createQueueSession");
+ QueueSession qSess = qConn.createQueueSession(false,
+ Session.AUTO_ACKNOWLEDGE);
+ System.out.println(" After createQueueSession");
+ QueueReceiver qRecv = qSess.createReceiver(queue);
+ TextMessage textMsg = (TextMessage) qRecv.receive( 20000 );
+ //if ( textMsg != null && "Hello World".equals( textMsg.getText() ) ) {
+ if ( textMsg != null ) {
+ System.out.println(" Text message is : " + textMsg.getText() );
+
+ stat.addStatus( testSuite + " jms-jdbc-test1 : " , stat.PASS );
+ } else {
+ System.out.println(" TextMEssage is null");
+ stat.addStatus( testSuite + " jms-jdbc-test1 : ", stat.FAIL );
+ }
+ qSess.close();
+ qConn.close();
+
+ stat.addStatus( testSuite + " jms-jdbc-test1 : " , stat.PASS );
+ } else {
+ stat.addStatus( testSuite + " jms-jdbc-test1 : " , stat.FAIL );
+ }
+
+ } else if ("jms-jdbc-2".equals(args[0]) ) {
+ if ( simpleSession.jmsJdbcTest2() ) {
+ stat.addStatus( testSuite + " jms-jdbc-test2 : " , stat.PASS );
+
+ System.out.println(" Now waiting for message in client ");
+ System.out.println(" Before Lookup of QCF");
+ QueueConnectionFactory qcf = (QueueConnectionFactory)
+ //ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
+ ic.lookup("jms/jms-jdbc-res-1");
+ System.out.println(" After Lookup of QCF");
+
+ System.out.println(" Before lookup of Q");
+ jakarta.jms.Queue queue = (jakarta.jms.Queue) ic.lookup("jms/SampleQueue");
+ System.out.println(" After lookup of Q");
+ System.out.println(" Before createQueueConnection");
+ QueueConnection qConn = qcf.createQueueConnection("guest", "guest");
+ qConn.start();
+ System.out.println(" After createQueueConnection");
+
+ System.out.println(" Before createQueueSession");
+ QueueSession qSess = qConn.createQueueSession(false,
+ Session.AUTO_ACKNOWLEDGE);
+ System.out.println(" After createQueueSession");
+ QueueReceiver qRecv = qSess.createReceiver(queue);
+ TextMessage textMsg = (TextMessage) qRecv.receive( 20000 );
+ //if ( textMsg != null && "Hello World".equals( textMsg.getText() ) ) {
+ if ( textMsg != null ) {
+ System.out.println(" Text message is : " + textMsg.getText() );
+
+ stat.addStatus( testSuite + " jms-jdbc-test2 : " , stat.PASS );
+ } else {
+ System.out.println(" TextMessage is null");
+ stat.addStatus( testSuite + " jms-jdbc-test2 : ", stat.FAIL );
+ }
+ qSess.close();
+ qConn.close();
- } else {
- stat.addStatus( testSuite + " jms-jdbc-test2 : " , stat.FAIL );
- }
+ } else {
+ stat.addStatus( testSuite + " jms-jdbc-test2 : " , stat.FAIL );
+ }
- } else if ( "jms-jdbc-3".equals(args[0]) ) {
+ } else if ( "jms-jdbc-3".equals(args[0]) ) {
if ( simpleSession.jmsJdbcTest3()) {
- stat.addStatus( testSuite + " jms-jdbc-test3 : " , stat.PASS );
- } else {
- stat.addStatus( testSuite + " jms-jdbc-test3 : " , stat.FAIL );
- }
- }
+ stat.addStatus( testSuite + " jms-jdbc-test3 : " , stat.PASS );
+ } else {
+ stat.addStatus( testSuite + " jms-jdbc-test3 : " , stat.FAIL );
+ }
+ }
-
- stat.printSummary();
+
+ stat.printSummary();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/ejb-jar.xml
index f915011..01ebefc 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/ejb-jar.xml
@@ -75,6 +75,6 @@
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/sun-ejb-jar.xml
index 0240689..3e77640 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/descriptor/sun-ejb-jar.xml
@@ -34,15 +34,15 @@
</resource-ref>
<resource-ref>
<res-ref-name>jms/SampleQueue</res-ref-name>
- <jndi-name>jms/SampleQueue</jndi-name>
+ <jndi-name>jms/SampleQueue</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jms/jms-jdbc-res-1</res-ref-name>
- <jndi-name>jms/jms-jdbc-res-1</jndi-name>
+ <jndi-name>jms/jms-jdbc-res-1</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>test-res-3</res-ref-name>
- <jndi-name>test-res-3</jndi-name>
+ <jndi-name>test-res-3</jndi-name>
</resource-ref>
</ejb>
</enterprise-beans>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ejb/SimpleSessionBean.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ejb/SimpleSessionBean.java
index 76fc38c..8ad8a8f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ejb/SimpleSessionBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ejb/SimpleSessionBean.java
@@ -49,69 +49,69 @@
* This should work since for this test both our pools are XA
*/
public boolean test1() throws Exception {
- System.out.println("************IN TEST 1*************");
- InitialContext ic = new InitialContext();
- DataSource ds1 = (DataSource)ic.lookup("java:comp/env/DataSource1");
- DataSource ds2 = (DataSource)ic.lookup("java:comp/env/DataSource2");
- Connection conn1 = null;
- Connection conn2 = null;
- Statement stmt1 = null;
- Statement stmt2 = null;
- ResultSet rs1 = null;
- ResultSet rs2 = null;
- boolean passed = true;
- try {
- System.out.println("Before getConnection 1");
- conn1 = ds1.getConnection();
- System.out.println("After getConnection 1");
- System.out.println("Before getConnection 2");
- conn2 = ds2.getConnection();
- System.out.println("After getConnection 2");
-
- System.out.println("Before createStatement 1");
- stmt1 = conn1.createStatement();
- System.out.println("After createStatement 1");
- System.out.println("Before createStatement 2");
- stmt2 = conn2.createStatement();
- System.out.println("After createStatement 2");
+ System.out.println("************IN TEST 1*************");
+ InitialContext ic = new InitialContext();
+ DataSource ds1 = (DataSource)ic.lookup("java:comp/env/DataSource1");
+ DataSource ds2 = (DataSource)ic.lookup("java:comp/env/DataSource2");
+ Connection conn1 = null;
+ Connection conn2 = null;
+ Statement stmt1 = null;
+ Statement stmt2 = null;
+ ResultSet rs1 = null;
+ ResultSet rs2 = null;
+ boolean passed = true;
+ try {
+ System.out.println("Before getConnection 1");
+ conn1 = ds1.getConnection();
+ System.out.println("After getConnection 1");
+ System.out.println("Before getConnection 2");
+ conn2 = ds2.getConnection();
+ System.out.println("After getConnection 2");
- System.out.println("executing statement 1");
- rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
+ System.out.println("Before createStatement 1");
+ stmt1 = conn1.createStatement();
+ System.out.println("After createStatement 1");
+ System.out.println("Before createStatement 2");
+ stmt2 = conn2.createStatement();
+ System.out.println("After createStatement 2");
- System.out.println("executing statement 2");
+ System.out.println("executing statement 1");
+ rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
+
+ System.out.println("executing statement 2");
rs2 = stmt2.executeQuery("SELECT * FROM TXLEVELSWITCH2");
- System.out.println("finished executing statements");
- passed = rs1.next() & rs2.next();
- } catch (Exception e) {
- passed = false;
- e.printStackTrace();
- } finally {
- if (rs1 != null ) {
- try { rs1.close(); } catch( Exception e1 ) {}
- }
+ System.out.println("finished executing statements");
+ passed = rs1.next() & rs2.next();
+ } catch (Exception e) {
+ passed = false;
+ e.printStackTrace();
+ } finally {
+ if (rs1 != null ) {
+ try { rs1.close(); } catch( Exception e1 ) {}
+ }
- if (rs2 != null ) {
- try { rs2.close(); } catch( Exception e1 ) {}
- }
+ if (rs2 != null ) {
+ try { rs2.close(); } catch( Exception e1 ) {}
+ }
- if ( stmt1 != null ) {
- try { stmt1.close(); } catch( Exception e1) {}
- }
- if ( stmt2 != null ) {
- try { stmt2.close(); } catch( Exception e1) {}
- }
- if ( conn1 != null ) {
- try { conn1.close(); } catch( Exception e1) {}
- }
- if ( conn2 != null ) {
- try { conn2.close(); } catch( Exception e1) {}
- }
- }
-
- return passed;
+ if ( stmt1 != null ) {
+ try { stmt1.close(); } catch( Exception e1) {}
+ }
+ if ( stmt2 != null ) {
+ try { stmt2.close(); } catch( Exception e1) {}
+ }
+ if ( conn1 != null ) {
+ try { conn1.close(); } catch( Exception e1) {}
+ }
+ if ( conn2 != null ) {
+ try { conn2.close(); } catch( Exception e1) {}
+ }
}
-
+
+ return passed;
+ }
+
/**
* Get connection with two non-xa datasources.
* Do some work using both. Should throw an
@@ -122,150 +122,150 @@
* changeover is indeed successful
*/
public boolean test2() throws Exception {
- System.out.println("************IN TEST 2*************");
- InitialContext ic = new InitialContext();
- DataSource ds1 = (DataSource)ic.lookup("java:comp/env/DataSource1");
- DataSource ds2 = (DataSource)ic.lookup("java:comp/env/DataSource2");
- Connection conn1 = null;
- Connection conn2 = null;
- Statement stmt1 = null;
- Statement stmt2 = null;
- ResultSet rs1 = null;
- ResultSet rs2 = null;
- boolean passed = true;
- try {
- System.out.println("Before getConnection 1");
- conn1 = ds1.getConnection();
- System.out.println("After getConnection 1");
- System.out.println("Before getConnection 2");
- conn2 = ds2.getConnection();
- System.out.println("After getConnection 2");
-
- System.out.println("Before createStatement 1");
- stmt1 = conn1.createStatement();
- System.out.println("After createStatement 1");
- System.out.println("Before createStatement 2");
- stmt2 = conn2.createStatement();
- System.out.println("After createStatement 2");
-
- System.out.println("executing statement 1");
+ System.out.println("************IN TEST 2*************");
+ InitialContext ic = new InitialContext();
+ DataSource ds1 = (DataSource)ic.lookup("java:comp/env/DataSource1");
+ DataSource ds2 = (DataSource)ic.lookup("java:comp/env/DataSource2");
+ Connection conn1 = null;
+ Connection conn2 = null;
+ Statement stmt1 = null;
+ Statement stmt2 = null;
+ ResultSet rs1 = null;
+ ResultSet rs2 = null;
+ boolean passed = true;
+ try {
+ System.out.println("Before getConnection 1");
+ conn1 = ds1.getConnection();
+ System.out.println("After getConnection 1");
+ System.out.println("Before getConnection 2");
+ conn2 = ds2.getConnection();
+ System.out.println("After getConnection 2");
- try {
- rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
+ System.out.println("Before createStatement 1");
+ stmt1 = conn1.createStatement();
+ System.out.println("After createStatement 1");
+ System.out.println("Before createStatement 2");
+ stmt2 = conn2.createStatement();
+ System.out.println("After createStatement 2");
+
+ System.out.println("executing statement 1");
+
+ try {
+ rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
} catch( Exception e2 ) {
- System.out.println("Exception for first query :" + e2.getMessage() );
- } finally {
- passed = false;
+ System.out.println("Exception for first query :" + e2.getMessage() );
+ } finally {
+ passed = false;
}
-
- System.out.println("executing statement 2");
- try {
- rs2 = stmt2.executeQuery("SELECT * FROM TXLEVELSWITCH2");
- } catch( Exception e2) {
- System.out.println("Exception for second query :" + e2.getMessage() );
- } finally {
- passed = false;
- }
- System.out.println("finished executing statements");
- passed = !(rs1.next() & rs2.next());
- } catch (Exception e) {
- passed = true;
- System.out.println("final exception : " + e.getMessage() );
- throw new EJBException(e);
- } finally {
- if (rs1 != null ) {
- try { rs1.close(); } catch( Exception e1 ) {}
- }
+ System.out.println("executing statement 2");
+ try {
+ rs2 = stmt2.executeQuery("SELECT * FROM TXLEVELSWITCH2");
+ } catch( Exception e2) {
+ System.out.println("Exception for second query :" + e2.getMessage() );
+ } finally {
+ passed = false;
+ }
- if (rs2 != null ) {
- try { rs2.close(); } catch( Exception e1 ) {}
- }
+ System.out.println("finished executing statements");
+ passed = !(rs1.next() & rs2.next());
+ } catch (Exception e) {
+ passed = true;
+ System.out.println("final exception : " + e.getMessage() );
+ throw new EJBException(e);
+ } finally {
+ if (rs1 != null ) {
+ try { rs1.close(); } catch( Exception e1 ) {}
+ }
- if ( stmt1 != null ) {
- try { stmt1.close(); } catch( Exception e1) {}
- }
- if ( stmt2 != null ) {
- try { stmt2.close(); } catch( Exception e1) {}
- }
- if ( conn1 != null ) {
- try { conn1.close(); } catch( Exception e1) {}
- }
- if ( conn2 != null ) {
- try { conn2.close(); } catch( Exception e1) {}
- }
- }
- return passed;
+ if (rs2 != null ) {
+ try { rs2.close(); } catch( Exception e1 ) {}
+ }
+
+ if ( stmt1 != null ) {
+ try { stmt1.close(); } catch( Exception e1) {}
+ }
+ if ( stmt2 != null ) {
+ try { stmt2.close(); } catch( Exception e1) {}
+ }
+ if ( conn1 != null ) {
+ try { conn1.close(); } catch( Exception e1) {}
+ }
+ if ( conn2 != null ) {
+ try { conn2.close(); } catch( Exception e1) {}
+ }
+ }
+ return passed;
}
/**
* Get connection with one non-XA datasource and then getConnection
- * with a JMS resource
+ * with a JMS resource
*/
public boolean jmsJdbcTest1() throws Exception {
- System.out.println("************IN jmsJdbcTest 1*************");
- InitialContext ic = new InitialContext();
- DataSource ds1 = (DataSource)ic.lookup("java:comp/env/test-res-3");
- QueueConnectionFactory qcf = (QueueConnectionFactory)
- ic.lookup("jms/jms-jdbc-res-1");
- Queue q = (Queue) ic.lookup("java:comp/env/jms/SampleQueue");
+ System.out.println("************IN jmsJdbcTest 1*************");
+ InitialContext ic = new InitialContext();
+ DataSource ds1 = (DataSource)ic.lookup("java:comp/env/test-res-3");
+ QueueConnectionFactory qcf = (QueueConnectionFactory)
+ ic.lookup("jms/jms-jdbc-res-1");
+ Queue q = (Queue) ic.lookup("java:comp/env/jms/SampleQueue");
- Connection conn1 = null;
- Statement stmt1 = null;
- ResultSet rs1 = null;
+ Connection conn1 = null;
+ Statement stmt1 = null;
+ ResultSet rs1 = null;
- QueueSession qSess = null;
- QueueConnection qConn = null;
- QueueSender qSender = null;
- TextMessage message = null;
-
- boolean passed = false;
- try {
- System.out.println("Before getConnection 1");
- conn1 = ds1.getConnection();
- System.out.println("After getConnection 1");
+ QueueSession qSess = null;
+ QueueConnection qConn = null;
+ QueueSender qSender = null;
+ TextMessage message = null;
+
+ boolean passed = false;
+ try {
+ System.out.println("Before getConnection 1");
+ conn1 = ds1.getConnection();
+ System.out.println("After getConnection 1");
System.out.println(" Before createStatent");
- stmt1 = conn1.createStatement();
+ stmt1 = conn1.createStatement();
System.out.println(" After createStatent");
- System.out.println(" Before executeQuery");
- rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
- System.out.println(" After executeQuery");
- System.out.println("Before createQueueConnection");
- qConn = qcf.createQueueConnection();
- System.out.println("After createQueueConnection");
- System.out.println("Before createQueueSession");
- qSess = qConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
- System.out.println("After createQueueSession");
- qSender = qSess.createSender( q );
- message = qSess.createTextMessage();
- message.setText( "Hello World");
- qSender.send( message );
- System.out.println(" Sent Message");
- passed = true;
-
- } catch (Exception e) {
- passed = false;
- e.printStackTrace();
- } finally {
- if ( rs1 != null ) {
- try { rs1.close();} catch( Exception e1) {}
- }
- if ( stmt1 != null ) {
- try { stmt1.close();} catch( Exception e1) {}
- }
- if ( conn1 != null ) {
- try { conn1.close(); } catch( Exception e1) {}
- }
- if ( qSess != null ) {
- try { qSess.close();} catch(Exception e1) {}
- }
-
- if ( qConn != null ) {
- try { qConn.close(); } catch( Exception e1) {}
- }
- }
-
- return passed;
+ System.out.println(" Before executeQuery");
+ rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
+ System.out.println(" After executeQuery");
+ System.out.println("Before createQueueConnection");
+ qConn = qcf.createQueueConnection();
+ System.out.println("After createQueueConnection");
+ System.out.println("Before createQueueSession");
+ qSess = qConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
+ System.out.println("After createQueueSession");
+ qSender = qSess.createSender( q );
+ message = qSess.createTextMessage();
+ message.setText( "Hello World");
+ qSender.send( message );
+ System.out.println(" Sent Message");
+ passed = true;
+
+ } catch (Exception e) {
+ passed = false;
+ e.printStackTrace();
+ } finally {
+ if ( rs1 != null ) {
+ try { rs1.close();} catch( Exception e1) {}
+ }
+ if ( stmt1 != null ) {
+ try { stmt1.close();} catch( Exception e1) {}
+ }
+ if ( conn1 != null ) {
+ try { conn1.close(); } catch( Exception e1) {}
+ }
+ if ( qSess != null ) {
+ try { qSess.close();} catch(Exception e1) {}
+ }
+
+ if ( qConn != null ) {
+ try { qConn.close(); } catch( Exception e1) {}
+ }
+ }
+
+ return passed;
}
/**
@@ -273,69 +273,69 @@
* with a JMS resource as non-xa
*/
public boolean jmsJdbcTest2() throws Exception {
- System.out.println("************IN jmsJdbcTest 2*************");
- InitialContext ic = new InitialContext();
- DataSource ds1 = (DataSource)ic.lookup("java:comp/env/test-res-3");
- QueueConnectionFactory qcf = (QueueConnectionFactory)
- ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
- Queue q = (Queue) ic.lookup("java:comp/env/jms/SampleQueue");
+ System.out.println("************IN jmsJdbcTest 2*************");
+ InitialContext ic = new InitialContext();
+ DataSource ds1 = (DataSource)ic.lookup("java:comp/env/test-res-3");
+ QueueConnectionFactory qcf = (QueueConnectionFactory)
+ ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
+ Queue q = (Queue) ic.lookup("java:comp/env/jms/SampleQueue");
- Connection conn1 = null;
- Statement stmt1 = null;
- ResultSet rs1 = null;
+ Connection conn1 = null;
+ Statement stmt1 = null;
+ ResultSet rs1 = null;
- QueueSession qSess = null;
- QueueConnection qConn = null;
- QueueSender qSender = null;
- TextMessage message = null;
-
- boolean passed = true;
- try {
- System.out.println("Before getConnection 1");
- conn1 = ds1.getConnection();
- System.out.println("After getConnection 1");
+ QueueSession qSess = null;
+ QueueConnection qConn = null;
+ QueueSender qSender = null;
+ TextMessage message = null;
+
+ boolean passed = true;
+ try {
+ System.out.println("Before getConnection 1");
+ conn1 = ds1.getConnection();
+ System.out.println("After getConnection 1");
System.out.println(" Before createStatent");
- stmt1 = conn1.createStatement();
+ stmt1 = conn1.createStatement();
System.out.println(" After createStatent");
- System.out.println(" Before executeQuery");
- rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
- System.out.println(" After executeQuery");
+ System.out.println(" Before executeQuery");
+ rs1 = stmt1.executeQuery("SELECT * FROM TXLEVELSWITCH");
+ System.out.println(" After executeQuery");
- System.out.println("Before createQueueConnection");
- qConn = qcf.createQueueConnection();
- System.out.println("After createQueueConnection");
- System.out.println("Before createQueueSession");
- qSess = qConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
- System.out.println("After createQueueSession");
- qSender = qSess.createSender( q );
- message = qSess.createTextMessage();
- message.setText( "Hello World");
- qSender.send( message );
- System.out.println(" Sent message");
-
- } catch (Exception e) {
- passed = false;
- e.printStackTrace();
- } finally {
- if ( rs1 != null ) {
- try { rs1.close();} catch( Exception e1) {}
- }
- if ( stmt1 != null ) {
- try { stmt1.close();} catch( Exception e1) {}
- }
- if ( conn1 != null ) {
- try { conn1.close(); } catch( Exception e1) {}
- }
- if ( qSess != null ) {
- try { qSess.close();} catch(Exception e1) {}
- }
-
- if ( qConn != null ) {
- try { qConn.close(); } catch( Exception e1) {}
- }
- }
+ System.out.println("Before createQueueConnection");
+ qConn = qcf.createQueueConnection();
+ System.out.println("After createQueueConnection");
+ System.out.println("Before createQueueSession");
+ qSess = qConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
+ System.out.println("After createQueueSession");
+ qSender = qSess.createSender( q );
+ message = qSess.createTextMessage();
+ message.setText( "Hello World");
+ qSender.send( message );
+ System.out.println(" Sent message");
- return passed;
+ } catch (Exception e) {
+ passed = false;
+ e.printStackTrace();
+ } finally {
+ if ( rs1 != null ) {
+ try { rs1.close();} catch( Exception e1) {}
+ }
+ if ( stmt1 != null ) {
+ try { stmt1.close();} catch( Exception e1) {}
+ }
+ if ( conn1 != null ) {
+ try { conn1.close(); } catch( Exception e1) {}
+ }
+ if ( qSess != null ) {
+ try { qSess.close();} catch(Exception e1) {}
+ }
+
+ if ( qConn != null ) {
+ try { qConn.close(); } catch( Exception e1) {}
+ }
+ }
+
+ return passed;
}
/**
@@ -343,69 +343,69 @@
* with a JMS resource as non-xa
*/
public boolean jmsJdbcTest3() throws Exception {
- System.out.println("************IN jmsJdbcTest 3*************");
- InitialContext ic = new InitialContext();
- DataSource ds1 = (DataSource)ic.lookup("java:comp/env/test-res-3");
- QueueConnectionFactory qcf = (QueueConnectionFactory)
- ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
- Queue q = (Queue) ic.lookup("java:comp/env/jms/SampleQueue");
+ System.out.println("************IN jmsJdbcTest 3*************");
+ InitialContext ic = new InitialContext();
+ DataSource ds1 = (DataSource)ic.lookup("java:comp/env/test-res-3");
+ QueueConnectionFactory qcf = (QueueConnectionFactory)
+ ic.lookup("java:comp/env/jms/jms-jdbc-res-1");
+ Queue q = (Queue) ic.lookup("java:comp/env/jms/SampleQueue");
- Connection conn1 = null;
- Statement stmt1 = null;
- ResultSet rs1 = null;
+ Connection conn1 = null;
+ Statement stmt1 = null;
+ ResultSet rs1 = null;
- QueueSession qSess = null;
- QueueConnection qConn = null;
- QueueSender qSender = null;
- TextMessage message = null;
-
- boolean passed = false;
- try {
- System.out.println("Before getConnection 1");
- conn1 = ds1.getConnection();
- System.out.println("After getConnection 1");
+ QueueSession qSess = null;
+ QueueConnection qConn = null;
+ QueueSender qSender = null;
+ TextMessage message = null;
+
+ boolean passed = false;
+ try {
+ System.out.println("Before getConnection 1");
+ conn1 = ds1.getConnection();
+ System.out.println("After getConnection 1");
System.out.println(" Before createStatent");
- stmt1 = conn1.createStatement();
+ stmt1 = conn1.createStatement();
System.out.println(" After createStatent");
- System.out.println(" Before executeQuery");
- rs1 = stmt1.executeQuery("SELECT * FROM DBUSER.TXLEVELSWITCH");
- System.out.println(" After executeQuery");
+ System.out.println(" Before executeQuery");
+ rs1 = stmt1.executeQuery("SELECT * FROM DBUSER.TXLEVELSWITCH");
+ System.out.println(" After executeQuery");
- System.out.println("Before createQueueConnection");
- qConn = qcf.createQueueConnection();
- System.out.println("After createQueueConnection");
- System.out.println("Before createQueueSession");
- qSess = qConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
- System.out.println("After createQueueSession");
- qSender = qSess.createSender( q );
- message = qSess.createTextMessage();
- message.setText( "Hello World");
- qSender.send( message );
- System.out.println(" Sent message");
-
- } catch (Exception e) {
- passed = true;
- e.printStackTrace();
- } finally {
- if ( rs1 != null ) {
- try { rs1.close();} catch( Exception e1) {}
- }
- if ( stmt1 != null ) {
- try { stmt1.close();} catch( Exception e1) {}
- }
- if ( conn1 != null ) {
- try { conn1.close(); } catch( Exception e1) {}
- }
- if ( qSess != null ) {
- try { qSess.close();} catch(Exception e1) {}
- }
-
- if ( qConn != null ) {
- try { qConn.close(); } catch( Exception e1) {}
- }
- }
+ System.out.println("Before createQueueConnection");
+ qConn = qcf.createQueueConnection();
+ System.out.println("After createQueueConnection");
+ System.out.println("Before createQueueSession");
+ qSess = qConn.createQueueSession( false, Session.AUTO_ACKNOWLEDGE );
+ System.out.println("After createQueueSession");
+ qSender = qSess.createSender( q );
+ message = qSess.createTextMessage();
+ message.setText( "Hello World");
+ qSender.send( message );
+ System.out.println(" Sent message");
- return passed;
+ } catch (Exception e) {
+ passed = true;
+ e.printStackTrace();
+ } finally {
+ if ( rs1 != null ) {
+ try { rs1.close();} catch( Exception e1) {}
+ }
+ if ( stmt1 != null ) {
+ try { stmt1.close();} catch( Exception e1) {}
+ }
+ if ( conn1 != null ) {
+ try { conn1.close(); } catch( Exception e1) {}
+ }
+ if ( qSess != null ) {
+ try { qSess.close();} catch(Exception e1) {}
+ }
+
+ if ( qConn != null ) {
+ try { qConn.close(); } catch( Exception e1) {}
+ }
+ }
+
+ return passed;
}
public void ejbLoad() {}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.xml
index 2513dad..11082e1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/build.xml
@@ -23,29 +23,29 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
failonerror="true">
<classpath>
@@ -57,28 +57,28 @@
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-xa.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-xa.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbc-ra-xa.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbc-ra-xa.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index a854d24..998f3f6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
@@ -277,184 +277,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -504,151 +504,151 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 6590a84..6c5076b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ra-xa.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ra-xa.xml
index a1a70f6..ae9f8fe 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ra-xa.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/1.4/ra-xa.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.XAManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -128,7 +128,7 @@
<config-property-value>testdb</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbuser</config-property-value>
@@ -139,12 +139,12 @@
<config-property-value>dbuser</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbpassword</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -154,7 +154,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>-->
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
@@ -165,17 +165,17 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
@@ -186,7 +186,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientXADataSource40</config-property-value>
@@ -198,82 +198,82 @@
</config-property>
<!--
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
-->
<connectionfactory-interface>javax.sql.XADataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>XATransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/DataSource.java
index 30da1fe..295c3fb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re);
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re);
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re);
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re);
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,91 +114,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
@@ -206,6 +206,6 @@
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
- return false;
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAManagedConnectionFactory.java
index 422658d..4c26009 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAManagedConnectionFactory.java
@@ -32,36 +32,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class XAManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.XADataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -69,20 +69,20 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.XADataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
javax.sql.XAConnection xaConn = null;
try {
@@ -104,7 +104,7 @@
_logger.log(Level.FINE, "jdbc.exc_create_xa_conn", sqle);
throw new ResourceAllocationException("cannot allocate connection", sqle);
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(xaConn, null, pc, this);
mc.initializeConnectionType(ManagedConnection.ISXACONNECTION);
@@ -112,15 +112,15 @@
// validateAndSetIsolation(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -131,409 +131,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.XAManagedConnectionFactory) {
- com.sun.jdbcra.spi.XAManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.XAManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.XAManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -543,35 +543,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/create_pointbase.sql
index 4234115..ed6dbab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/create_pointbase.sql
@@ -1,20 +1,20 @@
-Drop table TXLEVELSWITCH;
-
-CREATE TABLE TXLEVELSWITCH (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
-INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
-
-Drop table TXLEVELSWITCH2;
-
-CREATE TABLE TXLEVELSWITCH2 (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
-INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
-
+Drop table TXLEVELSWITCH;
+
+CREATE TABLE TXLEVELSWITCH (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
+INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
+
+Drop table TXLEVELSWITCH2;
+
+CREATE TABLE TXLEVELSWITCH2 (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
+INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/drop_pointbase.sql
index 0c1242f..d11a115 100755
--- a/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/txlevelswitch/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table TXLEVELSWITCH;
-Drop table TXLEVELSWITCH2;
+Drop table TXLEVELSWITCH;
+Drop table TXLEVELSWITCH2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.properties
index 5ad0b12..05df128 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.properties
@@ -15,12 +15,12 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector"/>
<property name="app.type" value="application"/>
<property name="cciblackbox.path" value="../lib/cciblackbox-tx.jar"/>
-<property name="appname" value="${module}-embedded-cci"/>
+<property name="appname" value="${module}-embedded-cci"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="db.type" value="pointbase"/>
@@ -29,7 +29,7 @@
<property name="sun-cmp-dbschema" value="descriptor/sec_bankadmin_schema.dbschema"/>
<property name="application-client.xml" value="descriptor/application-client.xml"/>
<property name="sun-application-client.xml" value="descriptor/sun-application-client.xml"/>
-<property name="rarname" value="cciblackbox-tx"/>
+<property name="rarname" value="cciblackbox-tx"/> \u0020
<property name="jdbc.drivers" value="com.pointbase.jdbc.jdbcUniversalDriver"/>
<property name="contextroot" value="/cci-embedded/servlet"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.xml
index 29cac50..17bb5af 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/build.xml
@@ -93,7 +93,7 @@
</target>
<!--
- Custom target for compilation with local libraries for connector
+ Custom target for compilation with local libraries for connector
-->
<target name="compile-cci" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/client/CoffeeClient.java b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/client/CoffeeClient.java
index 05ca038..7714870 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/client/CoffeeClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/client/CoffeeClient.java
@@ -73,4 +73,4 @@
}
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/ejb/CoffeeBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/ejb/CoffeeBean.java
index 563ee3a..0709b15 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/ejb/CoffeeBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci-embedded/ejb/CoffeeBean.java
@@ -128,4 +128,4 @@
public void ejbPassivate() {
}
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/build.properties
index a2e3f64..d06b977 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/build.properties
@@ -15,12 +15,12 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector"/>
<property name="app.type" value="application"/>
<property name="cciblackbox.path" value="../lib/cciblackbox-tx.jar"/>
-<property name="appname" value="connector-cci"/>
+<property name="appname" value="connector-cci"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="db.type" value="pointbase"/>
@@ -29,7 +29,7 @@
<property name="sun-cmp-dbschema" value="descriptor/sec_bankadmin_schema.dbschema"/>
<property name="application-client.xml" value="descriptor/application-client.xml"/>
<property name="sun-application-client.xml" value="descriptor/sun-application-client.xml"/>
-<property name="rarname" value="cciblackbox-tx"/>
+<property name="rarname" value="cciblackbox-tx"/> \u0020
<property name="jdbc.drivers" value="com.pointbase.jdbc.jdbcUniversalDriver"/>
<property name="contextroot" value="/connector-cci/servlet"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/client/CoffeeClient.java b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/client/CoffeeClient.java
index 69d3bc5..e056cb0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/client/CoffeeClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/client/CoffeeClient.java
@@ -73,4 +73,4 @@
}
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/ejb/CoffeeBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/ejb/CoffeeBean.java
index 37882c4..c45dd70 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/ejb/CoffeeBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/ejb/CoffeeBean.java
@@ -128,4 +128,4 @@
public void ejbPassivate() {
}
-}
+}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/sql/cci-pb.sql b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/sql/cci-pb.sql
index 6cd6d4a..dfaf952 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/sql/cci-pb.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/SunRaXml/cci/sql/cci-pb.sql
@@ -16,5 +16,5 @@
LANGUAGE JAVA
MODIFIES SQL DATA
EXTERNAL NAME 'SampleExternalMethods.insertCoffee';
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.properties
index 6290a41..c23a95d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.properties
@@ -15,23 +15,23 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="administered-object-definition-embedra"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="Client"/>
+<property name="test.client"\u0020
+ value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.xml
index a9a1091..2ca3289 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/build.xml
@@ -37,10 +37,10 @@
</target>
<target name="info" depends="init-common">
- <echo message="build.classes.dir is ${build.classes.dir}"/>
- <echo message="s1astest.classpath is ${s1astest.classpath}"/>
+ <echo message="build.classes.dir is ${build.classes.dir}"/>
+ <echo message="s1astest.classpath is ${s1astest.classpath}"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="servlet"/>
@@ -48,7 +48,7 @@
</target>
<target name="build" depends="compile">
- <echo message="assemble.dir = ${assemble.dir}"/>
+ <echo message="assemble.dir = ${assemble.dir}"/>
<!--build and package .war first so it doesn't contain ejb bean !-->
<!--classes that have @Stateless/@Stateul !-->
<antcall target="webclient-war-common">
@@ -71,23 +71,23 @@
<param name="ejbjar.classes"
value="**/Hello**.class"/>
</antcall>
-
+
<ant dir="ra" target="all"/>
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
+ <mkdir dir="${build.classes.dir}/META-INF"/>
<ear earfile="${assemble.dir}/${appname}App.ear" appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/">
<include name="*.rar"/>
</fileset>
</ear>
-
+
</target>
<target name="setup" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/client/Client.java
index a684837..1287fcd 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/client/Client.java
@@ -58,7 +58,7 @@
} else {
stat.addStatus(tcName, stat.PASS);
}
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -79,7 +79,7 @@
InputStream is = c1.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));
String line = null;
-
+
while ((line = input.readLine()) != null)
System.out.println(line);
if (code != 200) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/application.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/application.xml
index aebd3a1..3d71621 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/application.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/application.xml
@@ -36,7 +36,7 @@
<module>
<connector>aod-ra.rar</connector>
</module>
-
+
<administered-object>
<description>global-scope resource defined in application DD</description>
<name>java:global/env/EAR_AdminObject</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/connector-resource.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/connector-resource.xml
index fa6df72..131ac02 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/connector-resource.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/connector-resource.xml
@@ -20,12 +20,12 @@
<connector-resource xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd>
- <description>global-scope resource defined in application DD</description>
- <name>java:global/env/Application_Level_ConnectionFactory</name>
- <class-name>jakarta.resource.cci.ConnectionFactory</class-name>
- <resource-adapter>#crd-ra</resource-adapter>
- <property>
- <name>transactionSupport</name>
- <value>LocalTransaction</value>
- </property>
+ <description>global-scope resource defined in application DD</description>
+ <name>java:global/env/Application_Level_ConnectionFactory</name>
+ <class-name>jakarta.resource.cci.ConnectionFactory</class-name>
+ <resource-adapter>#crd-ra</resource-adapter>
+ <property>
+ <name>transactionSupport</name>
+ <value>LocalTransaction</value>
+ </property>
</connector-resource>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/ejb-jar.xml
index e574cd1..30e5000 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/ejb-jar.xml
@@ -18,9 +18,9 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false"
- version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false"
+ version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>administered-object-definition-ejb</module-name>
<enterprise-beans>
@@ -29,7 +29,7 @@
<ejb-name>HelloStatefulEJB</ejb-name>
<business-local>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStateful</business-local>
<ejb-class>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStatefulEJB</ejb-class>
-
+
<administered-object>
<description>global-scope resource to be modified by DD</description>
<name>java:global/env/HelloStatefulEJB_ModByDD_AdminObject</name>
@@ -53,7 +53,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/HelloStatefulEJB_DD_AdminObject</name>
@@ -65,7 +65,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloStatefulEJB_DD_AdminObject</name>
@@ -77,7 +77,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/HelloStatefulEJB_DD_AdminObject</name>
@@ -89,7 +89,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</session>
<session>
<display-name>HelloEJB</display-name>
@@ -120,7 +120,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloEJB_DD_AdminObject</name>
@@ -156,8 +156,8 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</session>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/web.xml
index 4d4c93a..036e47f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/descriptor/web.xml
@@ -18,8 +18,8 @@
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
version="3.1"
metadata-complete="false">
@@ -70,7 +70,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in Web DD</description>
<name>java:module/env/Web_DD_AdminObject</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloEJB.java
index bda5961..3bb1833 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloEJB.java
@@ -33,35 +33,35 @@
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
@AdministeredObjectDefinition(
- description = "global-scope resource defined by @AdministeredObjectDefinition",
- name = "java:global/env/HelloEJB_Annotation_AdminObject",
+ description = "global-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:global/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="#aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
- description = "application-scope resource defined by @AdministeredObjectDefinition",
- name = "java:app/env/HelloEJB_Annotation_AdminObject",
+ description = "application-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:app/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="#aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
- description = "module-scope resource defined by @AdministeredObjectDefinition",
- name = "java:module/env/HelloEJB_Annotation_AdminObject",
+ description = "module-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:module/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="#aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
- description = "component-scope resource defined by @AdministeredObjectDefinition",
- name = "java:comp/env/HelloEJB_Annotation_AdminObject",
+ description = "component-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:comp/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="#aod-ra",
@@ -109,7 +109,7 @@
lookupAdminObject("java:app/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:module/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:comp/env/HelloEJB_DD_AdminObject", true);
-
+
System.out.println("In HelloEJB::hello()");
}
@@ -127,6 +127,6 @@
}
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloStatefulEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloStatefulEJB.java
index 45888fa..c9c410c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloStatefulEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ejb/HelloStatefulEJB.java
@@ -115,7 +115,7 @@
lookupAdminObject("java:app/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:module/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:comp/env/HelloEJB_DD_AdminObject", false);
-
+
System.out.println("StatefulEJB datasource-definitions Success");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/AbstractResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/AbstractResourceAdapter.java
index 07b9d78..0efcc5f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/AbstractResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/AbstractResourceAdapter.java
@@ -23,7 +23,7 @@
private String testName;
protected boolean debug = true;
-
+
public String getTestName() {
return testName;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/DeliveryWork.java
index 7e3635f..2be65f9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/DeliveryWork.java
@@ -22,7 +22,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -31,7 +31,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -39,7 +39,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -50,7 +50,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -73,11 +73,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -88,14 +88,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyConnectionFactory.java
index 9f24648..922e71d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyConnectionFactory.java
@@ -32,7 +32,7 @@
private ConnectionManager cm;
private MyManagedConnectionFactory mcf;
private Reference ref;
-
+
public MyConnectionFactory(MyManagedConnectionFactory mcf, ConnectionManager cm) {
super();
this.mcf = mcf;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java
index 05b3118..a561763 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java
@@ -44,7 +44,7 @@
private ConnectionManager cm;
private PrintWriter writer;
private TransactionSupportLevel transactionSupport = TransactionSupportLevel.LocalTransaction;;
-
+
public String getTestName() {
return testName;
}
@@ -69,7 +69,7 @@
}
@Override
- public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
@@ -80,7 +80,7 @@
}
@Override
- public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
+ public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyWork.java
index 614381e..44899a0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/MyWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -31,7 +31,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -49,7 +49,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -66,7 +66,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -81,14 +81,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleActivationSpec.java
index 512e5c6..4b5e5f1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleActivationSpec.java
@@ -25,12 +25,12 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Activation(
messageListeners = {connector.MyMessageListener.class}
)
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -47,7 +47,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -56,7 +56,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -65,7 +65,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -98,7 +98,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java
index 28d9e29..d1c26bb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -29,14 +29,14 @@
/**
* This is a sample resource adapter
- *
+ *
* @author Qingqing Ouyang
*/
@Connector(
/* moduleName="My Simple RAR", */
- displayName = "Simple Resource Adapter",
- vendorName = "Java Software",
- eisType = "Generic Type",
+ displayName = "Simple Resource Adapter",
+ vendorName = "Java Software",
+ eisType = "Generic Type",
version = "1.0Alpha",
transactionSupport=TransactionSupportLevel.XATransaction)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/TestWMWork.java
index ee0fae9..e248506 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/TestWMWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -37,8 +37,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -72,10 +72,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -87,7 +87,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/V3WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/V3WorkDispatcher.java
index 8adf3cc..4b43783 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/V3WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/V3WorkDispatcher.java
@@ -43,7 +43,7 @@
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
try {
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 1;
@@ -72,7 +72,7 @@
debug("V3WorkDispatcher calling DONE()");
done();
debug("V3WorkDispatcher finished calling DONE()");
-
+
}
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/WorkDispatcher.java
index 42249dc..a14443a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/WorkDispatcher.java
@@ -32,7 +32,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -43,11 +43,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -60,7 +60,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -82,26 +82,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -109,7 +109,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -125,7 +125,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -149,7 +149,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -194,7 +194,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -206,19 +206,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -245,7 +245,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -260,14 +260,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -290,13 +290,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/servlet/Servlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/servlet/Servlet.java
index f365c7f..ea3510b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/servlet/Servlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition-embedra/servlet/Servlet.java
@@ -64,7 +64,7 @@
resourceAdapter="#aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
description="module-scope resource defined by @AdministeredObjectDefinition",
name = "java:module/env/Servlet_AdminObject",
@@ -73,7 +73,7 @@
resourceAdapter="#aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
description="component-scope resource defined by @AdministeredObjectDefinition",
name = "java:comp/env/Servlet_AdminObject",
@@ -91,7 +91,7 @@
@EJB
private Hello helloStateless;
-
+
@EJB(beanName = "HelloStatefulEJB")
private HelloStateful helloStateful;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.properties
index 739d4f5..dcf02d8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.properties
@@ -15,23 +15,23 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="administered-object-definition"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="Client"/>
+<property name="test.client"\u0020
+ value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.xml
index 5b3becd..c5b7798 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/build.xml
@@ -37,25 +37,25 @@
</target>
<target name="info" depends="init-common">
- <echo message="build.classes.dir is ${build.classes.dir}"/>
- <echo message="s1astest.classpath is ${s1astest.classpath}"/>
+ <echo message="build.classes.dir is ${build.classes.dir}"/>
+ <echo message="s1astest.classpath is ${s1astest.classpath}"/>
</target>
-
+
<target name="compile-ut" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="ut" destdir="${build.classes.dir}"
- classpath="${env.APS_HOME}/lib/junit.jar:${s1astest.classpath}"
- debug="on"
+ classpath="${env.APS_HOME}/lib/junit.jar:${s1astest.classpath}"
+ debug="on"
includeantruntime="false"
- failonerror="true"/>
+ failonerror="true"/>
</target>
<target name="build-ut" depends="init-common">
<!-- build a special ear which only includes deployment descriptors-->
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${assemble.dir}/temp"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy file="${basedir}/descriptor/ut-application.xml" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/>
- <jar jarfile="${assemble.dir}/${appname}App-UT.ear">
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <copy file="${basedir}/descriptor/ut-application.xml" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/>
+ <jar jarfile="${assemble.dir}/${appname}App-UT.ear">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
</fileset>
@@ -71,7 +71,7 @@
<unjar src="${assemble.dir}/${appname}App-UT.ear" dest="${assemble.dir}/temp/${appname}App-UT"/>
</target>
-
+
<target name="run-ut" depends="compile-ut">
<junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="true">
<formatter type="plain" usefile="false"/>
@@ -95,7 +95,7 @@
</target>
<target name="build" depends="compile">
- <echo message="assemble.dir = ${assemble.dir}"/>
+ <echo message="assemble.dir = ${assemble.dir}"/>
<!--build and package .war first so it doesn't contain ejb bean !-->
<!--classes that have @Stateless/@Stateul !-->
<antcall target="webclient-war-common">
@@ -118,11 +118,11 @@
<param name="ejbjar.classes"
value="**/Hello**.class"/>
</antcall>
-
+
<antcall target="ear-common"/>
<antcall target="build-ut"/>
-
+
<ant dir="ra" target="all"/>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/client/Client.java
index d7e3009..92f60eb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/client/Client.java
@@ -58,7 +58,7 @@
} else {
stat.addStatus(tcName, stat.PASS);
}
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -79,7 +79,7 @@
InputStream is = c1.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));
String line = null;
-
+
while ((line = input.readLine()) != null)
System.out.println(line);
if (code != 200) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/connector-resource.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/connector-resource.xml
index 5c544c1..a3b9457 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/connector-resource.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/connector-resource.xml
@@ -20,12 +20,12 @@
<connector-resource xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd>
- <description>global-scope resource defined in application DD</description>
- <name>java:global/env/Application_Level_ConnectionFactory</name>
- <class-name>jakarta.resource.cci.ConnectionFactory</class-name>
- <resource-adapter>crd-ra</resource-adapter>
- <property>
- <name>transactionSupport</name>
- <value>LocalTransaction</value>
- </property>
+ <description>global-scope resource defined in application DD</description>
+ <name>java:global/env/Application_Level_ConnectionFactory</name>
+ <class-name>jakarta.resource.cci.ConnectionFactory</class-name>
+ <resource-adapter>crd-ra</resource-adapter>
+ <property>
+ <name>transactionSupport</name>
+ <value>LocalTransaction</value>
+ </property>
</connector-resource>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ejb-jar.xml
index 8b2b5cf..ad9cf2f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ejb-jar.xml
@@ -18,9 +18,9 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false"
- version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false"
+ version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>administered-object-definition-ejb</module-name>
<enterprise-beans>
@@ -29,7 +29,7 @@
<ejb-name>HelloStatefulEJB</ejb-name>
<business-local>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStateful</business-local>
<ejb-class>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStatefulEJB</ejb-class>
-
+
<administered-object>
<description>global-scope resource to be modified by DD</description>
<name>java:global/env/HelloStatefulEJB_ModByDD_AdminObject</name>
@@ -53,7 +53,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/HelloStatefulEJB_DD_AdminObject</name>
@@ -65,7 +65,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloStatefulEJB_DD_AdminObject</name>
@@ -77,7 +77,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/HelloStatefulEJB_DD_AdminObject</name>
@@ -89,7 +89,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</session>
<session>
<display-name>HelloEJB</display-name>
@@ -120,7 +120,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloEJB_DD_AdminObject</name>
@@ -156,8 +156,8 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</session>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-application.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-application.xml
index dd3fbec..63a9a8b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-application.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-application.xml
@@ -20,7 +20,7 @@
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="7"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd">
<display-name>administered-object-definitionApp</display-name>
-
+
<module>
<java>administered-object-definition-client.jar</java>
</module>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-entity-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-entity-ejb-jar.xml
index 66aa7ba..7ab2a93 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-entity-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-entity-ejb-jar.xml
@@ -18,11 +18,11 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>administered-object-definition-ejb</module-name>
-
+
<enterprise-beans>
<entity>
<ejb-name>HelloEntity</ejb-name>
@@ -41,7 +41,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/Entity_AdminObject</name>
@@ -53,7 +53,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/Entity_AdminObject</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-interceptor-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-interceptor-ejb-jar.xml
index 248b861..c8e9c91 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-interceptor-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-interceptor-ejb-jar.xml
@@ -18,8 +18,8 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>administered-object-definition-ejb</module-name>
<interceptors>
@@ -37,7 +37,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/Interceptor_AdminObject</name>
@@ -49,7 +49,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/Interceptor_AdminObject</name>
@@ -63,5 +63,5 @@
</administered-object>
</interceptor>
</interceptors>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-mdb-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-mdb-ejb-jar.xml
index efd89f4..74ecad8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-mdb-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-mdb-ejb-jar.xml
@@ -18,8 +18,8 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>administered-object-definition-ejb</module-name>
<enterprise-beans>
@@ -40,7 +40,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/MDB_AdminObject</name>
@@ -52,7 +52,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/MDB_AdminObject</name>
@@ -64,8 +64,8 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</message-driven>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-session-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-session-ejb-jar.xml
index c722295..37e003a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-session-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-session-ejb-jar.xml
@@ -18,8 +18,8 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>administered-object-definition-ejb</module-name>
<enterprise-beans>
@@ -28,7 +28,7 @@
<ejb-name>HelloStatefulEJB</ejb-name>
<business-local>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStateful</business-local>
<ejb-class>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStatefulEJB</ejb-class>
-
+
<administered-object>
<description>global-scope resource defined in EJB DD</description>
<name>java:global/env/StatefulEJB_AdminObject</name>
@@ -40,7 +40,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/StatefulEJB_AdminObject</name>
@@ -52,7 +52,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/StatefulEJB_AdminObject</name>
@@ -64,7 +64,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</session>
<session>
<display-name>HelloEJB</display-name>
@@ -83,7 +83,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/HelloEJB_AdminObject</name>
@@ -95,7 +95,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/HelloEJB_AdminObject</name>
@@ -107,8 +107,8 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</session>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-web.xml
index 7fe317e..6643601 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/ut-web.xml
@@ -18,8 +18,8 @@
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
version="3.1">
<display-name>administered-object-definition</display-name>
@@ -56,7 +56,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in Web DD</description>
<name>java:module/env/AdminObject</name>
@@ -68,6 +68,6 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
</web-app>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/web.xml
index 9476e34..e02edb7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/descriptor/web.xml
@@ -18,8 +18,8 @@
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
version="3.1"
metadata-complete="false">
@@ -70,7 +70,7 @@
<value>connector.MyAdminObject</value>
</property>
</administered-object>
-
+
<administered-object>
<description>module-scope resource defined in Web DD</description>
<name>java:module/env/Web_DD_AdminObject</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloEJB.java
index f243c54..fccf90c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloEJB.java
@@ -33,35 +33,35 @@
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
@AdministeredObjectDefinition(
- description = "global-scope resource defined by @AdministeredObjectDefinition",
- name = "java:global/env/HelloEJB_Annotation_AdminObject",
+ description = "global-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:global/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
- description = "application-scope resource defined by @AdministeredObjectDefinition",
- name = "java:app/env/HelloEJB_Annotation_AdminObject",
+ description = "application-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:app/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
- description = "module-scope resource defined by @AdministeredObjectDefinition",
- name = "java:module/env/HelloEJB_Annotation_AdminObject",
+ description = "module-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:module/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
- description = "component-scope resource defined by @AdministeredObjectDefinition",
- name = "java:comp/env/HelloEJB_Annotation_AdminObject",
+ description = "component-scope resource defined by @AdministeredObjectDefinition",
+ name = "java:comp/env/HelloEJB_Annotation_AdminObject",
interfaceName = "jakarta.jms.Destination",
className = "connector.MyAdminObject",
resourceAdapter="aod-ra",
@@ -109,7 +109,7 @@
lookupAdminObject("java:app/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:module/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:comp/env/HelloEJB_DD_AdminObject", true);
-
+
System.out.println("In HelloEJB::hello()");
}
@@ -127,6 +127,6 @@
}
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloStatefulEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloStatefulEJB.java
index f310b45..1cbcee2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloStatefulEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ejb/HelloStatefulEJB.java
@@ -115,7 +115,7 @@
lookupAdminObject("java:app/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:module/env/HelloEJB_DD_AdminObject", true);
lookupAdminObject("java:comp/env/HelloEJB_DD_AdminObject", false);
-
+
System.out.println("StatefulEJB datasource-definitions Success");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/AbstractResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/AbstractResourceAdapter.java
index 07b9d78..0efcc5f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/AbstractResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/AbstractResourceAdapter.java
@@ -23,7 +23,7 @@
private String testName;
protected boolean debug = true;
-
+
public String getTestName() {
return testName;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/DeliveryWork.java
index 7e3635f..2be65f9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/DeliveryWork.java
@@ -22,7 +22,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -31,7 +31,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -39,7 +39,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -50,7 +50,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -73,11 +73,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -88,14 +88,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyConnectionFactory.java
index 9f24648..922e71d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyConnectionFactory.java
@@ -32,7 +32,7 @@
private ConnectionManager cm;
private MyManagedConnectionFactory mcf;
private Reference ref;
-
+
public MyConnectionFactory(MyManagedConnectionFactory mcf, ConnectionManager cm) {
super();
this.mcf = mcf;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyManagedConnectionFactory.java
index 05b3118..a561763 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyManagedConnectionFactory.java
@@ -44,7 +44,7 @@
private ConnectionManager cm;
private PrintWriter writer;
private TransactionSupportLevel transactionSupport = TransactionSupportLevel.LocalTransaction;;
-
+
public String getTestName() {
return testName;
}
@@ -69,7 +69,7 @@
}
@Override
- public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
@@ -80,7 +80,7 @@
}
@Override
- public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
+ public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyWork.java
index 614381e..44899a0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/MyWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -31,7 +31,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -49,7 +49,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -66,7 +66,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -81,14 +81,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleActivationSpec.java
index 512e5c6..4b5e5f1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleActivationSpec.java
@@ -25,12 +25,12 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Activation(
messageListeners = {connector.MyMessageListener.class}
)
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -47,7 +47,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -56,7 +56,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -65,7 +65,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -98,7 +98,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleResourceAdapterImpl.java
index 28d9e29..d1c26bb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -29,14 +29,14 @@
/**
* This is a sample resource adapter
- *
+ *
* @author Qingqing Ouyang
*/
@Connector(
/* moduleName="My Simple RAR", */
- displayName = "Simple Resource Adapter",
- vendorName = "Java Software",
- eisType = "Generic Type",
+ displayName = "Simple Resource Adapter",
+ vendorName = "Java Software",
+ eisType = "Generic Type",
version = "1.0Alpha",
transactionSupport=TransactionSupportLevel.XATransaction)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/TestWMWork.java
index ee0fae9..e248506 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/TestWMWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -37,8 +37,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -72,10 +72,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -87,7 +87,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/V3WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/V3WorkDispatcher.java
index 8adf3cc..4b43783 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/V3WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/V3WorkDispatcher.java
@@ -43,7 +43,7 @@
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
try {
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 1;
@@ -72,7 +72,7 @@
debug("V3WorkDispatcher calling DONE()");
done();
debug("V3WorkDispatcher finished calling DONE()");
-
+
}
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/WorkDispatcher.java
index 42249dc..a14443a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/WorkDispatcher.java
@@ -32,7 +32,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -43,11 +43,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -60,7 +60,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -82,26 +82,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -109,7 +109,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -125,7 +125,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -149,7 +149,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -194,7 +194,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -206,19 +206,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -245,7 +245,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -260,14 +260,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -290,13 +290,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/servlet/Servlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/servlet/Servlet.java
index 1b1efa1..5d353cd 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/servlet/Servlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/servlet/Servlet.java
@@ -64,7 +64,7 @@
resourceAdapter="aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
description="module-scope resource defined by @AdministeredObjectDefinition",
name = "java:module/env/Servlet_AdminObject",
@@ -73,7 +73,7 @@
resourceAdapter="aod-ra",
properties = {"org.glassfish.admin-object.resType=connector.MyAdminObject"}
),
-
+
@AdministeredObjectDefinition(
description="component-scope resource defined by @AdministeredObjectDefinition",
name = "java:comp/env/Servlet_AdminObject",
@@ -91,7 +91,7 @@
@EJB
private Hello helloStateless;
-
+
@EJB(beanName = "HelloStatefulEJB")
private HelloStateful helloStateful;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/ArchiveTest.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/ArchiveTest.java
index 7105b2f..a2138a8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/ArchiveTest.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/ArchiveTest.java
@@ -70,7 +70,7 @@
ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());
reader.setClassLoader(classLoader);
-
+
Application applicationDesc = reader.open(archive);
// System.out.println("--------Administered object in application.xml----------");
// for( AdministeredObjectDefinitionDescriptor aodd: applicationDesc.getAdministeredObjectDefinitionDescriptors()){
@@ -78,8 +78,8 @@
// System.out.println(aodd.getName());
// System.out.println("");
// }
-
- Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
+
+ Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
new HashMap<String,AdministeredObjectDefinitionDescriptor>();
AdministeredObjectDefinitionDescriptor desc;
@@ -129,7 +129,7 @@
reader.setAnnotationProcessingRequested(true);
reader.setClassLoader(classLoader);
assertTrue("Archivist should handle annotations.", reader.isAnnotationProcessingRequested());
-
+
WebBundleDescriptor webDesc = reader.open(archive);
// for(AdministeredObjectDefinitionDescriptor aodd : webDesc.getAdministeredObjectDefinitionDescriptors()){
// System.out.println("Description = "+aodd.getDescription());
@@ -138,7 +138,7 @@
// System.out.println();
// }
- Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
+ Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
new HashMap<String,AdministeredObjectDefinitionDescriptor>();
AdministeredObjectDefinitionDescriptor desc;
@@ -159,7 +159,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("application-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:app/env/Servlet_AdminObject");
@@ -168,7 +168,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:module/env/Servlet_AdminObject");
@@ -177,7 +177,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("component-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:comp/env/Servlet_AdminObject");
@@ -186,7 +186,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("global-scope resource defined in Web DD");
desc.setName("java:global/env/Web_DD_AdminObject");
@@ -195,7 +195,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("application-scope resource defined in Web DD");
desc.setName("java:app/env/Web_DD_AdminObject");
@@ -204,7 +204,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined in Web DD");
desc.setName("java:module/env/Web_DD_AdminObject");
@@ -235,7 +235,7 @@
ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());
-
+
EjbArchivist reader = (EjbArchivist) TestUtil.getByType(EjbArchivist.class);
reader.setClassLoader(classLoader);
reader.setAnnotationProcessingRequested(true);
@@ -251,8 +251,8 @@
// System.out.println("------------------");
// }
}
-
- Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
+
+ Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
new HashMap<String,AdministeredObjectDefinitionDescriptor>();
AdministeredObjectDefinitionDescriptor desc;
@@ -349,7 +349,7 @@
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
}
-
+
// administered-object in annotation for stateful EJB
{
desc = new AdministeredObjectDefinitionDescriptor();
@@ -360,7 +360,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("application-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:app/env/HelloStatefulEJB_Annotation_AdminObject");
@@ -399,7 +399,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("application-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:app/env/HelloEJB_Annotation_AdminObject");
@@ -408,7 +408,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:module/env/HelloEJB_Annotation_AdminObject");
@@ -417,7 +417,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("component-scope resource defined by @AdministeredObjectDefinition");
desc.setName("java:comp/env/HelloEJB_Annotation_AdminObject");
@@ -427,8 +427,8 @@
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
}
-
+
TestUtil.compareAODD(expectedAODDs, acturalAODDs);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/DDTest.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/DDTest.java
index f411c9e..8290391 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/DDTest.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/DDTest.java
@@ -46,23 +46,23 @@
protected void tearDown() throws Exception {
super.tearDown();
}
-
+
public void testApplicationDD() throws Exception{
-
+
String tcName = "administered-object-definition-application-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-application.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The application.xml not found: "+ddFile,ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
ApplicationDeploymentDescriptorFile ddReader = new ApplicationDeploymentDescriptorFile();
Application application = (Application) ddReader.read( ddIS);
-
+
Set<ResourceDescriptor> actualAODDs = application.getResourceDescriptors(JavaEEResourceType.AODD);
- Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
+ Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs =
new HashMap<String,AdministeredObjectDefinitionDescriptor>();
AdministeredObjectDefinitionDescriptor desc;
@@ -74,7 +74,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setName("java:app/env/AdminObject");
desc.setInterfaceName("jakarta.jms.Destination");
@@ -86,7 +86,7 @@
TestUtil.compareAODD(expectedAODDs, actualAODDs);
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -100,18 +100,18 @@
}
public void testSessionEJBDD() throws Exception{
-
+
String tcName = "administered-object-definition-Session-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-session-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-session-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
-
+
for(EjbDescriptor ejbDescriptor : ejbBundle.getEjbs()){
ejbDescriptor.getResourceDescriptors(JavaEEResourceType.AODD);
if(ejbDescriptor.getName().equals("HelloStatefulEJB")){
@@ -122,9 +122,9 @@
fail("Unknown EJB descriptor: "+ejbDescriptor.getName());
}
}
-
+
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -136,7 +136,7 @@
return;
}
-
+
private void testStatefulSessionEJBDD(EjbDescriptor ejb) throws Exception{
AdministeredObjectDefinitionDescriptor desc;
Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs = new HashMap<String,AdministeredObjectDefinitionDescriptor>();
@@ -149,7 +149,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/StatefulEJB_AdminObject");
@@ -169,9 +169,9 @@
expectedAODDs.put(desc.getName(), desc);
TestUtil.compareAODD(expectedAODDs, ejb.getResourceDescriptors(JavaEEResourceType.AODD));
-
+
}
-
+
private void testStatelessSessionEJBDD(EjbDescriptor ejb) throws Exception{
AdministeredObjectDefinitionDescriptor desc;
Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs = new HashMap<String,AdministeredObjectDefinitionDescriptor>();
@@ -184,7 +184,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/HelloEJB_AdminObject");
@@ -204,18 +204,18 @@
expectedAODDs.put(desc.getName(), desc);
TestUtil.compareAODD(expectedAODDs, ejb.getResourceDescriptors(JavaEEResourceType.AODD));
-
+
}
-
+
public void testEntityEJBDD() throws Exception{
-
+
String tcName = "administered-object-definition-Entity-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-entity-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-entity-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
@@ -232,7 +232,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/Entity_AdminObject");
@@ -255,7 +255,7 @@
}
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -269,14 +269,14 @@
}
public void testMDBEJBDD() throws Exception{
-
+
String tcName = "administered-object-definition-MDB-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-mdb-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-mdb-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
@@ -293,7 +293,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/MDB_AdminObject");
@@ -316,7 +316,7 @@
}
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -330,14 +330,14 @@
}
public void testInterceptorEJBDD() throws Exception{
-
+
String tcName = "administered-object-definition-Interceptor-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-interceptor-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-interceptor-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
@@ -354,7 +354,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/Interceptor_AdminObject");
@@ -377,7 +377,7 @@
}
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -391,18 +391,18 @@
}
public void testWebDD() throws Exception{
-
+
String tcName = "administered-object-definition-Web-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-web.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-web.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
WebDeploymentDescriptorFile ddReader = new WebDeploymentDescriptorFile();
WebBundleDescriptor webBundle = ddReader.read( ddIS);
-
+
AdministeredObjectDefinitionDescriptor desc;
Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs = new HashMap<String,AdministeredObjectDefinitionDescriptor>();
@@ -414,7 +414,7 @@
desc.setResourceAdapter("aod-ra");
desc.addProperty("org.glassfish.admin-object.resType", "connector.MyAdminObject");
expectedAODDs.put(desc.getName(), desc);
-
+
desc = new AdministeredObjectDefinitionDescriptor();
desc.setDescription("application-scope resource defined in Web DD");
desc.setName("java:app/env/AdminObject");
@@ -436,7 +436,7 @@
TestUtil.compareAODD(expectedAODDs, webBundle.getResourceDescriptors(JavaEEResourceType.AODD));
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/TestUtil.java b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/TestUtil.java
index 5b20f58..1f5ace4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/TestUtil.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/administered-object-definition/ut/TestUtil.java
@@ -28,39 +28,39 @@
public class TestUtil {
- public static void compareAODD(Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs,
+ public static void compareAODD(Map<String,AdministeredObjectDefinitionDescriptor> expectedAODDs,
Set<ResourceDescriptor> actualAODDs) throws Exception{
-
+
for(ResourceDescriptor descriptor : actualAODDs){
AdministeredObjectDefinitionDescriptor actualDesc = (AdministeredObjectDefinitionDescriptor)descriptor;
assertNotNull("the name of administered object cannot be null.", actualDesc.getName());
-
+
AdministeredObjectDefinitionDescriptor expectedDesc = expectedAODDs.get(actualDesc.getName());
assertNotNull("The AOD of the name ["+actualDesc.getName()+"] is not expected.", expectedDesc);
-
+
assertEquals("Fail to verify interface-type of the AODD:"+actualDesc.getName(),
expectedDesc.getInterfaceName(), actualDesc.getInterfaceName());
assertEquals("Fail to verify class-name of the AODD:"+actualDesc.getName(),
expectedDesc.getClassName(), actualDesc.getClassName());
-
+
assertEquals("Fail to verify description of the AODD:"+actualDesc.getName(),
expectedDesc.getDescription(), actualDesc.getDescription());
-
+
assertEquals("Fail to verify resourceAdapter of the AODD:"+actualDesc.getName(),
expectedDesc.getResourceAdapter(), actualDesc.getResourceAdapter());
-
+
Properties expectedProps = expectedDesc.getProperties();
Properties actualProps = actualDesc.getProperties();
-
+
for(Object name : actualProps.keySet()){
assertEquals("Fail to verify property ("+name+") of the AODD:"+actualDesc.getName(),
expectedProps.get(name), actualProps.get(name));
}
-
+
assertEquals("Fail to verify size of properties of the AODD:"+actualDesc.getName(),
expectedProps.size(), actualProps.size());
-
+
expectedAODDs.remove(actualDesc.getName());
}
if(expectedAODDs.size()>0){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/ejb-jar.xml
index 38af18c..2905932 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/sun-ejb-jar.xml
index 1146a5a..0a7e0da 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/beans/MessageCheckerEJB.java
index 75ebde0..a03450d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -58,11 +58,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -70,7 +70,7 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
@@ -79,7 +79,7 @@
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -105,7 +105,7 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- {
+ {
//test whether the appropriate admin-object-resources are created
ic.lookup("eis/aor_1");
ic.lookup("eis/aor_1_2");
@@ -114,10 +114,10 @@
ic.lookup("eis/aor_2_4");
ic.lookup("eis/aor_3_5");
}
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ");
- Controls.initialize();
- System.out.println("CALLED INITILIZE " + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE " + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -152,7 +152,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -162,7 +162,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/client/Client.java
index 880664f..389d594 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.5 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("annotation-connector16-mixed-modeID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/mdb/MyMessageBean.java
index e4a5735..3facbfe 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,62 +103,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -171,7 +171,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -180,9 +180,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -198,9 +198,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -213,9 +213,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/servlet/SimpleServlet.java
index 243baf4..ee71629 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/app/src/servlet/SimpleServlet.java
@@ -44,17 +44,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.5 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
while (!done(out)) {
@@ -70,18 +70,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.5 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.5 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.properties
index fe77353..5a5f0a3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/annotation-connector16-mixed-mode/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.xml
index 3080d9c..ebed811 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/build.xml
@@ -81,15 +81,15 @@
<!--
<target name="runtest" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="connector1.5 (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="connector1.5 (ear based)"/>
+ </antcall>
</target>
-->
<!--
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="annotation-connector16-mixed-mode" />
+ <param name="appname" value="annotation-connector16-mixed-mode" />
</antcall>
</target>
-->
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/META-INF/ra.xml
index 11a0e04..f8969b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/build.xml
index ff9b736..a0c3f91 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyActivationSpec_1.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyActivationSpec_1.java
index 0a5d655..c9e5f27 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyActivationSpec_1.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyActivationSpec_1.java
@@ -25,7 +25,7 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Activation(
messageListeners = {connector.MyMessageListener_1.class, connector.MyMessageListener.class}
@@ -38,7 +38,7 @@
private String testProp;
private Integer testIntegerProp;
private ResourceAdapter resourceadapter;
-
+
public String getDestinationName () {
return this.destinationName;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject.java
index 8cf39a5..7423569 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject.java
@@ -52,13 +52,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_2.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_2.java
index 79e293b..439e619 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_2.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_2.java
@@ -17,7 +17,7 @@
package connector;
public interface MyAdminObject_Interface_2 {
-
+
public void setExpectedResults (Integer value);
public Integer getExpectedResults ();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_3.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_3.java
index 496d6dd..0d7c56f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_3.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/MyAdminObject_Interface_3.java
@@ -17,7 +17,7 @@
package connector;
public interface MyAdminObject_Interface_3 {
-
+
public void setExpectedResults (Integer value);
public Integer getExpectedResults ();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleActivationSpec.java
index 4a963dc..189269b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleActivationSpec.java
@@ -26,9 +26,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -66,7 +66,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -75,7 +75,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -99,7 +99,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleRA.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleRA.java
index 0fbd4e2..c20b739 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleRA.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleRA.java
@@ -39,7 +39,7 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Connector(
displayName = "Simple RA",
@@ -77,12 +77,12 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
debug("005. Simple RA start...");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl.java
index 4792432..fffff94 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -35,7 +35,7 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Connector(
/*moduleName="test ra",*/
@@ -74,12 +74,12 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
debug("005. Simple RA start...");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_1.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_1.java
index d4b85b8..dcc5b09 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_1.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_1.java
@@ -40,7 +40,7 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Connector(
displayName = "Simple Resource Adapter",
@@ -48,7 +48,7 @@
eisType = "Generic Type",
version = "1.0Alpha"
)
-public class SimpleResourceAdapterImpl_1
+public class SimpleResourceAdapterImpl_1
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -84,11 +84,11 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
- throw new IllegalStateException("This resource-adapter should not have been initialized");
+ throw new IllegalStateException("This resource-adapter should not have been initialized");
}
-
+
public String getTestName() {
return testName;
}
@@ -120,7 +120,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_2.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_2.java
index da5ae19..a44f1c5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_2.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/SimpleResourceAdapterImpl_2.java
@@ -40,7 +40,7 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Connector(
displayName = "Simple Resource Adapter",
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/WorkDispatcher.java
index 64b71c4..762e03e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -246,7 +246,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -261,14 +261,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -291,13 +291,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector-mixedmode/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/ejb-jar.xml
index 38af18c..2905932 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/sun-ejb-jar.xml
index 1146a5a..0a7e0da 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/beans/MessageCheckerEJB.java
index e22fa10..4076e49 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -70,11 +70,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -93,22 +93,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -134,10 +134,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -172,7 +172,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -183,7 +183,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/client/Client.java
index b85efda..7443032 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.5 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("annotation-connector15ID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/mdb/MyMessageBean.java
index 47d776f..c7b99e8 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/mdb/MyMessageBean.java
@@ -31,41 +31,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -76,7 +76,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -92,10 +92,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -105,62 +105,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -171,7 +171,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -180,9 +180,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -198,9 +198,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -213,9 +213,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/servlet/SimpleServlet.java
index 9e0d61e..aa2c54a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/app/src/servlet/SimpleServlet.java
@@ -44,17 +44,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.5 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
while (!done(out)) {
@@ -70,18 +70,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.5 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.5 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.properties
index 1fe136a..022491a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/annotation-connector15/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.xml
index c82c1b4..2c7a7c6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/build.xml
@@ -80,15 +80,15 @@
<!--
<target name="runtest" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="connector1.5 (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="connector1.5 (ear based)"/>
+ </antcall>
</target>
-->
<!--
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="annotation-connector15" />
+ <param name="appname" value="annotation-connector15" />
</antcall>
</target>
-->
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/build.xml
index ff8bcc2..8496f60 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/AbstractResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/AbstractResourceAdapter.java
index c4892b1..1d1f6e7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/AbstractResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/AbstractResourceAdapter.java
@@ -23,7 +23,7 @@
private String testName;
protected boolean debug = true;
-
+
public String getTestName() {
return testName;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyAdminObject.java
index 2e4cfa8..20863a9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyAdminObject.java
@@ -39,13 +39,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+getResetControl());
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+getResetControl());
if (getResetControl().equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleActivationSpec.java
index 512e5c6..4b5e5f1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleActivationSpec.java
@@ -25,12 +25,12 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Activation(
messageListeners = {connector.MyMessageListener.class}
)
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -47,7 +47,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -56,7 +56,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -65,7 +65,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -98,7 +98,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
index 19a5e4d..1334b7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -35,7 +35,7 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Connector(
/*moduleName="My Simple RAR",*/
@@ -44,7 +44,7 @@
eisType = "Generic Type",
version = "1.0Alpha"
)
-public class SimpleResourceAdapterImpl extends AbstractResourceAdapter
+public class SimpleResourceAdapterImpl extends AbstractResourceAdapter
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,12 +68,12 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
debug("005. Simple RA start...");
}
@@ -108,15 +108,15 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
- public XAResource[] getXAResources(ActivationSpec[] specs)
+
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/TestWMWork.java
index bb05534..de93bc1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/V3WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/V3WorkDispatcher.java
index 8adf3cc..4b43783 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/V3WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/V3WorkDispatcher.java
@@ -43,7 +43,7 @@
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
try {
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 1;
@@ -72,7 +72,7 @@
debug("V3WorkDispatcher calling DONE()");
done();
debug("V3WorkDispatcher finished calling DONE()");
-
+
}
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/WorkDispatcher.java
index 64b71c4..762e03e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -246,7 +246,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -261,14 +261,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -291,13 +291,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-connector1.5/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.properties
index a404319..2486a2d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
<property name="appname" value="${module}-annotation-subclassing"/>
@@ -24,7 +24,7 @@
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="annotation-subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.xml
index 9d3ee37..fa4cafe 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/build.xml
@@ -32,7 +32,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<!--
<target name="all" depends="build,setup,deploy-war, run-war, undeploy-war, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -41,15 +41,15 @@
<target name="all" depends="build, disable-resource-validation, deploy-ear, setup, run-ear, unsetup, undeploy-ear, enable-resource-validation"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
@@ -57,7 +57,7 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
@@ -65,36 +65,36 @@
<antcall target="create-pool"/>
<antcall target="create-resource"/>
<antcall target="create-admin-object"/>
-
+
</target>
<target name="create-pool">
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="${appname}App#jdbcra"/>
<param name="connection.defname" value="javax.sql.DataSource"/>
- <param name="extra-params" value="--matchconnections=false"/>
+ <param name="extra-params" value="--matchconnections=false"/>
<param name="connector.conpool.name" value="embedded-ra-pool"/>
</antcall>
<antcall target="set-oracle-props">
- <param name="pool.type" value="connector"/>
- <param name="conpool.name" value="embedded-ra-pool"/>
- </antcall>
+ <param name="pool.type" value="connector"/>
+ <param name="conpool.name" value="embedded-ra-pool"/>
+ </antcall>
</target>
- <target name="disable-resource-validation">
- <antcall target="create-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="disable-resource-validation">
+ <antcall target="create-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
- <target name="enable-resource-validation">
- <antcall target="delete-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="enable-resource-validation">
+ <antcall target="delete-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
- <target name="create-resource">
+ <target name="create-resource">
<antcall target="create-connector-resource-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
<param name="connector.jndi.name" value="jdbc/ejb-annotation-subclassing"/>
@@ -105,18 +105,18 @@
<target name="create-admin-object" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-annotation-subclassing:SchemaName=DBUSER:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
-
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -124,16 +124,16 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
<target name="unsetup">
@@ -145,7 +145,7 @@
<antcall target="delete-pool"/>
<antcall target="delete-admin-object"/>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -155,7 +155,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-annotation-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -171,9 +171,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -182,37 +182,37 @@
</target>
<target name="build" depends="compile, build-ra">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
- <antcall target="create-password-alias">
+ <antcall target="create-password-alias">
<param name="password.alias.name" value="ALIAS_TEST_PROPERTY"/>
<param name="password.alias.file" value="aliaspassword.txt"/>
</antcall>
@@ -223,30 +223,30 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="annotation-embeddedweb (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="annotation-embeddedweb (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="annotation-embeddedweb (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="annotation-embeddedweb (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common"/>
<antcall target="delete-password-alias">
<param name="password.alias.name" value="ALIAS_TEST_PROPERTY"/>
</antcall>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/descriptor/sun-ejb-jar.xml
index 88f1c02..4e0104e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-annotation-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-annotation-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/Customer.java
index 8a9b105..160eab9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/Customer.java
@@ -44,4 +44,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerChecking.java
index 61de291..b341c34 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerChecking.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerEJB.java
index f0dbad2..929d15c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -147,7 +147,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -214,12 +214,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavings.java
index 338c921..883e04a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavings.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.xml
index 5c65fd5..e950002 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index 70029f1..e966f98 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,169 +50,169 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
System.out.println("V3-TEST : " + dataSourceObject);
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
System.out.println("V3-TEST : " + dataSourceObject);
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index a956d97..11ad746 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/*
@@ -279,184 +279,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -506,162 +506,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 01dcff0..bb12b48 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -24,8 +24,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
@Connector(
description = "Resource adapter wrapping Datasource implementation of driver",
@@ -49,52 +49,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 39a5325..d126fab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -28,7 +28,7 @@
<outbound-resourceadapter>
<connection-definition>
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>User</config-property-name>
@@ -45,7 +45,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbpassword</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -55,7 +55,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientDataSource40</config-property-value>
@@ -72,7 +72,7 @@
<connection-interface>java.sql.Connection</connection-interface>
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index b4a6316..c8aaf77 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,8 +31,8 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
@ConnectionDefinition(
@@ -42,31 +42,31 @@
connectionFactoryImpl = com.sun.jdbcra.spi.DataSource.class
)
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -74,7 +74,7 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
@@ -84,36 +84,36 @@
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
sqle.printStackTrace();
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
} catch(Exception e){
System.out.println("V3-TEST : unable to get connection");
- e.printStackTrace();
+ e.printStackTrace();
}
System.out.println("V3-TEST : got connection");
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
/*
@@ -123,15 +123,15 @@
System.out.println("V3-TEST : returning connection");
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -142,28 +142,28 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
@@ -178,12 +178,12 @@
}
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
@ConfigProperty(
defaultValue = "localhost",
@@ -192,12 +192,12 @@
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
@@ -219,32 +219,32 @@
public String getAliasTest () {
return aliasTest;
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
@ConfigProperty(
defaultValue = "1527",
@@ -253,42 +253,42 @@
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
@ConfigProperty(
defaultValue="testdb",
@@ -297,42 +297,42 @@
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
@ConfigProperty(
type=java.lang.String.class
@@ -340,203 +340,203 @@
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
@ConfigProperty(
defaultValue = "#",
@@ -545,52 +545,52 @@
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -600,35 +600,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
index d90085d..51f1773 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,58 +51,58 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
re.printStackTrace();
- throw new SQLException (re.getMessage());
- }
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -115,91 +115,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index f89be57..fc3a957 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -84,11 +84,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -97,10 +97,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -109,93 +109,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/servlet/SimpleBankServlet.java
index bc7b55d..9892ff6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/servlet/SimpleBankServlet.java
@@ -17,16 +17,16 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
-import jakarta.ejb.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -42,14 +42,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -65,14 +65,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -89,7 +89,7 @@
customerSavings = customerSavingsLocalHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -102,7 +102,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -114,7 +114,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -126,12 +126,12 @@
customerSavingsLocalHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -141,7 +141,7 @@
customerSavings = (CustomerSavings)customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -150,7 +150,7 @@
customerChecking = (CustomerChecking)customerCheckingLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -210,9 +210,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/annotation-embeddedweb/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/META-INF/glassfish-resources.xml
index 21be062..b741fed 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/META-INF/glassfish-resources.xml
@@ -72,4 +72,4 @@
<property name="ResetControl" value="BEGINNING"/>
</admin-object-resource>-->
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-gf-resources.xml
index 045bf15..79549bb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-gf-resources.xml
@@ -72,4 +72,4 @@
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/monitoring-ds" object-type="user" pool-name="java:module/jdbc/monitoring-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-jar.xml
index 582b781..12fb6d3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/ejb-jar.xml
@@ -114,8 +114,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/sun-ejb-jar.xml
index b88a868..69b0149 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/sun-ejb-jar.xml
@@ -32,7 +32,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -84,7 +84,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:module/eis/testAdmin</jndi-name>
+ <jndi-name>java:module/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/web-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/web-gf-resources.xml
index 8105a15..62df165 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/web-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/META-INF/web-gf-resources.xml
@@ -67,4 +67,4 @@
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/monitoring-ds" object-type="user" pool-name="java:module/jdbc/monitoring-pool"/>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/web-level-ds" object-type="user" pool-name="java:module/jdbc/web-level-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/beans/MessageCheckerEJB.java
index 99bf25d..cb3788a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -126,11 +126,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -149,22 +149,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -190,10 +190,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -228,7 +228,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -239,7 +239,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/client/Client.java
index 7e030b6..8ef5cd5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test app-scoped-resources "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID app-scoped-resources test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID app-scoped-resources test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("app-scoped-resourcesID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/mdb/MyMessageBean.java
index b7427aa..62c42ad 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
//log("onMessage:: getCallerPrincipal : " + mdc.getCallerPrincipal());
//System.out.println("onMessage : ThreadID : " + Thread.currentThread().getName());
if(mdc.getCallerPrincipal() != null){
- log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
+ log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
}
log("onMessage : isCallerInRole('jagadish') : " + mdc.isCallerInRole("jagadish"));
@@ -83,7 +83,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -97,10 +97,10 @@
ex.printStackTrace();
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -110,62 +110,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -176,7 +176,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -185,9 +185,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -203,9 +203,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -218,9 +218,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/servlet/SimpleServlet.java
index 1ee0d14..93aa9ae 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/app/src/servlet/SimpleServlet.java
@@ -45,7 +45,7 @@
}
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException {
- System.out.println("This is to test application-scoped-resources");
+ System.out.println("This is to test application-scoped-resources");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.properties
index c1dbbe8..343d7a7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/app-scoped-resources/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.xml
index 75c3a0a..932725d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/build.xml
@@ -45,7 +45,7 @@
<antcall target="unset"/>
<antcall target="disable-monitoring"/>
</target>
-
+
<target name="build" depends="init-common">
<ant dir="ra" target="all"/>
<ant dir="app" target="all"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/glassfish-resources.xml
index a9349fc..0fcabdd 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/glassfish-resources.xml
@@ -48,4 +48,4 @@
<principal-map eis-principal="eis-prasath" mapped-principal="prasath" />
<principal-map eis-principal="eis-jagadish" mapped-principal="jagadish" />
</work-security-map>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/ra.xml
index 9781e16..3ccf296 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/META-INF/ra.xml
@@ -51,7 +51,7 @@
</config-property-confidential>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -62,7 +62,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/build.xml
index 4ffd698..679bbdb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/JSR322Work.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/JSR322Work.java
index 5107ac1..0203f4a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/JSR322Work.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/JSR322Work.java
@@ -48,6 +48,6 @@
public void run(){
super.run();
-
+
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MyAdminObject.java
index a68a5b7..9c28812 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MyAdminObject.java
@@ -51,11 +51,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MySecurityContext.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MySecurityContext.java
index 3178c1c..e19051e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MySecurityContext.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/MySecurityContext.java
@@ -62,7 +62,7 @@
CallerPrincipalCallback cpc = new CallerPrincipalCallback(execSubject, new PrincipalImpl(principalName));
debug("setting caller principal callback with principal : " + principalName);
callbacks.add(cpc);
-
+
/*
GroupPrincipalCallback gpc = new GroupPrincipalCallback(execSubject, null);
callbacks.add(gpc);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/WorkDispatcher.java
index d800f61..7da0d73 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/WorkDispatcher.java
@@ -86,7 +86,7 @@
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/XID.java
index 18a970d..b2a906c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/app-scoped-resources-ms4-demo/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/META-INF/glassfish-resources.xml
index 9554b37..2068855 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/META-INF/glassfish-resources.xml
@@ -85,11 +85,11 @@
<property name="intValue1" value="40"/>
</admin-object-resource>
-<custom-resource res-type="java.lang.String" jndi-name="java:app/custom/primitive-resource"
+<custom-resource res-type="java.lang.String" jndi-name="java:app/custom/primitive-resource"
factory-class="org.glassfish.resources.custom.factory.PrimitivesAndStringFactory">
<property name="value" value="TEST" />
</custom-resource>
<jdbc-resource pool-name="java:app/sr" jndi-name="java:app/jdbc/sr" />
<jdbc-resource pool-name="java:app/connector-bean-validation-pool" jndi-name="java:app/jdbc/connector-bean-validation-resource" />
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/ejb-jar.xml
index c94a365..f4608bf 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<resource-env-ref>
<resource-env-ref-name>java:comp/env/Validator</resource-env-ref-name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/sun-ejb-jar.xml
index 0f56324..ebe9649 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/META-INF/sun-ejb-jar.xml
@@ -88,13 +88,13 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:app/eis/testAdmin</jndi-name>
+ <jndi-name>java:app/eis/testAdmin</jndi-name>
</resource-env-ref>
<resource-env-ref>
<resource-env-ref-name>java:comp/env/Validator</resource-env-ref-name>
<resource-env-ref-type>jakarta.validation.Validator</resource-env-ref-type>
</resource-env-ref>
-
+
<resource-env-ref>
<resource-env-ref-name>java:comp/env/ValidatorFactory</resource-env-ref-name>
<resource-env-ref-type>jakarta.validation.ValidatorFactory</resource-env-ref-type>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/beans/MessageCheckerEJB.java
index 4a46e3c..25b3ae8 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/beans/MessageCheckerEJB.java
@@ -86,7 +86,7 @@
}
}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -129,11 +129,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -141,22 +141,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -182,8 +182,8 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- Controls.initialize();
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ Controls.initialize();
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -193,12 +193,12 @@
private boolean isConstraintViolationException(Throwable t, String jndiName){
boolean result = false;
if(t != null){
- if(t instanceof jakarta.validation.ConstraintViolationException){
+ if(t instanceof jakarta.validation.ConstraintViolationException){
System.out.println("Found Constraint Violation for resource ["+jndiName+"]" + t.getMessage());
- result = true;
- }else{
- result = isConstraintViolationException(t.getCause(), jndiName);
- }
+ result = true;
+ }else{
+ result = isConstraintViolationException(t.getCause(), jndiName);
+ }
}
return result;
}
@@ -232,7 +232,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -243,7 +243,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/client/Client.java
index 95a1338..bf32810 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/client/Client.java
@@ -71,7 +71,7 @@
// System.out.println("test count : " + testCount);
testCount++;
}
-
+
System.out.println("test count : " + testCount);
runAdminObjectTest(res, testCount++, "java:app/eis/testAdmin", true);
System.out.println("test count : " + testCount);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/mdb/MyMessageBean.java
index a48aab1..b373050 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,62 +103,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -169,7 +169,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -178,9 +178,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -196,9 +196,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -211,9 +211,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.properties
index 5aa38b3..12de46b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/simple-connector-bean-validation/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.xml
index a47432e..4539ea1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/build.xml
@@ -93,14 +93,14 @@
<!--
<target name="runtest" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="connector1.5 (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="connector1.5 (ear based)"/>
+ </antcall>
</target>
-->
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="simple-connector-bean-validation" />
+ <param name="appname" value="simple-connector-bean-validation" />
<param name="appclient.application.args" value="Standalone-"/>
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/META-INF/ra.xml
index 82636d5..5c74630 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/META-INF/ra.xml
@@ -42,7 +42,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -53,7 +53,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
@@ -70,7 +70,7 @@
</config-property>
</adminobject>
- <adminobject>
+ <adminobject>
<adminobject-interface>connector.MyAdminObject1</adminobject-interface>
<adminobject-class>connector.MyAdminObject1</adminobject-class>
<config-property>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/build.xml
index a1bbe97..c0530d1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/build.xml
@@ -34,7 +34,7 @@
<ant dir="src" inheritAll="false" target="all"/>
<jar jarfile="generic-ra.rar" basedir="."
- includes="generic-ra.jar, META-INF/*.xml, META-INF/services/*" />
+ includes="generic-ra.jar, META-INF/*.xml, META-INF/services/*" />
</target>
<target name="deploy" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/build.xml
index ff8bcc2..8496f60 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject.java
index b785d22..bacc68d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject.java
@@ -47,7 +47,7 @@
public int getIntValue(){
return intValue;
}
-
+
@ConfigProperty(defaultValue="1", type=java.lang.Integer.class)
public void setIntValue(int intValue){
this.intValue = intValue;
@@ -71,13 +71,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject1.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject1.java
index 92cae81..a32f7f9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject1.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/MyAdminObject1.java
@@ -47,7 +47,7 @@
public int getIntValue(){
return intValue;
}
-
+
@ConfigProperty(type=java.lang.Integer.class)
public void setIntValue(int intValue){
this.intValue = intValue;
@@ -88,13 +88,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleActivationSpec.java
index 8f2df2f..4604717 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleActivationSpec.java
@@ -25,9 +25,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -44,7 +44,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -53,17 +53,17 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
}
- @NotNull
+ @NotNull
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -100,7 +100,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleResourceAdapterImpl.java
index 03f5828..26a2dad 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -45,14 +45,14 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
private WorkManager wm;
-
+
private String testName;
private boolean debug = true;
@@ -64,7 +64,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -75,12 +75,12 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
debug("005. Simple RA start...");
@@ -120,13 +120,13 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -136,8 +136,8 @@
public Integer getIntValue(){
return intValue;
}
-
- @ConfigProperty(type=Integer.class, defaultValue="10")
+
+ @ConfigProperty(type=Integer.class, defaultValue="10")
public void setIntValue(Integer intValue){
this.intValue = intValue;
}
@@ -153,7 +153,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/WorkDispatcher.java
index 6e05b53..e776eaa 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -111,15 +111,15 @@
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -157,14 +157,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -187,13 +187,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/XID.java
index 77837f7..1d5024b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple-resources-xml/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/ejb-jar.xml
index c94a365..f4608bf 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<resource-env-ref>
<resource-env-ref-name>java:comp/env/Validator</resource-env-ref-name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/sun-ejb-jar.xml
index a26c9db..c3a901a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/META-INF/sun-ejb-jar.xml
@@ -88,13 +88,13 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<resource-env-ref>
<resource-env-ref-name>java:comp/env/Validator</resource-env-ref-name>
<resource-env-ref-type>jakarta.validation.Validator</resource-env-ref-type>
</resource-env-ref>
-
+
<resource-env-ref>
<resource-env-ref-name>java:comp/env/ValidatorFactory</resource-env-ref-name>
<resource-env-ref-type>jakarta.validation.ValidatorFactory</resource-env-ref-type>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/beans/MessageCheckerEJB.java
index 5231d9b..c806f02 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/beans/MessageCheckerEJB.java
@@ -71,7 +71,7 @@
}
}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -113,11 +113,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -125,22 +125,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -166,8 +166,8 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- Controls.initialize();
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ Controls.initialize();
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -177,12 +177,12 @@
private boolean isConstraintViolationException(Throwable t, String jndiName){
boolean result = false;
if(t != null){
- if(t instanceof jakarta.validation.ConstraintViolationException){
+ if(t instanceof jakarta.validation.ConstraintViolationException){
System.out.println("Found Constraint Violation for resource ["+jndiName+"]" + t.getMessage());
- result = true;
- }else{
- result = isConstraintViolationException(t.getCause(), jndiName);
- }
+ result = true;
+ }else{
+ result = isConstraintViolationException(t.getCause(), jndiName);
+ }
}
return result;
}
@@ -216,7 +216,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -227,7 +227,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/mdb/MyMessageBean.java
index a48aab1..b373050 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,62 +103,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -169,7 +169,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -178,9 +178,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -196,9 +196,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -211,9 +211,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.properties
index 5aa38b3..12de46b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/simple-connector-bean-validation/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.xml
index bc7bdfd..e11f494 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/build.xml
@@ -93,14 +93,14 @@
<!--
<target name="runtest" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="connector1.5 (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="connector1.5 (ear based)"/>
+ </antcall>
</target>
-->
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="simple-connector-bean-validation" />
+ <param name="appname" value="simple-connector-bean-validation" />
<param name="appclient.application.args" value="Standalone-"/>
</antcall>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/META-INF/ra.xml
index 82636d5..5c74630 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/META-INF/ra.xml
@@ -42,7 +42,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -53,7 +53,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
@@ -70,7 +70,7 @@
</config-property>
</adminobject>
- <adminobject>
+ <adminobject>
<adminobject-interface>connector.MyAdminObject1</adminobject-interface>
<adminobject-class>connector.MyAdminObject1</adminobject-class>
<config-property>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/build.xml
index a1bbe97..c0530d1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/build.xml
@@ -34,7 +34,7 @@
<ant dir="src" inheritAll="false" target="all"/>
<jar jarfile="generic-ra.rar" basedir="."
- includes="generic-ra.jar, META-INF/*.xml, META-INF/services/*" />
+ includes="generic-ra.jar, META-INF/*.xml, META-INF/services/*" />
</target>
<target name="deploy" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/build.xml
index ff8bcc2..8496f60 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject.java
index b785d22..bacc68d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject.java
@@ -47,7 +47,7 @@
public int getIntValue(){
return intValue;
}
-
+
@ConfigProperty(defaultValue="1", type=java.lang.Integer.class)
public void setIntValue(int intValue){
this.intValue = intValue;
@@ -71,13 +71,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject1.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject1.java
index 92cae81..a32f7f9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject1.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/MyAdminObject1.java
@@ -47,7 +47,7 @@
public int getIntValue(){
return intValue;
}
-
+
@ConfigProperty(type=java.lang.Integer.class)
public void setIntValue(int intValue){
this.intValue = intValue;
@@ -88,13 +88,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleActivationSpec.java
index 8f2df2f..4604717 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleActivationSpec.java
@@ -25,9 +25,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -44,7 +44,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -53,17 +53,17 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
}
- @NotNull
+ @NotNull
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -100,7 +100,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleResourceAdapterImpl.java
index 03f5828..26a2dad 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -45,14 +45,14 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
private WorkManager wm;
-
+
private String testName;
private boolean debug = true;
@@ -64,7 +64,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -75,12 +75,12 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
debug("005. Simple RA start...");
@@ -120,13 +120,13 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -136,8 +136,8 @@
public Integer getIntValue(){
return intValue;
}
-
- @ConfigProperty(type=Integer.class, defaultValue="10")
+
+ @ConfigProperty(type=Integer.class, defaultValue="10")
public void setIntValue(Integer intValue){
this.intValue = intValue;
}
@@ -153,7 +153,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/WorkDispatcher.java
index 6e05b53..e776eaa 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -111,15 +111,15 @@
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -157,14 +157,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -187,13 +187,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/XID.java
index 77837f7..1d5024b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/beanvalidation-simple/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/build.xml
index 76ddf3f..b209e91 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/build.xml
@@ -133,7 +133,7 @@
<param name="connector-target" value="all"/>
</antcall>
</target>
-
+
<target name="all-with-security-manager">
<delete>
<fileset dir="${env.APS_HOME}" includes="test_results*"/>
@@ -213,32 +213,32 @@
</target>
<target name="connector_group_1">
- <echo message="************ Starting connector_group_1 ************"/>
+ <echo message="************ Starting connector_group_1 ************"/>
<echo message="@@## connector1.5 ##@@"/>
<ant dir="connector1.5" target="${connector-target}"/>
<echo message="@@## embeddedConnector1.5 ##@@"/>
<ant dir="../embeddedConnector1.5" target="${connector-target}"/>
- <echo message="@@## embeddedweb ##@@"/>
+ <echo message="@@## embeddedweb ##@@"/>
<ant dir="embeddedweb" target="${connector-target}"/>
- <echo message="@@## mq ##@@"/>
- <ant dir="../mq" target="${connector-target}"/>
+ <echo message="@@## mq ##@@"/>
+ <ant dir="../mq" target="${connector-target}"/>
- <echo message="@@## nonacc ##@@"/>
+ <echo message="@@## nonacc ##@@"/>
<ant dir="../nonacc" target="${connector-target}"/>
- <echo message="@@## web2connector ##@@"/>
- <ant dir="../web2connector" target="${connector-target}" />
+ <echo message="@@## web2connector ##@@"/>
+ <ant dir="../web2connector" target="${connector-target}" />
- <echo message="@@## web2connector (second time) ##@@"/>
- <ant dir="../web2connector" target="${connector-target}" />
+ <echo message="@@## web2connector (second time) ##@@"/>
+ <ant dir="../web2connector" target="${connector-target}" />
- <echo message="@@## nonstringmcfproperties ##@@"/>
- <ant dir="nonstringmcfproperties" target="${connector-target}"/>
+ <echo message="@@## nonstringmcfproperties ##@@"/>
+ <ant dir="nonstringmcfproperties" target="${connector-target}"/>
- <echo message="@@## nonstringraproperties ##@@"/>
+ <echo message="@@## nonstringraproperties ##@@"/>
<ant dir="../nonstringraproperties" target="${connector-target}" />
<echo message="@@## txlevelswitch ##@@"/>
@@ -250,8 +250,8 @@
<echo message="@@## ejb 3.2 connector 1.7 mdb test##@@"/>
<ant dir="ejb32-mdb" target="${connector-target}"/>
- <echo message="@@## SunRaXml ##@@"/>
- <ant dir="SunRaXml" target="${connector-target}"/>
+ <echo message="@@## SunRaXml ##@@"/>
+ <ant dir="SunRaXml" target="${connector-target}"/>
<echo message="@@## serializabletest ##@@"/>
<ant dir="serializabletest" target="${connector-target}"/>
@@ -265,22 +265,22 @@
<echo message="@@## redeployRar ##@@"/>
<ant dir="redeployRar" target="${connector-target}"/>
- <echo message="@@## annotation-embeddedweb ##@@"/>
+ <echo message="@@## annotation-embeddedweb ##@@"/>
<ant dir="annotation-embeddedweb" target="${connector-target}"/>
- <echo message="@@## installed libraries embedded rar EXTENSION_LIST ##@@"/>
- <ant dir="installed-libraries-embedded" target="all-ext"/>
+ <echo message="@@## installed libraries embedded rar EXTENSION_LIST ##@@"/>
+ <ant dir="installed-libraries-embedded" target="all-ext"/>
- <echo message="@@## defaultConnectorResource ##@@"/>
+ <echo message="@@## defaultConnectorResource ##@@"/>
<ant dir="defaultConnectorResource" target="${connector-target}"/>
- </target>
+ </target>
<target name="connector_group_2">
- <echo message="************ Starting connector_group_2 ************"/>
+ <echo message="************ Starting connector_group_2 ************"/>
<echo message="@@## force-deploy-rar ##@@"/>
<ant dir="force-deploy-rar" target="${connector-target}"/>
- <echo message="@@## built-in-custom-resources ##@@"/>
+ <echo message="@@## built-in-custom-resources ##@@"/>
<ant dir="built-in-custom-resources" target="${connector-target}"/>
<echo message="@@## datasource-definition##@@"/>
@@ -292,32 +292,32 @@
</target>
<target name="connector_group_3">
- <echo message="************ Starting connector_group_3 ************"/>
- <echo message="@@## connection-factory-definition-embedra##@@"/>
- <ant dir="connection-factory-definition-embedra" target="${connector-target}"/>
+ <echo message="************ Starting connector_group_3 ************"/>
+ <echo message="@@## connection-factory-definition-embedra##@@"/>
+ <ant dir="connection-factory-definition-embedra" target="${connector-target}"/>
- <echo message="@@## administered-object-definition-embedra##@@"/>
- <ant dir="administered-object-definition-embedra" target="${connector-target}"/>
+ <echo message="@@## administered-object-definition-embedra##@@"/>
+ <ant dir="administered-object-definition-embedra" target="${connector-target}"/>
- <echo message="@@## administered-object-definition##@@"/>
- <ant dir="administered-object-definition" target="${connector-target}"/>
+ <echo message="@@## administered-object-definition##@@"/>
+ <ant dir="administered-object-definition" target="${connector-target}"/>
- <echo message="@@## jms-connection-factory-definition##@@"/>
- <ant dir="jms-connection-factory-definition" target="${connector-target}"/>
+ <echo message="@@## jms-connection-factory-definition##@@"/>
+ <ant dir="jms-connection-factory-definition" target="${connector-target}"/>
</target>
- <target name="connector_group_4">
- <echo message="************ Starting connector_group_4 ************"/>
- <echo message="@@## jms-destination-definition##@@"/>
- <ant dir="jms-destination-definition" target="${connector-target}"/>
+ <target name="connector_group_4">
+ <echo message="************ Starting connector_group_4 ************"/>
+ <echo message="@@## jms-destination-definition##@@"/>
+ <ant dir="jms-destination-definition" target="${connector-target}"/>
- <echo message="@@## installed libraries EXTENSION_LIST ##@@"/>
- <ant dir="installed-libraries" target="all-ext"/>
+ <echo message="@@## installed libraries EXTENSION_LIST ##@@"/>
+ <ant dir="installed-libraries" target="all-ext"/>
- <echo message="@@## installed libraries (--libraries) ##@@"/>
- <ant dir="installed-libraries" target="all--libraries"/>
+ <echo message="@@## installed libraries (--libraries) ##@@"/>
+ <ant dir="installed-libraries" target="all--libraries"/>
- <echo message="@@## security-map-web#@@"/>
+ <echo message="@@## security-map-web#@@"/>
<ant dir="securitymapweb" target="all"/>
<echo message="@@## rar-accessibility ##@@"/>
@@ -329,31 +329,31 @@
<echo message="@@## osgi-resources-test ##@@"/>
<ant dir="osgi-resources-test" target="all"/>
- <echo message="@@## beanvalidation-simple ##@@"/>
+ <echo message="@@## beanvalidation-simple ##@@"/>
<ant dir="beanvalidation-simple" target="all"/>
<echo message="@@## beanvalidation-simple ##@@"/>
<ant dir="beanvalidation-simple" target="embedded-all"/>
- <!--echo message="@@## defaultConnectorResource-standalone-rar ##@@"/>
+ <!--echo message="@@## defaultConnectorResource-standalone-rar ##@@"/>
<ant dir="defaultConnectorResource-standalone-rar" target="${connector-target}"/-->
- <!--echo message="@@## connector1.6 ##@@"/>
+ <!--echo message="@@## connector1.6 ##@@"/>
<ant dir="connector1.6" target="${connector-target}"/-->
- <!--echo message="@@## Annotated Connector1.5 ##@@"/>
+ <!--echo message="@@## Annotated Connector1.5 ##@@"/>
<ant dir="annotation-connector1.5" target="${connector-target}"/-->
</target>
- <target name="start-record">
- <record name="connector.output" action="start"/>
- </target>
+ <target name="start-record">
+ <record name="connector.output" action="start"/>
+ </target>
- <target name="stop-record">
- <record name="connector.output" action="stop"/>
- </target>
+ <target name="stop-record">
+ <record name="connector.output" action="stop"/>
+ </target>
- <target name="connector">
+ <target name="connector">
<antcall target="connector_group_1"/>
<antcall target="connector_group_2"/>
<antcall target="connector_group_3"/>
@@ -501,7 +501,7 @@
<echo message="@@## connector1.5-resourcesxml ##@@"/>
<ant dir="../connector1.5-resourcesxml" target="all"/>
-
+
<echo message="@@## embeddedConnector1.5-resourcesxml ##@@"/>
<ant dir="../embeddedConnector1.5-resourcesxml" target="all"/>
@@ -519,7 +519,7 @@
<echo message="@@## installed-libraries-resources-xml ##@@"/>
<ant dir="installed-libraries-resources" target="all--libraries"/>
-
+
<echo message="@@## connector1.6-resources-xml ##@@"/>
<ant dir="connector1.6-resources-xml" target="all-with-mappings"/>
@@ -537,7 +537,7 @@
<echo message="@@## connector1.5-resourcesxml-module-scope ##@@"/>
<ant dir="../connector1.5-resourcesxml-module-scope" target="all"/>
-
+
<echo message="jpa-tx_propagation-resources-xml##@@"/>
<ant dir="jpa-tx-propagation-gf-resources-xml" target="all"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/build.properties
index 76ed22e..5ad2476 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/build.properties
@@ -15,19 +15,19 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="ejb-bmp-CustomResourceFactories"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="appclient.application.args" value="12"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/client/SimpleBMPClient.java b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/client/SimpleBMPClient.java
index d4a2cff..ae7e5e7 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/client/SimpleBMPClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/client/SimpleBMPClient.java
@@ -30,19 +30,19 @@
public static void main(String[] args)
throws Exception {
- SimpleReporterAdapter stat = new SimpleReporterAdapter();
+ SimpleReporterAdapter stat = new SimpleReporterAdapter();
- stat.addDescription(testSuite);
+ stat.addDescription(testSuite);
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome");
- SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
+ SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class);
try{
// InitialContext ic = new InitialContext();
System.out.println("Appclient lookup : " + ic.lookup("java:app/custom/my-properties-xml-file"));
- }catch(Exception e){
+ }catch(Exception e){
e.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/ejb-jar.xml
index 4a96330..93f8762 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/ejb-jar.xml
@@ -70,6 +70,6 @@
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/glassfish-resources.xml
index 4d330dd..3fa2450 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources-resources-xml/descriptor/glassfish-resources.xml
@@ -55,4 +55,4 @@
<property name="host" value="java.sun.com" />
<property name="protocol" value="http" />
</custom-resource>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/build.properties
index 76ed22e..5ad2476 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/build.properties
@@ -15,19 +15,19 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="ejb-bmp-CustomResourceFactories"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="appclient.application.args" value="12"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/client/SimpleBMPClient.java b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/client/SimpleBMPClient.java
index 234c1a4..d971ef7 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/client/SimpleBMPClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/client/SimpleBMPClient.java
@@ -30,13 +30,13 @@
public static void main(String[] args)
throws Exception {
- SimpleReporterAdapter stat = new SimpleReporterAdapter();
+ SimpleReporterAdapter stat = new SimpleReporterAdapter();
- stat.addDescription(testSuite);
+ stat.addDescription(testSuite);
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome");
- SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
+ SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class);
SimpleBMP simpleBMP = simpleBMPHome.create();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/descriptor/ejb-jar.xml
index deb07ab..8925248 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/built-in-custom-resources/descriptor/ejb-jar.xml
@@ -62,6 +62,6 @@
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/build.properties
index 89ea0d5..7fc5405 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="config-property-accessor-test"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="rarfile" value="rar/blackbox-tx.rar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/JdbcConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/JdbcConnection.java
index fa64959..bb3656a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/JdbcConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/JdbcConnection.java
@@ -183,7 +183,7 @@
}
/////////////////////////////////////////////
- // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
+ // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
/////////////////////////////////////////////
///////////// BEGIN JDK 1.4 //////////////
@@ -329,27 +329,27 @@
}
///////////// END JDK 1.4 //////////////
-
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
void associateConnection(JdbcManagedConnection newMc)
throws ResourceException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
index 0e47ddc..a968601 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
@@ -109,7 +109,7 @@
if (!getBooleanWithGetBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Get Boolean Accessor is false");
}
-
+
if (!isBooleanWithIsBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Is Boolean Accessor is false");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
index 8f2f354..7925098 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
@@ -44,7 +44,7 @@
}
public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException {
- return null;
+ return null;
}
public BootstrapContext getBootstrapContext(){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/servlet/SimpleServlet.java
index be37953..55c65f8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/servlet/SimpleServlet.java
@@ -74,7 +74,7 @@
}catch(NamingException ne){
ne.printStackTrace();
} catch (CreateException e) {
- e.printStackTrace();
+ e.printStackTrace();
}finally{
out.println("END_OF_TEST");
out.flush();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/create_pointbase.sql
index 4234115..ed6dbab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/create_pointbase.sql
@@ -1,20 +1,20 @@
-Drop table TXLEVELSWITCH;
-
-CREATE TABLE TXLEVELSWITCH (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
-INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
-
-Drop table TXLEVELSWITCH2;
-
-CREATE TABLE TXLEVELSWITCH2 (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
-INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
-
+Drop table TXLEVELSWITCH;
+
+CREATE TABLE TXLEVELSWITCH (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
+INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
+
+Drop table TXLEVELSWITCH2;
+
+CREATE TABLE TXLEVELSWITCH2 (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
+INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/drop_pointbase.sql
index 0c1242f..d11a115 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/config-property-accessor-test/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table TXLEVELSWITCH;
-Drop table TXLEVELSWITCH2;
+Drop table TXLEVELSWITCH;
+Drop table TXLEVELSWITCH2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.properties
index 6302d86..926e522 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.properties
@@ -15,23 +15,23 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connection-factory-definition-embedra"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="Client"/>
+<property name="test.client"\u0020
+ value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.xml
index a311eeb..bd69079 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/build.xml
@@ -37,10 +37,10 @@
</target>
<target name="info" depends="init-common">
- <echo message="build.classes.dir is ${build.classes.dir}"/>
- <echo message="s1astest.classpath is ${s1astest.classpath}"/>
+ <echo message="build.classes.dir is ${build.classes.dir}"/>
+ <echo message="s1astest.classpath is ${s1astest.classpath}"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="servlet"/>
@@ -48,7 +48,7 @@
</target>
<target name="build" depends="compile">
- <echo message="assemble.dir = ${assemble.dir}"/>
+ <echo message="assemble.dir = ${assemble.dir}"/>
<!--build and package .war first so it doesn't contain ejb bean !-->
<!--classes that have @Stateless/@Stateul !-->
<antcall target="webclient-war-common">
@@ -71,23 +71,23 @@
<param name="ejbjar.classes"
value="**/Hello**.class"/>
</antcall>
-
+
<ant dir="ra" target="all"/>
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
+ <mkdir dir="${build.classes.dir}/META-INF"/>
<ear earfile="${assemble.dir}/${appname}App.ear" appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/">
<include name="*.rar"/>
</fileset>
</ear>
-
+
</target>
<target name="setup" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/client/Client.java
index 17301b9..94be353 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/client/Client.java
@@ -58,7 +58,7 @@
} else {
stat.addStatus(tcName, stat.PASS);
}
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -79,7 +79,7 @@
InputStream is = c1.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));
String line = null;
-
+
while ((line = input.readLine()) != null)
System.out.println(line);
if (code != 200) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/application.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/application.xml
index 98ffd68..9a68dc5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/application.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/application.xml
@@ -35,7 +35,7 @@
<module>
<connector>cfd-ra.rar</connector>
</module>
-
+
<connection-factory>
<description>global-scope resource defined in application DD</description>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/connector-resource.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/connector-resource.xml
index 144abd8..319d6aa 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/connector-resource.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/connector-resource.xml
@@ -20,12 +20,12 @@
<connection-factory xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd>
- <description>global-scope resource defined in application DD</description>
- <name>java:global/env/Application_Level_ConnectionFactory</name>
- <interface-name>jakarta.resource.cci.ConnectionFactory</interface-name>
- <resource-adapter>cfd-ra</resource-adapter>
- <property>
- <name>transactionSupport</name>
- <value>LocalTransaction</value>
- </property>
+ <description>global-scope resource defined in application DD</description>
+ <name>java:global/env/Application_Level_ConnectionFactory</name>
+ <interface-name>jakarta.resource.cci.ConnectionFactory</interface-name>
+ <resource-adapter>cfd-ra</resource-adapter>
+ <property>
+ <name>transactionSupport</name>
+ <value>LocalTransaction</value>
+ </property>
</connection-factory>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/ejb-jar.xml
index c9146bc..8f2161b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/ejb-jar.xml
@@ -18,9 +18,9 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false"
- version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false"
+ version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>connection-factory-definition-embedra-ejb</module-name>
<enterprise-beans>
@@ -29,7 +29,7 @@
<ejb-name>HelloStatefulEJB</ejb-name>
<business-local>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStateful</business-local>
<ejb-class>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStatefulEJB</ejb-class>
-
+
<connection-factory>
<description>global-scope resource to be modified by DD</description>
<name>java:global/env/HelloStatefulEJB_ModByDD_ConnectionFactory</name>
@@ -54,7 +54,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/HelloStatefulEJB_DD_ConnectionFactory</name>
@@ -65,7 +65,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloStatefulEJB_DD_ConnectionFactory</name>
@@ -79,7 +79,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/HelloStatefulEJB_DD_ConnectionFactory</name>
@@ -90,7 +90,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</session>
<session>
<display-name>HelloEJB</display-name>
@@ -122,7 +122,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloEJB_DD_ConnectionFactory</name>
@@ -158,8 +158,8 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</session>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/web.xml
index 4251cf0..fc8a65b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/descriptor/web.xml
@@ -18,8 +18,8 @@
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
version="3.1"
metadata-complete="false">
@@ -73,7 +73,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in Web DD</description>
<name>java:module/env/Web_DD_ConnectionFactory</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloEJB.java
index da9317f..71a0f60 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloEJB.java
@@ -36,39 +36,39 @@
properties = {"testName=foo"}
),
@ConnectionFactoryDefinition(
- description = "global-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:global/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "global-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:global/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
resourceAdapter = "#cfd-ra",
transactionSupport = TransactionSupportLevel.LocalTransaction,
maxPoolSize = 16,
minPoolSize = 4,
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
- description = "application-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:app/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "application-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:app/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
transactionSupport = TransactionSupportLevel.XATransaction,
maxPoolSize = 16,
minPoolSize = 4,
resourceAdapter = "#cfd-ra",
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
- description = "module-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:module/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "module-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:module/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
resourceAdapter = "#cfd-ra",
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
- description = "component-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:comp/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "component-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:comp/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
resourceAdapter = "#cfd-ra",
properties = {"testName=foo"}
)
@@ -80,7 +80,7 @@
@jakarta.annotation.Resource(name="java:comp/env/HelloEJB_Annotation_ConnectionFactory")
ConnectionFactory cf;
-
+
public void hello() {
try {
Connection c = cf.getConnection();
@@ -123,7 +123,7 @@
lookupConnectionFactory("java:app/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:module/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:comp/env/HelloEJB_DD_ConnectionFactory", true);
-
+
System.out.println("In HelloEJB::hello()");
}
@@ -150,6 +150,6 @@
}
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloStatefulEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloStatefulEJB.java
index f2e7400..39fa740 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloStatefulEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ejb/HelloStatefulEJB.java
@@ -120,7 +120,7 @@
lookupConnectionFactory("java:app/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:module/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:comp/env/HelloEJB_DD_ConnectionFactory", false);
-
+
System.out.println("StatefulEJB datasource-definitions Success");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/AbstractResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/AbstractResourceAdapter.java
index 07b9d78..0efcc5f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/AbstractResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/AbstractResourceAdapter.java
@@ -23,7 +23,7 @@
private String testName;
protected boolean debug = true;
-
+
public String getTestName() {
return testName;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/DeliveryWork.java
index 0034465..dca379a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/DeliveryWork.java
@@ -21,7 +21,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -30,7 +30,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -38,7 +38,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -49,7 +49,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -72,11 +72,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -87,14 +87,14 @@
}
// private Method getOnMessageMethod() {
-//
+//
// Method onMessageMethod = null;
// try {
// Class msgListenerClass = connector.MyMessageListener.class;
// Class[] paramTypes = { java.lang.String.class };
-// onMessageMethod =
+// onMessageMethod =
// msgListenerClass.getMethod("onMessage", paramTypes);
-//
+//
// } catch (NoSuchMethodException ex) {
// ex.printStackTrace();
// }
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyConnectionFactory.java
index 9f24648..922e71d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyConnectionFactory.java
@@ -32,7 +32,7 @@
private ConnectionManager cm;
private MyManagedConnectionFactory mcf;
private Reference ref;
-
+
public MyConnectionFactory(MyManagedConnectionFactory mcf, ConnectionManager cm) {
super();
this.mcf = mcf;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java
index f34e83b..24506a4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyManagedConnectionFactory.java
@@ -43,7 +43,7 @@
private ConnectionManager cm;
private PrintWriter writer;
private TransactionSupportLevel transactionSupport = TransactionSupportLevel.LocalTransaction;;
-
+
public String getTestName() {
return testName;
}
@@ -68,7 +68,7 @@
}
@Override
- public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
@@ -79,7 +79,7 @@
}
@Override
- public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
+ public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyWork.java
index 614381e..44899a0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/MyWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -31,7 +31,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -49,7 +49,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -66,7 +66,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -81,14 +81,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleActivationSpec.java
index 512e5c6..4b5e5f1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleActivationSpec.java
@@ -25,12 +25,12 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Activation(
messageListeners = {connector.MyMessageListener.class}
)
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -47,7 +47,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -56,7 +56,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -65,7 +65,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -98,7 +98,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java
index 25611ed..3fd9ded 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -29,14 +29,14 @@
/**
* This is a sample resource adapter
- *
+ *
* @author Qingqing Ouyang
*/
@Connector(
/* moduleName="My Simple RAR", */
- displayName = "Simple Resource Adapter",
- vendorName = "Java Software",
- eisType = "Generic Type",
+ displayName = "Simple Resource Adapter",
+ vendorName = "Java Software",
+ eisType = "Generic Type",
version = "1.0Alpha",
transactionSupport=TransactionSupportLevel.XATransaction)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/TestWMWork.java
index ee0fae9..e248506 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/TestWMWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -37,8 +37,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -72,10 +72,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -87,7 +87,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/V3WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/V3WorkDispatcher.java
index 8adf3cc..4b43783 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/V3WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/V3WorkDispatcher.java
@@ -43,7 +43,7 @@
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
try {
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 1;
@@ -72,7 +72,7 @@
debug("V3WorkDispatcher calling DONE()");
done();
debug("V3WorkDispatcher finished calling DONE()");
-
+
}
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/WorkDispatcher.java
index 42249dc..a14443a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/WorkDispatcher.java
@@ -32,7 +32,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -43,11 +43,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -60,7 +60,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -82,26 +82,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -109,7 +109,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -125,7 +125,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -149,7 +149,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -194,7 +194,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -206,19 +206,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -245,7 +245,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -260,14 +260,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -290,13 +290,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/servlet/Servlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/servlet/Servlet.java
index ad682c2..529d714 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/servlet/Servlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition-embedra/servlet/Servlet.java
@@ -70,7 +70,7 @@
minPoolSize = 4,
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
description="module-scope resource defined by @ConnectionFactoryDefinition",
name = "java:module/env/Servlet_ConnectionFactory",
@@ -78,7 +78,7 @@
resourceAdapter = "#cfd-ra",
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
description="component-scope resource defined by @ConnectionFactoryDefinition",
name = "java:comp/env/Servlet_ConnectionFactory",
@@ -93,7 +93,7 @@
@EJB
private Hello helloStateless;
-
+
@EJB(beanName = "HelloStatefulEJB")
private HelloStateful helloStateful;
@@ -109,7 +109,7 @@
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
-
+
try {
// Connection-Factory-Definition through Annotation
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.properties
index fffabc0..1c86a9a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.properties
@@ -15,23 +15,23 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connection-factory-definition"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="Client"/>
+<property name="test.client"\u0020
+ value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.xml
index df4d244..6897624 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/build.xml
@@ -37,25 +37,25 @@
</target>
<target name="info" depends="init-common">
- <echo message="build.classes.dir is ${build.classes.dir}"/>
- <echo message="s1astest.classpath is ${s1astest.classpath}"/>
+ <echo message="build.classes.dir is ${build.classes.dir}"/>
+ <echo message="s1astest.classpath is ${s1astest.classpath}"/>
</target>
-
+
<target name="compile-ut" depends="init-common">
<mkdir dir="${build.classes.dir}"/>
<javac srcdir="ut" destdir="${build.classes.dir}"
- classpath="${env.APS_HOME}/lib/junit.jar:${s1astest.classpath}"
- debug="on"
+ classpath="${env.APS_HOME}/lib/junit.jar:${s1astest.classpath}"
+ debug="on"
includeantruntime="false"
- failonerror="true"/>
+ failonerror="true"/>
</target>
<target name="build-ut" depends="init-common">
<!-- build a special ear which only includes deployment descriptors-->
<mkdir dir="${assemble.dir}"/>
<mkdir dir="${assemble.dir}/temp"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <copy file="${basedir}/descriptor/ut-application.xml" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/>
- <jar jarfile="${assemble.dir}/${appname}App-UT.ear">
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <copy file="${basedir}/descriptor/ut-application.xml" tofile="${build.classes.dir}/META-INF/application.xml" failonerror="false"/>
+ <jar jarfile="${assemble.dir}/${appname}App-UT.ear">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
</fileset>
@@ -71,7 +71,7 @@
<unjar src="${assemble.dir}/${appname}App-UT.ear" dest="${assemble.dir}/temp/${appname}App-UT"/>
</target>
-
+
<target name="run-ut" depends="compile-ut">
<junit printsummary="yes" haltonerror="no" haltonfailure="no" fork="true">
<formatter type="plain" usefile="false"/>
@@ -95,7 +95,7 @@
</target>
<target name="build" depends="compile">
- <echo message="assemble.dir = ${assemble.dir}"/>
+ <echo message="assemble.dir = ${assemble.dir}"/>
<!--build and package .war first so it doesn't contain ejb bean !-->
<!--classes that have @Stateless/@Stateul !-->
<antcall target="webclient-war-common">
@@ -118,11 +118,11 @@
<param name="ejbjar.classes"
value="**/Hello**.class"/>
</antcall>
-
+
<antcall target="ear-common"/>
<antcall target="build-ut"/>
-
+
<ant dir="ra" target="all"/>
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/client/Client.java
index a831b4c..6788ccc 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/client/Client.java
@@ -58,7 +58,7 @@
} else {
stat.addStatus(tcName, stat.PASS);
}
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -79,7 +79,7 @@
InputStream is = c1.getInputStream();
BufferedReader input = new BufferedReader(new InputStreamReader(is));
String line = null;
-
+
while ((line = input.readLine()) != null)
System.out.println(line);
if (code != 200) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/connector-resource.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/connector-resource.xml
index 144abd8..319d6aa 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/connector-resource.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/connector-resource.xml
@@ -20,12 +20,12 @@
<connection-factory xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/javaee_7.xsd>
- <description>global-scope resource defined in application DD</description>
- <name>java:global/env/Application_Level_ConnectionFactory</name>
- <interface-name>jakarta.resource.cci.ConnectionFactory</interface-name>
- <resource-adapter>cfd-ra</resource-adapter>
- <property>
- <name>transactionSupport</name>
- <value>LocalTransaction</value>
- </property>
+ <description>global-scope resource defined in application DD</description>
+ <name>java:global/env/Application_Level_ConnectionFactory</name>
+ <interface-name>jakarta.resource.cci.ConnectionFactory</interface-name>
+ <resource-adapter>cfd-ra</resource-adapter>
+ <property>
+ <name>transactionSupport</name>
+ <value>LocalTransaction</value>
+ </property>
</connection-factory>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ejb-jar.xml
index 8593de6..6c2fe26 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ejb-jar.xml
@@ -18,9 +18,9 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false"
- version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false"
+ version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>connection-factory-definition-ejb</module-name>
<enterprise-beans>
@@ -29,7 +29,7 @@
<ejb-name>HelloStatefulEJB</ejb-name>
<business-local>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStateful</business-local>
<ejb-class>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStatefulEJB</ejb-class>
-
+
<connection-factory>
<description>global-scope resource to be modified by DD</description>
<name>java:global/env/HelloStatefulEJB_ModByDD_ConnectionFactory</name>
@@ -54,7 +54,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/HelloStatefulEJB_DD_ConnectionFactory</name>
@@ -65,7 +65,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloStatefulEJB_DD_ConnectionFactory</name>
@@ -79,7 +79,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/HelloStatefulEJB_DD_ConnectionFactory</name>
@@ -90,7 +90,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</session>
<session>
<display-name>HelloEJB</display-name>
@@ -122,7 +122,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>application-scope resource defined in EJB DD</description>
<name>java:app/env/HelloEJB_DD_ConnectionFactory</name>
@@ -158,8 +158,8 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</session>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-application.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-application.xml
index d6e8115..e15bca5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-application.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-application.xml
@@ -20,7 +20,7 @@
<application xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="7"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd">
<display-name>connection-factory-definitionApp</display-name>
-
+
<module>
<java>connection-factory-definition-client.jar</java>
</module>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-entity-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-entity-ejb-jar.xml
index bc60ed7..6100629 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-entity-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-entity-ejb-jar.xml
@@ -18,11 +18,11 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>connection-factory-definition-ejb</module-name>
-
+
<enterprise-beans>
<entity>
<ejb-name>HelloEntity</ejb-name>
@@ -43,7 +43,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/Entity_ConnectionFactory</name>
@@ -57,7 +57,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/Entity_ConnectionFactory</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-interceptor-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-interceptor-ejb-jar.xml
index b12b3e4..a574fb6 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-interceptor-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-interceptor-ejb-jar.xml
@@ -18,8 +18,8 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>connection-factory-definition-ejb</module-name>
<interceptors>
@@ -39,7 +39,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/Interceptor_ConnectionFactory</name>
@@ -53,7 +53,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/Interceptor_ConnectionFactory</name>
@@ -66,5 +66,5 @@
</connection-factory>
</interceptor>
</interceptors>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-mdb-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-mdb-ejb-jar.xml
index cc66851..5e997dd 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-mdb-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-mdb-ejb-jar.xml
@@ -18,8 +18,8 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>connection-factory-definition-ejb</module-name>
<enterprise-beans>
@@ -42,7 +42,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/MDB_ConnectionFactory</name>
@@ -56,7 +56,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/MDB_ConnectionFactory</name>
@@ -67,8 +67,8 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</message-driven>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-session-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-session-ejb-jar.xml
index 865ef3a..0c804f0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-session-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-session-ejb-jar.xml
@@ -18,8 +18,8 @@
-->
<ejb-jar xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- metadata-complete="false" version="3.2"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ metadata-complete="false" version="3.2"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/ejb-jar_3_2.xsd">
<module-name>connection-factory-definition-ejb</module-name>
<enterprise-beans>
@@ -28,7 +28,7 @@
<ejb-name>HelloStatefulEJB</ejb-name>
<business-local>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStateful</business-local>
<ejb-class>com.sun.s1asdev.ejb.ejb30.hello.session3.HelloStatefulEJB</ejb-class>
-
+
<connection-factory>
<description>global-scope resource defined in EJB DD</description>
<name>java:global/env/StatefulEJB_ConnectionFactory</name>
@@ -42,7 +42,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/StatefulEJB_ConnectionFactory</name>
@@ -56,7 +56,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/StatefulEJB_ConnectionFactory</name>
@@ -67,7 +67,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</session>
<session>
<display-name>HelloEJB</display-name>
@@ -88,7 +88,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in EJB DD</description>
<name>java:module/env/HelloEJB_ConnectionFactory</name>
@@ -102,7 +102,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>component-scope resource defined in EJB DD</description>
<name>java:comp/env/HelloEJB_ConnectionFactory</name>
@@ -113,8 +113,8 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</session>
</enterprise-beans>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-web.xml
index 6924517..01c1149 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/ut-web.xml
@@ -18,8 +18,8 @@
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
version="3.1">
<display-name>connection-factory-definition</display-name>
@@ -61,7 +61,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in Web DD</description>
<name>java:module/env/ConnectionFactory</name>
@@ -72,6 +72,6 @@
<value>foo</value>
</property>
</connection-factory>
-
+
</web-app>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/web.xml
index 0982a35..d0f619e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/descriptor/web.xml
@@ -18,8 +18,8 @@
-->
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee web-app_3_1.xsd"
version="3.1"
metadata-complete="false">
@@ -73,7 +73,7 @@
<value>foo</value>
</property>
</connection-factory>
-
+
<connection-factory>
<description>module-scope resource defined in Web DD</description>
<name>java:module/env/Web_DD_ConnectionFactory</name>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloEJB.java
index 47ed92c..e50ebef 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloEJB.java
@@ -36,39 +36,39 @@
properties = {"testName=foo"}
),
@ConnectionFactoryDefinition(
- description = "global-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:global/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "global-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:global/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
resourceAdapter = "cfd-ra",
transactionSupport = TransactionSupportLevel.LocalTransaction,
maxPoolSize = 16,
minPoolSize = 4,
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
- description = "application-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:app/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "application-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:app/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
transactionSupport = TransactionSupportLevel.XATransaction,
maxPoolSize = 16,
minPoolSize = 4,
resourceAdapter = "cfd-ra",
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
- description = "module-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:module/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "module-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:module/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
resourceAdapter = "cfd-ra",
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
- description = "component-scope resource defined by @ConnectionFactoryDefinition",
- name = "java:comp/env/HelloEJB_Annotation_ConnectionFactory",
- interfaceName = "jakarta.resource.cci.ConnectionFactory",
+ description = "component-scope resource defined by @ConnectionFactoryDefinition",
+ name = "java:comp/env/HelloEJB_Annotation_ConnectionFactory",
+ interfaceName = "jakarta.resource.cci.ConnectionFactory",
resourceAdapter = "cfd-ra",
properties = {"testName=foo"}
)
@@ -80,7 +80,7 @@
@jakarta.annotation.Resource(name="java:comp/env/HelloEJB_Annotation_ConnectionFactory")
ConnectionFactory cf;
-
+
public void hello() {
try {
Connection c = cf.getConnection();
@@ -123,7 +123,7 @@
lookupConnectionFactory("java:app/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:module/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:comp/env/HelloEJB_DD_ConnectionFactory", true);
-
+
System.out.println("In HelloEJB::hello()");
}
@@ -150,6 +150,6 @@
}
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloStatefulEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloStatefulEJB.java
index dd573b7..33450ee 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloStatefulEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ejb/HelloStatefulEJB.java
@@ -120,7 +120,7 @@
lookupConnectionFactory("java:app/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:module/env/HelloEJB_DD_ConnectionFactory", true);
lookupConnectionFactory("java:comp/env/HelloEJB_DD_ConnectionFactory", false);
-
+
System.out.println("StatefulEJB datasource-definitions Success");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/AbstractResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/AbstractResourceAdapter.java
index 07b9d78..0efcc5f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/AbstractResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/AbstractResourceAdapter.java
@@ -23,7 +23,7 @@
private String testName;
protected boolean debug = true;
-
+
public String getTestName() {
return testName;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/DeliveryWork.java
index 0034465..dca379a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/DeliveryWork.java
@@ -21,7 +21,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -30,7 +30,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -38,7 +38,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -49,7 +49,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -72,11 +72,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -87,14 +87,14 @@
}
// private Method getOnMessageMethod() {
-//
+//
// Method onMessageMethod = null;
// try {
// Class msgListenerClass = connector.MyMessageListener.class;
// Class[] paramTypes = { java.lang.String.class };
-// onMessageMethod =
+// onMessageMethod =
// msgListenerClass.getMethod("onMessage", paramTypes);
-//
+//
// } catch (NoSuchMethodException ex) {
// ex.printStackTrace();
// }
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyConnectionFactory.java
index 9f24648..922e71d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyConnectionFactory.java
@@ -32,7 +32,7 @@
private ConnectionManager cm;
private MyManagedConnectionFactory mcf;
private Reference ref;
-
+
public MyConnectionFactory(MyManagedConnectionFactory mcf, ConnectionManager cm) {
super();
this.mcf = mcf;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyManagedConnectionFactory.java
index f34e83b..24506a4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyManagedConnectionFactory.java
@@ -43,7 +43,7 @@
private ConnectionManager cm;
private PrintWriter writer;
private TransactionSupportLevel transactionSupport = TransactionSupportLevel.LocalTransaction;;
-
+
public String getTestName() {
return testName;
}
@@ -68,7 +68,7 @@
}
@Override
- public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
+ public ManagedConnection createManagedConnection(Subject subject, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
@@ -79,7 +79,7 @@
}
@Override
- public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
+ public ManagedConnection matchManagedConnections(Set candidates, Subject sub, ConnectionRequestInfo reqInfo)
throws ResourceException {
return null;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyWork.java
index 614381e..44899a0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/MyWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -31,7 +31,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -49,7 +49,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -66,7 +66,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -81,14 +81,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleActivationSpec.java
index 512e5c6..4b5e5f1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleActivationSpec.java
@@ -25,12 +25,12 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
@Activation(
messageListeners = {connector.MyMessageListener.class}
)
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -47,7 +47,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -56,7 +56,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -65,7 +65,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -74,7 +74,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -98,7 +98,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleResourceAdapterImpl.java
index 25611ed..3fd9ded 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -29,14 +29,14 @@
/**
* This is a sample resource adapter
- *
+ *
* @author Qingqing Ouyang
*/
@Connector(
/* moduleName="My Simple RAR", */
- displayName = "Simple Resource Adapter",
- vendorName = "Java Software",
- eisType = "Generic Type",
+ displayName = "Simple Resource Adapter",
+ vendorName = "Java Software",
+ eisType = "Generic Type",
version = "1.0Alpha",
transactionSupport=TransactionSupportLevel.XATransaction)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/TestWMWork.java
index ee0fae9..e248506 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/TestWMWork.java
@@ -23,7 +23,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -37,8 +37,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -72,10 +72,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -87,7 +87,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/V3WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/V3WorkDispatcher.java
index 8adf3cc..4b43783 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/V3WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/V3WorkDispatcher.java
@@ -43,7 +43,7 @@
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
try {
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 1;
@@ -72,7 +72,7 @@
debug("V3WorkDispatcher calling DONE()");
done();
debug("V3WorkDispatcher finished calling DONE()");
-
+
}
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/WorkDispatcher.java
index 42249dc..a14443a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/WorkDispatcher.java
@@ -32,7 +32,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -43,11 +43,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -60,7 +60,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -82,26 +82,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -109,7 +109,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -125,7 +125,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -149,7 +149,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -194,7 +194,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -206,19 +206,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -245,7 +245,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -260,14 +260,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -290,13 +290,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/servlet/Servlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/servlet/Servlet.java
index 6a5047f..22be4b8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/servlet/Servlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/servlet/Servlet.java
@@ -70,7 +70,7 @@
minPoolSize = 4,
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
description="module-scope resource defined by @ConnectionFactoryDefinition",
name = "java:module/env/Servlet_ConnectionFactory",
@@ -78,7 +78,7 @@
resourceAdapter = "cfd-ra",
properties = {"testName=foo"}
),
-
+
@ConnectionFactoryDefinition(
description="component-scope resource defined by @ConnectionFactoryDefinition",
name = "java:comp/env/Servlet_ConnectionFactory",
@@ -93,7 +93,7 @@
@EJB
private Hello helloStateless;
-
+
@EJB(beanName = "HelloStatefulEJB")
private HelloStateful helloStateful;
@@ -109,7 +109,7 @@
resp.setContentType("text/html");
PrintWriter out = resp.getWriter();
-
+
try {
// Connection-Factory-Definition through Annotation
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/ArchiveTest.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/ArchiveTest.java
index bdc49be..55171d1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/ArchiveTest.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/ArchiveTest.java
@@ -71,7 +71,7 @@
ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());
reader.setClassLoader(classLoader);
-
+
Application applicationDesc = reader.open(archive);
// System.out.println("--------Connector resoruce in application.xml----------");
// for( ConnectionFactoryDefinitionDescriptor cfdd: applicationDesc.getConnectionFactoryDefinitionDescriptors()){
@@ -82,8 +82,8 @@
// }
// System.out.println("");
// }
-
- Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
+
+ Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
ConnectionFactoryDefinitionDescriptor desc;
@@ -134,10 +134,10 @@
reader.setAnnotationProcessingRequested(true);
reader.setClassLoader(classLoader);
assertTrue("Archivist should handle annotations.", reader.isAnnotationProcessingRequested());
-
+
WebBundleDescriptor webDesc = reader.open(archive);
- Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
+ Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
ConnectionFactoryDefinitionDescriptor desc;
@@ -159,7 +159,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("application-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:app/env/Servlet_ConnectionFactory");
@@ -170,7 +170,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:module/env/Servlet_ConnectionFactory");
@@ -178,7 +178,7 @@
desc.setResourceAdapter("cfd-ra");
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("component-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:comp/env/Servlet_ConnectionFactory");
@@ -186,7 +186,7 @@
desc.setResourceAdapter("cfd-ra");
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("global-scope resource defined in Web DD");
desc.setName("java:global/env/Web_DD_ConnectionFactory");
@@ -197,7 +197,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("application-scope resource defined in Web DD");
desc.setName("java:app/env/Web_DD_ConnectionFactory");
@@ -208,7 +208,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined in Web DD");
desc.setName("java:module/env/Web_DD_ConnectionFactory");
@@ -238,7 +238,7 @@
ASURLClassLoader classLoader = new ASURLClassLoader(this.getClass().getClassLoader());
classLoader.addURL(archive.toURL());
-
+
EjbArchivist reader = (EjbArchivist) TestUtil.getByType(EjbArchivist.class);
reader.setClassLoader(classLoader);
reader.setAnnotationProcessingRequested(true);
@@ -249,8 +249,8 @@
for( EjbDescriptor ejbDesc: ejbBundleDesc.getEjbs()){
acturalCFDDs.addAll(ejbDesc.getResourceDescriptors(JavaEEResourceType.CFD));
}
-
- Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
+
+ Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
ConnectionFactoryDefinitionDescriptor desc;
@@ -350,7 +350,7 @@
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
}
-
+
// connection-factory in annotation for stateful EJB
{
desc = new ConnectionFactoryDefinitionDescriptor();
@@ -363,7 +363,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("application-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:app/env/HelloStatefulEJB_Annotation_ConnectionFactory");
@@ -404,7 +404,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("application-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:app/env/HelloEJB_Annotation_ConnectionFactory");
@@ -415,7 +415,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:module/env/HelloEJB_Annotation_ConnectionFactory");
@@ -423,7 +423,7 @@
desc.setResourceAdapter("cfd-ra");
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("component-scope resource defined by @ConnectionFactoryDefinition");
desc.setName("java:comp/env/HelloEJB_Annotation_ConnectionFactory");
@@ -432,9 +432,9 @@
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
}
-
+
TestUtil.compareCFDD(expectedCFDDs, acturalCFDDs);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/DDTest.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/DDTest.java
index 9e5f8f5..690aee4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/DDTest.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/DDTest.java
@@ -47,23 +47,23 @@
protected void tearDown() throws Exception {
super.tearDown();
}
-
+
public void testApplicationDD() throws Exception{
-
+
String tcName = "connection-factory-definition-application-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-application.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The application.xml not found: "+ddFile,ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
ApplicationDeploymentDescriptorFile ddReader = new ApplicationDeploymentDescriptorFile();
Application application = (Application) ddReader.read( ddIS);
-
+
Set<ResourceDescriptor> actualCFDDs = application.getResourceDescriptors(JavaEEResourceType.CFD);
- Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
+ Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs =
new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
ConnectionFactoryDefinitionDescriptor desc;
@@ -77,7 +77,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setName("java:app/env/ConnectionFactory");
desc.setInterfaceName("jakarta.resource.cci.ConnectionFactory");
@@ -89,7 +89,7 @@
TestUtil.compareCFDD(expectedCFDDs, actualCFDDs);
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -103,18 +103,18 @@
}
public void testSessionEJBDD() throws Exception{
-
+
String tcName = "connection-factory-definition-Session-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-session-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-session-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
-
+
for(EjbDescriptor ejbDescriptor : ejbBundle.getEjbs()){
ejbDescriptor.getResourceDescriptors(JavaEEResourceType.CFD);
if(ejbDescriptor.getName().equals("HelloStatefulEJB")){
@@ -125,9 +125,9 @@
fail("Unknown EJB descriptor: "+ejbDescriptor.getName());
}
}
-
+
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -139,7 +139,7 @@
return;
}
-
+
private void testStatefulSessionEJBDD(EjbDescriptor ejb) throws Exception{
ConnectionFactoryDefinitionDescriptor desc;
Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs = new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
@@ -154,7 +154,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/StatefulEJB_ConnectionFactory");
@@ -175,9 +175,9 @@
expectedCFDDs.put(desc.getName(), desc);
TestUtil.compareCFDD(expectedCFDDs, ejb.getResourceDescriptors(JavaEEResourceType.CFD));
-
+
}
-
+
private void testStatelessSessionEJBDD(EjbDescriptor ejb) throws Exception{
ConnectionFactoryDefinitionDescriptor desc;
Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs = new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
@@ -192,7 +192,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/HelloEJB_ConnectionFactory");
@@ -213,18 +213,18 @@
expectedCFDDs.put(desc.getName(), desc);
TestUtil.compareCFDD(expectedCFDDs, ejb.getResourceDescriptors(JavaEEResourceType.CFD));
-
+
}
-
+
public void testEntityEJBDD() throws Exception{
-
+
String tcName = "connection-factory-definition-Entity-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-entity-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-entity-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
@@ -243,7 +243,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/Entity_ConnectionFactory");
@@ -267,7 +267,7 @@
}
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -281,14 +281,14 @@
}
public void testMDBEJBDD() throws Exception{
-
+
String tcName = "connection-factory-definition-MDB-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-mdb-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-mdb-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
@@ -307,7 +307,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/MDB_ConnectionFactory");
@@ -331,7 +331,7 @@
}
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -345,14 +345,14 @@
}
public void testInterceptorEJBDD() throws Exception{
-
+
String tcName = "connection-factory-definition-Interceptor-EJB-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-interceptor-ejb-jar.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-interceptor-ejb-jar.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
EjbDeploymentDescriptorFile ddReader = new EjbDeploymentDescriptorFile();
EjbBundleDescriptor ejbBundle = (EjbBundleDescriptor) ddReader.read( ddIS);
@@ -371,7 +371,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("module-scope resource defined in EJB DD");
desc.setName("java:module/env/Interceptor_ConnectionFactory");
@@ -395,7 +395,7 @@
}
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
@@ -409,18 +409,18 @@
}
public void testWebDD() throws Exception{
-
+
String tcName = "connection-factory-definition-Web-DD-test";
InputStream ddIS=null;
try{
String ddFileName = "ut-web.xml";
File ddFile = new File(descriptorDir, ddFileName);
Assert.assertTrue("The ut-web.xml not found: "+ddFile, ddFile.exists());
-
+
ddIS = new FileInputStream(ddFile);
WebDeploymentDescriptorFile ddReader = new WebDeploymentDescriptorFile();
WebBundleDescriptor webBundle = ddReader.read( ddIS);
-
+
ConnectionFactoryDefinitionDescriptor desc;
Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs = new HashMap<String,ConnectionFactoryDefinitionDescriptor>();
@@ -434,7 +434,7 @@
desc.setMinPoolSize(4);
desc.addProperty("testName", "foo");
expectedCFDDs.put(desc.getName(), desc);
-
+
desc = new ConnectionFactoryDefinitionDescriptor();
desc.setDescription("application-scope resource defined in Web DD");
desc.setName("java:app/env/ConnectionFactory");
@@ -457,7 +457,7 @@
TestUtil.compareCFDD(expectedCFDDs, webBundle.getResourceDescriptors(JavaEEResourceType.CFD));
stat.addStatus(tcName, stat.PASS);
-
+
}catch(Exception e){
stat.addStatus(tcName, stat.FAIL);
throw e;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/TestUtil.java b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/TestUtil.java
index 24178cd..7dadd7f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/TestUtil.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connection-factory-definition/ut/TestUtil.java
@@ -29,45 +29,45 @@
public class TestUtil {
- public static void compareCFDD(Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs,
+ public static void compareCFDD(Map<String,ConnectionFactoryDefinitionDescriptor> expectedCFDDs,
Set<ResourceDescriptor> actualCFDDs) throws Exception{
-
+
for(Descriptor descriptor : actualCFDDs){
ConnectionFactoryDefinitionDescriptor actualDesc = (ConnectionFactoryDefinitionDescriptor)descriptor;
assertNotNull("the name of connector resource cannot be null.", actualDesc.getName());
-
+
ConnectionFactoryDefinitionDescriptor expectedDesc = expectedCFDDs.get(actualDesc.getName());
assertNotNull("The CFD of the name ["+actualDesc.getName()+"] is not expected.", expectedDesc);
-
+
assertEquals("Fail to verify class-name of the CFDD:"+actualDesc.getName(),
expectedDesc.getInterfaceName(), actualDesc.getInterfaceName());
-
+
assertEquals("Fail to verify resource-adapter of the CFDD:"+actualDesc.getName(),
expectedDesc.getResourceAdapter(), actualDesc.getResourceAdapter());
-
+
assertEquals("Fail to verify transaction-support of the CFDD:"+actualDesc.getName(),
expectedDesc.getTransactionSupport(), actualDesc.getTransactionSupport());
-
+
assertEquals("Fail to verify max-pool-size of the CFDD:"+actualDesc.getName(),
expectedDesc.getMaxPoolSize(), actualDesc.getMaxPoolSize());
-
+
assertEquals("Fail to verify min-pool-size of the CFDD:"+actualDesc.getName(),
expectedDesc.getMinPoolSize(), actualDesc.getMinPoolSize());
-
+
assertEquals("Fail to verify description of the CFDD:"+actualDesc.getName(),
expectedDesc.getDescription(), actualDesc.getDescription());
-
+
Properties expectedProps = expectedDesc.getProperties();
Properties actualProps = actualDesc.getProperties();
-
+
for(Object name : actualProps.keySet()){
assertEquals("Fail to verify property ("+name+") of the CFDD:"+actualDesc.getName(),
expectedProps.get(name), actualProps.get(name));
}
-
+
assertEquals("Fail to verify size of properties of the CFDD:"+actualDesc.getName(),
expectedProps.size(), actualProps.size());
-
+
expectedCFDDs.remove(actualDesc.getName());
}
if(expectedCFDDs.size()>0){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/ejb-jar.xml
index 38af18c..2905932 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/ejb-jar.xml
@@ -91,8 +91,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/sun-ejb-jar.xml
index 1146a5a..0a7e0da 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/beans/MessageCheckerEJB.java
index e22fa10..4076e49 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -70,11 +70,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -93,22 +93,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -134,10 +134,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -172,7 +172,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -183,7 +183,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/client/Client.java
index 1aee44b..f802141 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus(" Connector 1.5 test - " + testCount, stat.FAIL);
} else {
stat.addStatus(" Connector 1.5 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("connector15");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/mdb/MyMessageBean.java
index a48aab1..b373050 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -90,10 +90,10 @@
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -103,62 +103,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -169,7 +169,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -178,9 +178,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -196,9 +196,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -211,9 +211,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/servlet/SimpleServlet.java
index 4546754..05e5268 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/app/src/servlet/SimpleServlet.java
@@ -44,17 +44,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.5 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
while (!done(out)) {
@@ -70,18 +70,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.5 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.5 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.properties
index 17b23c9..3c942c5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/connector15/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.xml
index 4ff1558..7052664 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/build.xml
@@ -81,15 +81,15 @@
<!--
<target name="runtest" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="connector1.5 (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="connector1.5 (ear based)"/>
+ </antcall>
</target>
-->
<!--
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="connector15" />
+ <param name="appname" value="connector15" />
</antcall>
</target>
-->
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/META-INF/ra.xml
index b6006ef..32b46e3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/build.xml
index ff8bcc2..8496f60 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/DeliveryWork.java
index cbed349..5719f27 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/DeliveryWork.java
@@ -29,7 +29,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work, ResourceAdapterAssociation {
@@ -39,7 +39,7 @@
private boolean keepCount;
private static int counter = 0;
protected ResourceAdapter raBean;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -47,7 +47,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -94,11 +94,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -109,14 +109,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyAdminObject.java
index 10483ed..1d02c62 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyAdminObject.java
@@ -38,13 +38,13 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
synchronized (Controls.readyLock){
Controls.done=false;
}
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyWork.java
index 3bdedaf..9e0eb92 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/MyWork.java
@@ -30,7 +30,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work, ResourceAdapterAssociation {
@@ -39,7 +39,7 @@
private MessageEndpointFactory factory;
private WorkManager wm;
protected ResourceAdapter raBean;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -66,7 +66,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -83,7 +83,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -98,14 +98,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
index 7c27e96..7b0bbbb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,12 +68,12 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
/*
@@ -90,16 +90,16 @@
System.out.println(" ex = " + ex.getMessage());
//xa.rollback(xid1);
}
-
+
*/
/*
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -109,14 +109,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -133,7 +133,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -141,7 +141,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -224,13 +224,13 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
-
+
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -246,7 +246,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/TestWMWork.java
index bb05534..de93bc1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/V3WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/V3WorkDispatcher.java
index 8adf3cc..4b43783 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/V3WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/V3WorkDispatcher.java
@@ -43,7 +43,7 @@
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
try {
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 1;
@@ -72,7 +72,7 @@
debug("V3WorkDispatcher calling DONE()");
done();
debug("V3WorkDispatcher finished calling DONE()");
-
+
}
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/WorkDispatcher.java
index 64b71c4..762e03e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
protected ActivationSpec spec;
protected WorkManager wm;
protected XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -246,7 +246,7 @@
done();
}
}
-
+
debug("LEAVE...");
}
@@ -261,14 +261,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -291,13 +291,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notifyAll();
+ Controls.readyLock.notifyAll();
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.5/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/META-INF/glassfish-resources.xml
index 05a0687..b3b319a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/META-INF/glassfish-resources.xml
@@ -73,4 +73,4 @@
<jdbc-resource enabled="true" jndi-name="java:app/jdbc/XAPointbase" object-type="user" pool-name="java:app/jdbc-pointbase-pool1"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-gf-resources.xml
index 1b3f95e..ddce74d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-gf-resources.xml
@@ -53,4 +53,4 @@
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/ejb-level-ds" object-type="user" pool-name="java:module/jdbc/ejb-level-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-jar.xml
index 582b781..12fb6d3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/ejb-jar.xml
@@ -114,8 +114,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/sun-ejb-jar.xml
index e46577f..cb8cd23 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:app/eis/testAdmin</jndi-name>
+ <jndi-name>java:app/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/web-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/web-gf-resources.xml
index 816d5a9..c658a07 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/web-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/META-INF/web-gf-resources.xml
@@ -53,4 +53,4 @@
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/web-level-ds" object-type="user" pool-name="java:module/jdbc/web-level-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/beans/MessageCheckerEJB.java
index a83c924..e8eedb0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -73,7 +73,7 @@
System.out.println("mao.getRA() is null");
}
}catch(Exception e){
- e.printStackTrace();
+ e.printStackTrace();
}
return pass;
}
@@ -86,11 +86,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -109,22 +109,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -150,10 +150,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -188,7 +188,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -199,7 +199,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/client/Client.java
index 21d4488..c7430d6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/client/Client.java
@@ -28,22 +28,22 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
@@ -54,26 +54,26 @@
e.printStackTrace();
}
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -83,14 +83,14 @@
}
stat.printSummary("connector1.6ID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -99,7 +99,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -107,7 +107,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -115,7 +115,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/mdb/MyMessageBean.java
index 19bfdb4..28a574c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/mdb/MyMessageBean.java
@@ -31,41 +31,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -76,7 +76,7 @@
//log("onMessage:: getCallerPrincipal : " + mdc.getCallerPrincipal());
//System.out.println("onMessage : ThreadID : " + Thread.currentThread().getName());
if(mdc.getCallerPrincipal() != null){
- log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
+ log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
}
log("onMessage : isCallerInRole('jagadish') : " + mdc.isCallerInRole("jagadish"));
@@ -85,7 +85,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -99,10 +99,10 @@
ex.printStackTrace();
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -112,62 +112,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -178,7 +178,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -187,9 +187,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -205,9 +205,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -220,9 +220,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/servlet/SimpleServlet.java
index be37a4a..a1c62f7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/app/src/servlet/SimpleServlet.java
@@ -44,17 +44,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.6 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
@@ -81,18 +81,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.6 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.6 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/build.properties
index 207a486..083b262 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/connector16/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/glassfish-resources.xml
index a9349fc..0fcabdd 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/glassfish-resources.xml
@@ -48,4 +48,4 @@
<principal-map eis-principal="eis-prasath" mapped-principal="prasath" />
<principal-map eis-principal="eis-jagadish" mapped-principal="jagadish" />
</work-security-map>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/ra.xml
index 9781e16..3ccf296 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/META-INF/ra.xml
@@ -51,7 +51,7 @@
</config-property-confidential>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -62,7 +62,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/build.xml
index ed29889..8528818 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/JSR322Work.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/JSR322Work.java
index 5107ac1..0203f4a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/JSR322Work.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/JSR322Work.java
@@ -48,6 +48,6 @@
public void run(){
super.run();
-
+
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MyAdminObject.java
index a68a5b7..9c28812 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MyAdminObject.java
@@ -51,11 +51,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MySecurityContext.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MySecurityContext.java
index 3178c1c..e19051e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MySecurityContext.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/MySecurityContext.java
@@ -62,7 +62,7 @@
CallerPrincipalCallback cpc = new CallerPrincipalCallback(execSubject, new PrincipalImpl(principalName));
debug("setting caller principal callback with principal : " + principalName);
callbacks.add(cpc);
-
+
/*
GroupPrincipalCallback gpc = new GroupPrincipalCallback(execSubject, null);
callbacks.add(gpc);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/WorkDispatcher.java
index c01c31e..69a721b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/WorkDispatcher.java
@@ -86,7 +86,7 @@
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/XID.java
index 18a970d..b2a906c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6-resources-xml/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/ejb-jar.xml
index 582b781..12fb6d3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/ejb-jar.xml
@@ -114,8 +114,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/sun-ejb-jar.xml
index 49e8c07..be097b7 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/META-INF/sun-ejb-jar.xml
@@ -32,7 +32,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -84,7 +84,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/beans/MessageCheckerEJB.java
index a83c924..e8eedb0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -73,7 +73,7 @@
System.out.println("mao.getRA() is null");
}
}catch(Exception e){
- e.printStackTrace();
+ e.printStackTrace();
}
return pass;
}
@@ -86,11 +86,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -109,22 +109,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -150,10 +150,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -188,7 +188,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -199,7 +199,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/client/Client.java
index 9343506..3939257 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("connector1.6ID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/mdb/MyMessageBean.java
index 19bfdb4..28a574c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/mdb/MyMessageBean.java
@@ -31,41 +31,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -76,7 +76,7 @@
//log("onMessage:: getCallerPrincipal : " + mdc.getCallerPrincipal());
//System.out.println("onMessage : ThreadID : " + Thread.currentThread().getName());
if(mdc.getCallerPrincipal() != null){
- log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
+ log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
}
log("onMessage : isCallerInRole('jagadish') : " + mdc.isCallerInRole("jagadish"));
@@ -85,7 +85,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -99,10 +99,10 @@
ex.printStackTrace();
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -112,62 +112,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -178,7 +178,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -187,9 +187,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -205,9 +205,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -220,9 +220,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/servlet/SimpleServlet.java
index be37a4a..a1c62f7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/app/src/servlet/SimpleServlet.java
@@ -44,17 +44,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.6 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
@@ -81,18 +81,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.6 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.6 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.properties
index 207a486..083b262 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/connector16/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.xml
index cc1dec0..f047011 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/build.xml
@@ -134,7 +134,7 @@
</antcall>
<antcall target="restore-default-security-permission"/>
-
+
<antcall target="delete-password-alias">
<param name="password.alias.name" value="ALIAS_TEST_PROPERTY"/>
</antcall>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/META-INF/ra.xml
index f22ca3c..ad950c7 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/META-INF/ra.xml
@@ -51,7 +51,7 @@
</config-property-confidential>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -62,7 +62,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/build.xml
index ed29889..8528818 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/JSR322Work.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/JSR322Work.java
index 5107ac1..0203f4a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/JSR322Work.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/JSR322Work.java
@@ -48,6 +48,6 @@
public void run(){
super.run();
-
+
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MyAdminObject.java
index 2b28d62..8e7bac2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MyAdminObject.java
@@ -73,11 +73,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MySecurityContext.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MySecurityContext.java
index 3178c1c..e19051e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MySecurityContext.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/MySecurityContext.java
@@ -62,7 +62,7 @@
CallerPrincipalCallback cpc = new CallerPrincipalCallback(execSubject, new PrincipalImpl(principalName));
debug("setting caller principal callback with principal : " + principalName);
callbacks.add(cpc);
-
+
/*
GroupPrincipalCallback gpc = new GroupPrincipalCallback(execSubject, null);
callbacks.add(gpc);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleResourceAdapterImpl.java
index d07c4e9..0867862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -84,11 +84,11 @@
spec.validate();
work = new WorkDispatcher("DISPATCHER", ctx, factory, spec);
wm.scheduleWork(work, 30 * 1000, null, null);
-
+
//Test if a resource defined in the comp's namespace is available
Object o = (new InitialContext()).lookup("java:comp/env/MyDB");
System.out.println("**** lookedup in RA endpointActivation:" + o);
-
+
debug("B.001. Scheduled Dispatcher");
} catch (Exception ex) {
ex.printStackTrace();
@@ -106,7 +106,7 @@
System.out.println("lookedup in RA endpointDeactivation:" + o);
} catch (Exception ex){
System.out.println("**** Error while looking up in component context " +
- "in endpointDeactivation");
+ "in endpointDeactivation");
ex.printStackTrace();
throw new RuntimeException(ex);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/WorkDispatcher.java
index 50af186..7fdcafd 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/WorkDispatcher.java
@@ -86,7 +86,7 @@
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/XID.java
index 18a970d..b2a906c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/connector1.6/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/build.properties
index 76ed22e..5ad2476 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/build.properties
@@ -15,19 +15,19 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="ejb-bmp-CustomResourceFactories"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="appclient.application.args" value="12"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/client/SimpleBMPClient.java b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/client/SimpleBMPClient.java
index 8f2f685..43704e4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/client/SimpleBMPClient.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/client/SimpleBMPClient.java
@@ -30,13 +30,13 @@
public static void main(String[] args)
throws Exception {
- SimpleReporterAdapter stat = new SimpleReporterAdapter();
+ SimpleReporterAdapter stat = new SimpleReporterAdapter();
- stat.addDescription(testSuite);
+ stat.addDescription(testSuite);
InitialContext ic = new InitialContext();
Object objRef = ic.lookup("java:comp/env/ejb/SimpleBMPHome");
- SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
+ SimpleBMPHome simpleBMPHome = (SimpleBMPHome)
javax.rmi.PortableRemoteObject.narrow(objRef, SimpleBMPHome.class);
SimpleBMP simpleBMP = simpleBMPHome.create();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/ejb-jar.xml
index 4a96330..93f8762 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/ejb-jar.xml
@@ -70,6 +70,6 @@
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
-
+
</ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/glassfish-resources.xml
index 88dc0a7..3134795 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/custom-resources-gf-resources-module-scoped/descriptor/glassfish-resources.xml
@@ -55,4 +55,4 @@
<property name="host" value="java.sun.com" />
<property name="protocol" value="http" />
</custom-resource>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/build.properties
index 1c0e3cd..f6cbfa5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/build.properties
@@ -15,23 +15,23 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="datasource-definition"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
-<property name="test.client"
- value="Client"/>
+<property name="test.client"\u0020
+ value="Client"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/client/Client.java
index db2bb97..4766ac1 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/client/Client.java
@@ -77,7 +77,7 @@
//The only way to confirm the fix for IT 9292 is that appclient console
//should not have "invalidDescriptorFailureException" printed
//no isolation level specified
- @DataSourceDefinition(name = "java:comp/env/Appclient_DataSource2",
+ @DataSourceDefinition(name = "java:comp/env/Appclient_DataSource2",
minPoolSize = 0,
initialPoolSize = 0,
className = "org.apache.derby.jdbc.ClientXADataSource",
@@ -210,7 +210,7 @@
return true;
} catch (Exception e) {
if(expectSuccess){
- e.printStackTrace();
+ e.printStackTrace();
}
return false;
} finally {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/application-client.xml b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/application-client.xml
index e6f90f5..ab09cc2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/application-client.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/application-client.xml
@@ -46,7 +46,7 @@
<value>;create=true</value>
</property>
<login-timeout>0</login-timeout>
- <transactional>true</transactional>
+ <transactional>true</transactional>
<isolation-level>TRANSACTION_REPEATABLE_READ</isolation-level>
<initial-pool-size>-1</initial-pool-size>
<max-pool-size>-1</max-pool-size>
@@ -67,7 +67,7 @@
<value>;create=true</value>
</property>
<login-timeout>0</login-timeout>
- <transactional>true</transactional>
+ <transactional>true</transactional>
<isolation-level>TRANSACTION_REPEATABLE_READ</isolation-level>
<initial-pool-size>-1</initial-pool-size>
<max-pool-size>-1</max-pool-size>
@@ -88,7 +88,7 @@
<value>;create=true</value>
</property>
<login-timeout>0</login-timeout>
- <transactional>true</transactional>
+ <transactional>true</transactional>
<isolation-level>TRANSACTION_REPEATABLE_READ</isolation-level>
<initial-pool-size>-1</initial-pool-size>
<max-pool-size>-1</max-pool-size>
@@ -110,7 +110,7 @@
<value>;create=true</value>
</property>
<login-timeout>300</login-timeout>
- <transactional>false</transactional>
+ <transactional>false</transactional>
<isolation-level>TRANSACTION_REPEATABLE_READ</isolation-level>
<initial-pool-size>1</initial-pool-size>
<max-pool-size>2</max-pool-size>
@@ -131,7 +131,7 @@
<value>;create=true</value>
</property>
<login-timeout>0</login-timeout>
- <transactional>true</transactional>
+ <transactional>true</transactional>
<isolation-level>TRANSACTION_REPEATABLE_READ</isolation-level>
<initial-pool-size>-1</initial-pool-size>
<max-pool-size>-1</max-pool-size>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/web.xml b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/web.xml
index 62063c5..1c4535b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/web.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/descriptor/web.xml
@@ -43,7 +43,7 @@
<value>;create=true</value>
</property>
</data-source>
-
+
<data-source>
<name>java:comp/env/Servlet_DD_DataSource</name>
<class-name>org.apache.derby.jdbc.ClientDataSource</class-name>
@@ -58,6 +58,6 @@
</property>
</data-source>
-
+
</web-app>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloEJB.java
index 9adb9a2..9c753f9 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloEJB.java
@@ -34,13 +34,13 @@
value = {
//pure annotation that has url and no standard properties
//test-case for issue-14918
- @DataSourceDefinition(name="java:app/jdbc/appds_driver",
- className="org.apache.derby.jdbc.ClientDriver",
- user="dbuser",
- password="dbpassword",
- transactional=false,
- url="jdbc:derby://localhost:1527/testdb;create=true"
- ),
+ @DataSourceDefinition(name="java:app/jdbc/appds_driver",
+ className="org.apache.derby.jdbc.ClientDriver",
+ user="dbuser",
+ password="dbpassword",
+ transactional=false,
+ url="jdbc:derby://localhost:1527/testdb;create=true"
+ ),
@DataSourceDefinition(name = "java:global/env/HelloEJB_DataSource",
className = "org.apache.derby.jdbc.EmbeddedXADataSource",
@@ -73,13 +73,13 @@
),
// annotation + DD where URL specified in annotation wins
//test-case for issue-14918
- @DataSourceDefinition(name="java:module/env/HelloEJB_DataSource_driver",
- className="org.apache.derby.jdbc.ClientDriver",
- user="dbuser",
- password="dbpassword",
- transactional=false,
- url="jdbc:derby://localhost:1527/testdb;create=true"
- )
+ @DataSourceDefinition(name="java:module/env/HelloEJB_DataSource_driver",
+ className="org.apache.derby.jdbc.ClientDriver",
+ user="dbuser",
+ password="dbpassword",
+ transactional=false,
+ url="jdbc:derby://localhost:1527/testdb;create=true"
+ )
}
)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloStatefulEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloStatefulEJB.java
index db30d12..068ae5c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloStatefulEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/datasource-definition/ejb/HelloStatefulEJB.java
@@ -62,7 +62,7 @@
),
// only user should be considered.
- // incorrect values for : className, portNumber, url, properties which should be ignored
+ // incorrect values for : className, portNumber, url, properties which should be ignored
@DataSourceDefinition(name = "java:global/env/HelloStatefulEJB_DD_DataSource",
minPoolSize = 0,
initialPoolSize = 0,
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/build.xml
index 1249e09..520bf51 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/build.xml
@@ -36,8 +36,8 @@
<antcall target="build-ear"/>
<!--
<antcall target="ear-common">
- <param name="appname" value="generic-embedded"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="generic-embedded"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
-->
</target>
@@ -55,8 +55,8 @@
</fileset>
<fileset dir="../ra">
<!-- <include name="*.rar"/> -->
- <!--<include name="sivajdbcra.rar"/>-->
- <include name="generic-ra.rar"/>
+ <!--<include name="sivajdbcra.rar"/>-->
+ <include name="generic-ra.rar"/>
</fileset>
<fileset dir="${env.APS_HOME}/lib">
<include name="reporter.jar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/build.properties
index ccf2433..1505150 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/mdb/MyMessageBean.java
index 0fc57d6..cc2b370 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/app/src/mdb/MyMessageBean.java
@@ -121,17 +121,17 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection("dbuser","dbpassword");
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.properties
index 9450d0d..5635439 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/defaultResource/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.xml
index 5b0d3dd..c4ba2d6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/build.xml
@@ -52,7 +52,7 @@
<!--
<target name="runtest" depends="init-common">
<antcall target="runclient-common">
- <param name="appname" value="generic-embedded" />
+ <param name="appname" value="generic-embedded" />
</antcall>
</target>
-->
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/build.xml
index 96146ff..46ec7c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/build.xml
@@ -35,7 +35,7 @@
<jar jarfile="generic-ra.rar" basedir="."
includes="generic-ra.jar, META-INF/ra.xml" />
- <echo message="inside all of ra build.xml"></echo>
+ <echo message="inside all of ra build.xml"></echo>
</target>
<!-- @Siva This deploy/undeploy target is never called as it is an embedded RA -->
<target name="deploy" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/build.xml
index ff8bcc2..8496f60 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyAdminObject.java
index 862f9ff..d199d01 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyAdminObject.java
@@ -38,11 +38,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleActivationSpec.java
index 946d987..bb7918e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -42,7 +42,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -51,7 +51,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -60,7 +60,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -76,7 +76,7 @@
this.resourceadapter = ra;
}
- public void validate() {}
+ public void validate() {}
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleResourceAdapterImpl.java
index 58813b3..4c5d98f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,22 +68,22 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
/*
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -93,14 +93,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -117,7 +117,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -125,7 +125,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -206,12 +206,12 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -227,7 +227,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/TestWMWork.java
index 7e585a3..9cd0663 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/WorkDispatcher.java
index 34a604f..cd98c45 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -243,7 +243,7 @@
break;
}
}
-
+
debug("LEAVE...");
}
@@ -258,14 +258,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -288,13 +288,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
@@ -310,7 +310,7 @@
Controls.done = true;
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
+ Controls.readyLock.notify();
}
} catch (Exception ex) {
ex.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource-standalone-rar/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/build.xml
index c60e609..2bd69f5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/build.xml
@@ -36,8 +36,8 @@
<antcall target="build-ear"/>
<!--
<antcall target="ear-common">
- <param name="appname" value="generic-embedded"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="generic-embedded"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
-->
</target>
@@ -55,8 +55,8 @@
</fileset>
<fileset dir="../ra">
<!-- <include name="*.rar"/> -->
- <include name="sivajdbcra.rar"/>
- <include name="generic-ra.rar"/>
+ <include name="sivajdbcra.rar"/>
+ <include name="generic-ra.rar"/>
</fileset>
<fileset dir="${env.APS_HOME}/lib">
<include name="reporter.jar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/build.properties
index ccf2433..1505150 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/mdb/MyMessageBean.java
index 90ba055..b8420f3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/app/src/mdb/MyMessageBean.java
@@ -123,17 +123,17 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection("dbuser","dbpassword");
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
*/
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/build.properties
index 9450d0d..5635439 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/defaultResource/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/META-INF/ra.xml
index 2ca2ebc..21deb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/META-INF/ra.xml
@@ -45,7 +45,7 @@
</config-property-value>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -56,7 +56,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/build.xml
index 96146ff..46ec7c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/build.xml
@@ -35,7 +35,7 @@
<jar jarfile="generic-ra.rar" basedir="."
includes="generic-ra.jar, META-INF/ra.xml" />
- <echo message="inside all of ra build.xml"></echo>
+ <echo message="inside all of ra build.xml"></echo>
</target>
<!-- @Siva This deploy/undeploy target is never called as it is an embedded RA -->
<target name="deploy" depends="init-common">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/build.xml
index ff8bcc2..8496f60 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Messages.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Messages.java
index b5b0f02..4c9c012 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Messages.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/Messages.java
@@ -21,7 +21,7 @@
/**
* collection of messages.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Messages {
@@ -54,7 +54,7 @@
String command = args[0];
String destName = args[1];
String message = args[2];
-
+
if (!"add".equals(command)) {
System.exit(1);
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyAdminObject.java
index 862f9ff..d199d01 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyAdminObject.java
@@ -38,11 +38,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyWork.java
index 2ecec63..a9a8881 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/MyWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class MyWork implements Work {
@@ -35,7 +35,7 @@
private boolean stop = false;
private MessageEndpointFactory factory;
private WorkManager wm;
-
+
public MyWork(
String name, MessageEndpointFactory factory, WorkManager wm) {
this.factory = factory;
@@ -53,7 +53,7 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
/*
@@ -70,7 +70,7 @@
ex.printStackTrace();
}
}
-
+
debug("LEAVE...");
}
@@ -85,14 +85,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleActivationSpec.java
index 946d987..bb7918e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -42,7 +42,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -51,7 +51,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -60,7 +60,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -76,7 +76,7 @@
this.resourceadapter = ra;
}
- public void validate() {}
+ public void validate() {}
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleResourceAdapterImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleResourceAdapterImpl.java
index 58813b3..4c5d98f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleResourceAdapterImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/SimpleResourceAdapterImpl.java
@@ -40,9 +40,9 @@
/**
* This is a sample resource adapter
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleResourceAdapterImpl
+public class SimpleResourceAdapterImpl
implements ResourceAdapter, java.io.Serializable {
private BootstrapContext ctx;
@@ -58,7 +58,7 @@
public void
start(BootstrapContext ctx) throws ResourceAdapterInternalException{
-
+
debug("001. Simple RA start...");
this.ctx = ctx;
@@ -68,22 +68,22 @@
//testing creat timer
Timer timer = null;
- try{
- timer = ctx.createTimer();
- } catch(UnavailableException ue) {
- System.out.println("Error");
- throw new ResourceAdapterInternalException("Error form bootstrap");
- }
+ try{
+ timer = ctx.createTimer();
+ } catch(UnavailableException ue) {
+ System.out.println("Error");
+ throw new ResourceAdapterInternalException("Error form bootstrap");
+ }
debug("004. Simple RA start...");
/*
try {
-
+
XATerminator xa = ctx.getXATerminator();
-
+
Xid xid1 = new XID();
System.out.println(" XID1 = " + xid1);
-
+
ExecutionContext ec = new ExecutionContext();
ec.setXid(xid1);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -93,14 +93,14 @@
wm.doWork(outw, 1*1000, ec, null);
xa.commit(xid1, true);
} catch (Exception ex) {
-
+
System.out.println(" ex = " + ex.getMessage());
xa.rollback(xid1);
}
-
+
Xid xid2 = new XID();
System.out.println(" XID2 = " + xid2);
-
+
ec = new ExecutionContext();
ec.setXid(xid2);
ec.setTransactionTimeout(5*1000); //5 seconds
@@ -117,7 +117,7 @@
ex.printStackTrace();
}
-
+
for (int i = 0 ; i < 3; i++) {
TestWMWork w = new TestWMWork(i, false);
try {
@@ -125,7 +125,7 @@
} catch (Exception ex) {
System.out.println("FAIL: CAUGHT exception : i = " + i);
ex.printStackTrace();
- }
+ }
}
for (int i = 3 ; i < 6; i++) {
@@ -206,12 +206,12 @@
public void
endpointDeactivation (
- MessageEndpointFactory endpointFactory,
+ MessageEndpointFactory endpointFactory,
ActivationSpec spec) {
debug ("endpointDeactivation called...");
((WorkDispatcher) work).stop();
}
-
+
public String getTestName() {
return testName;
}
@@ -227,7 +227,7 @@
System.out.println("[SimpleResourceAdapterImpl] ==> " + message);
}
- public XAResource[] getXAResources(ActivationSpec[] specs)
+ public XAResource[] getXAResources(ActivationSpec[] specs)
throws ResourceException {
throw new UnsupportedOperationException();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/TestWMWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/TestWMWork.java
index 7e585a3..9cd0663 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/TestWMWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/TestWMWork.java
@@ -28,7 +28,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class TestWMWork implements Work {
@@ -42,8 +42,8 @@
public TestWMWork(int id, boolean isRogue) {
this(id, isRogue, false, null);
}
-
- public TestWMWork(int id, boolean isRogue,
+
+ public TestWMWork(int id, boolean isRogue,
boolean doNest, ExecutionContext ctx) {
this.id = id;
this.isRogue = isRogue;
@@ -77,10 +77,10 @@
} catch (WorkException ex) {
if (ex.getErrorCode().equals(
WorkException.TX_CONCURRENT_WORK_DISALLOWED)) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"PASS: CAUGHT EXPECTED = " + ex.getErrorCode());
} else {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getErrorCode());
}
}
@@ -92,7 +92,7 @@
ec.setTransactionTimeout(5*1000); //5 seconds
wm.doWork(nestedWork, 1*1000, ec, null);
} catch (Exception ex) {
- System.out.println("TestWMWork[" + id + "] " +
+ System.out.println("TestWMWork[" + id + "] " +
"FAIL: CAUGHT UNEXPECTED = " + ex.getMessage());
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/WorkDispatcher.java
index 34a604f..cd98c45 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/WorkDispatcher.java
@@ -33,7 +33,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class WorkDispatcher implements Work {
@@ -44,11 +44,11 @@
private ActivationSpec spec;
private WorkManager wm;
private XATerminator xa;
-
+
public WorkDispatcher(
String id,
BootstrapContext ctx,
- MessageEndpointFactory factory,
+ MessageEndpointFactory factory,
ActivationSpec spec) {
this.id = id;
this.ctx = ctx;
@@ -61,7 +61,7 @@
public void run() {
debug("ENTER...");
-
+
try {
synchronized (Controls.readyLock) {
debug("WAIT...");
@@ -83,26 +83,26 @@
try {
Method onMessage = getOnMessageMethod();
- System.out.println("isDeliveryTransacted = " +
+ System.out.println("isDeliveryTransacted = " +
factory.isDeliveryTransacted(onMessage));
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
-
+
//MessageEndpoint ep = factory.createEndpoint(null);
MessageEndpoint ep = factory.createEndpoint(new FakeXAResource());
int numOfMessages = 5;
-
+
//importing transaction
//write/commit
ExecutionContext ec = startTx();
debug("Start TX - " + ec.getXid());
- DeliveryWork w =
+ DeliveryWork w =
new DeliveryWork(ep, numOfMessages, "WRITE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -110,7 +110,7 @@
debug("DONE WRITE TO DB");
Controls.expectedResults = numOfMessages;
notifyAndWait();
-
+
//delete/rollback
ec = startTx();
debug("Start TX - " + ec.getXid());
@@ -126,7 +126,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -150,7 +150,7 @@
//delete/commit
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, numOfMessages, "DELETE");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
@@ -195,7 +195,7 @@
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
wm.doWork(w, 0, ec, null);
-
+
if (XAResource.XA_OK == xa.prepare(ec.getXid())) {
xa.commit(ec.getXid(), false);
debug("XA PREPARE/COMMIT. DONE WRITE TO DB ");
@@ -207,19 +207,19 @@
Controls.expectedResults = 3;
notifyAndWait();
}
-
+
//delete all.
ec = startTx();
debug("Start TX - " + ec.getXid());
-
+
w = new DeliveryWork(ep, 1, "DELETE_ALL");
wm.doWork(w, 0, ec, null);
xa.commit(ec.getXid(), true);
-
+
debug("DONE DELETE ALL FROM DB");
Controls.expectedResults = 0;
notifyAndWait();
-
+
done();
}
@@ -243,7 +243,7 @@
break;
}
}
-
+
debug("LEAVE...");
}
@@ -258,14 +258,14 @@
}
public Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
@@ -288,13 +288,13 @@
try {
//Sleep for 5 seconds
//Thread.currentThread().sleep(5*1000);
-
+
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
-
+ Controls.readyLock.notify();
+
//Wait until results are verified by the client
- Controls.readyLock.wait();
+ Controls.readyLock.wait();
if (stop) {
return;
@@ -310,7 +310,7 @@
Controls.done = true;
synchronized(Controls.readyLock) {
//Notify the client to check the results
- Controls.readyLock.notify();
+ Controls.readyLock.notify();
}
} catch (Exception ex) {
ex.printStackTrace();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/XID.java
index 77dbf34..6bd9e57 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/defaultConnectorResource/ra/src/connector/XID.java
@@ -36,8 +36,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -55,10 +55,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -98,7 +98,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.xml
index cf21e1d..e1b5f20 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/build.xml
@@ -32,14 +32,14 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<target name="all" depends="build, deploy-ear, setup, run-ear, unsetup, undeploy-ear"/>
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
@@ -51,7 +51,7 @@
<param name="sql.file" value="sql/dropBankTables.sql"/>
</antcall>
</target>
-
+
<target name="compile" depends="clean">
<ant dir="ra" target="compile"/>
<antcall target="compile-common">
@@ -65,9 +65,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -76,41 +76,41 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <mkdir dir="${assemble.dir}/META-INF"/>
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <mkdir dir="${assemble.dir}/META-INF"/>
<copy file="descriptor/glassfish-resources.xml" tofile="${build.classes.dir}/META-INF/glassfish-resources.xml" failonerror="true" filtering="true">
</copy>
<copy file="descriptor/glassfish-resources.xml" tofile="${assemble.dir}/META-INF/glassfish-resources.xml" failonerror="true" filtering="true">
</copy>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
<include name="META-INF/*.xml"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="deploy-common"/>
</target>
@@ -118,28 +118,28 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="embeddedweb (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="embeddedweb (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="embeddedweb (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="embeddedweb (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="undeploy-common">
<param name="extra-params" value="--cascade=true"/>
</antcall>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/glassfish-resources.xml
index db12980..957b884 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/glassfish-resources.xml
@@ -58,4 +58,4 @@
<resource-adapter-config resource-adapter-name="web-subclassingApp#jdbcra">
<property name="RAProperty" value="VALID"></property>
</resource-adapter-config>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/sun-ejb-jar.xml
index 7995ce3..51f3bec 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>java:app/jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>java:app/jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/Customer.java
index 8a9b105..160eab9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/Customer.java
@@ -44,4 +44,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerChecking.java
index 61de291..b341c34 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerChecking.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerEJB.java
index 0520b60..07220db 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavings.java
index 338c921..883e04a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavings.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.xml
index ebea87b..34f6366 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index 70029f1..e966f98 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,169 +50,169 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
System.out.println("V3-TEST : " + dataSourceObject);
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
System.out.println("V3-TEST : " + dataSourceObject);
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index a956d97..11ad746 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/*
@@ -279,184 +279,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -506,162 +506,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 277efba..f7ea82b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -128,7 +128,7 @@
<config-property-value>testdb</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbuser</config-property-value>
@@ -139,12 +139,12 @@
<config-property-value>dbuser</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbpassword</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -154,7 +154,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>-->
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
@@ -165,17 +165,17 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
@@ -186,7 +186,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientDataSource40</config-property-value>
@@ -198,82 +198,82 @@
</config-property>
<!--
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
-->
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index a9fa5f1..b1fc0e5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,7 +68,7 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
@@ -78,36 +78,36 @@
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
sqle.printStackTrace();
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
} catch(Exception e){
System.out.println("V3-TEST : unable to get connection");
- e.printStackTrace();
+ e.printStackTrace();
}
System.out.println("V3-TEST : got connection");
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
/*
@@ -117,15 +117,15 @@
System.out.println("V3-TEST : returning connection");
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -136,409 +136,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -548,35 +548,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DataSource.java
index d90085d..51f1773 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,58 +51,58 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
re.printStackTrace();
- throw new SQLException (re.getMessage());
- }
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -115,91 +115,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/servlet/SimpleBankServlet.java
index efdf0d7..e209aac 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/servlet/SimpleBankServlet.java
@@ -17,16 +17,16 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
-import jakarta.ejb.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -42,14 +42,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -65,14 +65,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -89,7 +89,7 @@
customerSavings = customerSavingsLocalHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -102,7 +102,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -114,7 +114,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -126,12 +126,12 @@
customerSavingsLocalHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -141,7 +141,7 @@
customerSavings = (CustomerSavings)customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -150,7 +150,7 @@
customerChecking = (CustomerChecking)customerCheckingLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -210,9 +210,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb-resources-xml/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.xml
index d7e7fa1..c700654 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/build.xml
@@ -32,7 +32,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<!--
<target name="all" depends="build,setup,deploy-war, run-war, undeploy-war, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -41,15 +41,15 @@
<target name="all" depends="build, disable-resource-validation, deploy-ear, setup, run-ear, unsetup, undeploy-ear, enable-resource-validation"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
@@ -57,41 +57,41 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup">
- <antcall target="execute-sql-connector">
- <param name="sql.file" value="sql/simpleBank.sql"/>
- </antcall>
- <antcall target="create-pool"/>
- <antcall target="create-resource"/>
- <antcall target="create-admin-object"/>
+ <antcall target="execute-sql-connector">
+ <param name="sql.file" value="sql/simpleBank.sql"/>
+ </antcall>
+ <antcall target="create-pool"/>
+ <antcall target="create-resource"/>
+ <antcall target="create-admin-object"/>
</target>
- <target name="disable-resource-validation">
- <antcall target="create-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="disable-resource-validation">
+ <antcall target="create-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
- <target name="enable-resource-validation">
- <antcall target="delete-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="enable-resource-validation">
+ <antcall target="delete-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
<target name="create-pool">
- <antcall target="create-connector-connpool-common">
+ <antcall target="create-connector-connpool-common">
<param name="ra.name" value="${appname}App#jdbcra"/>
<param name="extra-params" value="--matchconnections=false"/>
<param name="connection.defname" value="javax.sql.DataSource"/>
<param name="connector.conpool.name" value="embedded-ra-pool"/>
</antcall>
<antcall target="set-oracle-props">
- <param name="pool.type" value="connector"/>
- <param name="conpool.name" value="embedded-ra-pool"/>
- </antcall>
+ <param name="pool.type" value="connector"/>
+ <param name="conpool.name" value="embedded-ra-pool"/>
+ </antcall>
</target>
<target name="create-resource">
<antcall target="create-connector-resource-common">
@@ -104,18 +104,18 @@
<target name="create-admin-object" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-subclassing:SchemaName=DBUSER:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
-
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -123,16 +123,16 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
<target name="unsetup">
@@ -144,7 +144,7 @@
<antcall target="delete-pool"/>
<antcall target="delete-admin-object"/>-->
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -154,7 +154,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -170,9 +170,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -181,35 +181,35 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="create-ra-config"/>
<antcall target="deploy-common"/>
@@ -218,29 +218,29 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="embeddedweb (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="embeddedweb (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="embeddedweb (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="embeddedweb (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common">
<param name="extra-params" value="--cascade=true"/>
</antcall>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/descriptor/sun-ejb-jar.xml
index 1d1200d..df4bb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/Customer.java
index 8a9b105..160eab9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/Customer.java
@@ -44,4 +44,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerChecking.java
index 61de291..b341c34 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerChecking.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerEJB.java
index 0520b60..07220db 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavings.java
index 338c921..883e04a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavings.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.xml
index cb6ff31..23a1a0c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index 70029f1..e966f98 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,169 +50,169 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
System.out.println("V3-TEST : " + dataSourceObject);
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
System.out.println("V3-TEST : " + dataSourceObject);
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index a956d97..11ad746 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/*
@@ -279,184 +279,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -506,162 +506,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 277efba..f7ea82b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -128,7 +128,7 @@
<config-property-value>testdb</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbuser</config-property-value>
@@ -139,12 +139,12 @@
<config-property-value>dbuser</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbpassword</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -154,7 +154,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>-->
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
@@ -165,17 +165,17 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
@@ -186,7 +186,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientDataSource40</config-property-value>
@@ -198,82 +198,82 @@
</config-property>
<!--
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
-->
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index a9fa5f1..b1fc0e5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,7 +68,7 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
@@ -78,36 +78,36 @@
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
sqle.printStackTrace();
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
} catch(Exception e){
System.out.println("V3-TEST : unable to get connection");
- e.printStackTrace();
+ e.printStackTrace();
}
System.out.println("V3-TEST : got connection");
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
/*
@@ -117,15 +117,15 @@
System.out.println("V3-TEST : returning connection");
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -136,409 +136,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -548,35 +548,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
index d90085d..51f1773 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,58 +51,58 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
re.printStackTrace();
- throw new SQLException (re.getMessage());
- }
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -115,91 +115,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/servlet/SimpleBankServlet.java
index bc7b55d..9892ff6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/servlet/SimpleBankServlet.java
@@ -17,16 +17,16 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
-import jakarta.ejb.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -42,14 +42,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -65,14 +65,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -89,7 +89,7 @@
customerSavings = customerSavingsLocalHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -102,7 +102,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -114,7 +114,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -126,12 +126,12 @@
customerSavingsLocalHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -141,7 +141,7 @@
customerSavings = (CustomerSavings)customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -150,7 +150,7 @@
customerChecking = (CustomerChecking)customerCheckingLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -210,9 +210,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/embeddedweb/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/build.xml
index 53f8dde..501f37c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/build.xml
@@ -36,8 +36,8 @@
<antcall target="build-ear"/>
<!--
<antcall target="ear-common">
- <param name="appname" value="generic-embedded"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="generic-embedded"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
-->
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/ejb-jar.xml
index e94042b..8e547c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/ejb-jar.xml
@@ -33,8 +33,8 @@
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/sun-ejb-jar.xml
index e73cb46..3fde230 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/META-INF/sun-ejb-jar.xml
@@ -25,7 +25,7 @@
<ejb>
<ejb-name>MyVersionChecker</ejb-name>
<jndi-name>MyVersionChecker</jndi-name>
-<!--
+<!--
<ior-security-config>
<transport-config>
<integrity>supported</integrity>
@@ -42,10 +42,10 @@
<caller-propagation>supported</caller-propagation>
</sas-context>
</ior-security-config>
--->
+-->
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/client/Client.java
index 7edb357..7663ed6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/client/Client.java
@@ -27,36 +27,36 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public static void main(String[] args) {
Client client = new Client();
- System.out.println("Client: Args: ");
- for(int i = 0 ; i< args.length; i++) {
- System.out.println("Client: Args: " + args[i]);
- }
- Integer versionNumber = new Integer(args[0]);
+ System.out.println("Client: Args: ");
+ for(int i = 0 ; i< args.length; i++) {
+ System.out.println("Client: Args: " + args[i]);
+ }
+ Integer versionNumber = new Integer(args[0]);
client.doTest(versionNumber.intValue());
}
-
+
public String doTest(int versionToTest) {
stat.addDescription("This is to test redeployment of connectors "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
- pass = checkResults(versionToTest);
- debug("Got expected results = " + pass);
-
- //do not continue if one test failed
- if (!pass) {
- res = "SOME TESTS FAILED";
- stat.addStatus("Redeploy Connector 1.5 test - ", stat.FAIL);
- } else {
- res = "ALL TESTS PASSED";
- stat.addStatus("Redeploy Connector 1.5 test - " , stat.PASS);
- }
+ pass = checkResults(versionToTest);
+ debug("Got expected results = " + pass);
+
+ //do not continue if one test failed
+ if (!pass) {
+ res = "SOME TESTS FAILED";
+ stat.addStatus("Redeploy Connector 1.5 test - ", stat.FAIL);
+ } else {
+ res = "ALL TESTS PASSED";
+ stat.addStatus("Redeploy Connector 1.5 test - " , stat.PASS);
+ }
} catch (Exception ex) {
System.out.println("Redeploy connector test failed.");
@@ -68,20 +68,20 @@
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
- debug("checkResult" + num);
- debug("got initial context" + (new InitialContext()).toString());
+ debug("checkResult" + num);
+ debug("got initial context" + (new InitialContext()).toString());
Object o = (new InitialContext()).lookup("MyVersionChecker");
- debug("got o" + o);
- VersionCheckerHome home = (VersionCheckerHome)
+ debug("got o" + o);
+ VersionCheckerHome home = (VersionCheckerHome)
PortableRemoteObject.narrow(o, VersionCheckerHome.class);
debug("got home" + home);
- VersionChecker checker = home.create();
- debug("got o" + checker);
+ VersionChecker checker = home.create();
+ debug("got o" + checker);
//problem here!
- int result = checker.getVersion();
- debug("checkResult" + result);
+ int result = checker.getVersion();
+ debug("checkResult" + result);
return result == num;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/ejb/VersionCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/ejb/VersionCheckerEJB.java
index a00913a..68211d8 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/ejb/VersionCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/app/src/ejb/VersionCheckerEJB.java
@@ -23,47 +23,47 @@
import com.sun.jdbcra.spi.JdbcSetupAdmin;
public class VersionCheckerEJB implements SessionBean {
- private InitialContext initContext = null;
- private SessionContext sessionContext = null;
+ private InitialContext initContext = null;
+ private SessionContext sessionContext = null;
public VersionCheckerEJB() {
debug("Constructor");
}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
- debug("ejbCreate()");
+ debug("ejbCreate()");
}
public int getVersion(){
- try {
- initContext = new javax.naming.InitialContext();
- } catch (Exception e) {
- System.out.println("Exception occured when creating InitialContext: " + e.toString());
- return -1;
- }
-
- try {
- JdbcSetupAdmin ja = (JdbcSetupAdmin) initContext.lookup("eis/jdbcAdmin");
- int versionno = ja.getVersion();
- debug("Version number is " + versionno);
- return versionno;
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException(e.getMessage());
- }
+ try {
+ initContext = new javax.naming.InitialContext();
+ } catch (Exception e) {
+ System.out.println("Exception occured when creating InitialContext: " + e.toString());
+ return -1;
+ }
+
+ try {
+ JdbcSetupAdmin ja = (JdbcSetupAdmin) initContext.lookup("eis/jdbcAdmin");
+ int versionno = ja.getVersion();
+ debug("Version number is " + versionno);
+ return versionno;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e.getMessage());
+ }
}
public void setSessionContext(SessionContext context) {
- debug(" bean removed");
+ debug(" bean removed");
sessionContext = context;
}
public void ejbRemove() {
- debug(" bean removed");
+ debug(" bean removed");
}
public void ejbActivate() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.properties
index fb2b4d8..44563e4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.properties
@@ -15,10 +15,10 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="force-deploy"/>
-<property name="appname" value="${module}-rar"/>
+<property name="appname" value="${module}-rar"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="test.client"
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.xml
index 851ded5..828b005 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/build.xml
@@ -39,7 +39,7 @@
<target name="compile" depends="clean">
<ant dir="ra" inheritAll="false" target="compile"/>
-
+
<antcall target="compile-common">
<param name="src" value="ejb"/>
<param name="s1astest.classpath" value="${s1astest.classpath}:./ra/publish/internal/classes/"/>
@@ -134,7 +134,7 @@
<antcall target="undeploy-common"/>
-
+
<antcall target="setuptwo"/>
<antcall target="deploy"/>
<java classname="client.WebTest">
@@ -220,7 +220,7 @@
<param name="failonerror" value="true"/>
</antcall>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="versiontest-ra-pool"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/client/Client.java
index f999a8a..492e79a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/client/Client.java
@@ -27,35 +27,35 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public static void main(String[] args) {
Client client = new Client();
- System.out.println("Client: Args: ");
- for(int i = 0 ; i< args.length; i++) {
- System.out.println("Client: Args: " + args[i]);
- }
- Integer versionNumber = new Integer(args[0]);
+ System.out.println("Client: Args: ");
+ for(int i = 0 ; i< args.length; i++) {
+ System.out.println("Client: Args: " + args[i]);
+ }
+ Integer versionNumber = new Integer(args[0]);
client.doTest(versionNumber.intValue());
}
-
+
public String doTest(int versionToTest) {
stat.addDescription("This is to test redeployment of connector modules. Testing version " + versionToTest);
-
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
- pass = checkResults(versionToTest);
- debug("Got expected results = " + pass);
-
- //do not continue if one test failed
- if (!pass) {
- res = "SOME TESTS FAILED";
- stat.addStatus("Redeploy Connector 1.5 test - Version : "+ versionToTest, stat.FAIL);
- } else {
- res = "ALL TESTS PASSED";
- stat.addStatus("Redeploy Connector 1.5 test - Version : " + versionToTest , stat.PASS);
- }
+ pass = checkResults(versionToTest);
+ debug("Got expected results = " + pass);
+
+ //do not continue if one test failed
+ if (!pass) {
+ res = "SOME TESTS FAILED";
+ stat.addStatus("Redeploy Connector 1.5 test - Version : "+ versionToTest, stat.FAIL);
+ } else {
+ res = "ALL TESTS PASSED";
+ stat.addStatus("Redeploy Connector 1.5 test - Version : " + versionToTest , stat.PASS);
+ }
} catch (Exception ex) {
System.out.println("Redeploy connector test failed.");
ex.printStackTrace();
@@ -66,20 +66,20 @@
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
- debug("checkResult" + num);
- debug("got initial context" + (new InitialContext()).toString());
+ debug("checkResult" + num);
+ debug("got initial context" + (new InitialContext()).toString());
Object o = (new InitialContext()).lookup("java:comp/env/ejb/MyVersionChecker");
- debug("got o" + o);
- VersionCheckerHome home = (VersionCheckerHome)
+ debug("got o" + o);
+ VersionCheckerHome home = (VersionCheckerHome)
PortableRemoteObject.narrow(o, VersionCheckerHome.class);
debug("got home" + home);
- VersionChecker checker = home.create();
- debug("got o" + checker);
+ VersionChecker checker = home.create();
+ debug("got o" + checker);
//problem here!
- int result = checker.getVersion();
- debug("checkResult" + result);
+ int result = checker.getVersion();
+ debug("checkResult" + result);
return result == num;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/ejb-jar.xml
index e94042b..8e547c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/ejb-jar.xml
@@ -33,8 +33,8 @@
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/sun-ejb-jar.xml
index cc5a3f9..e146722 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/descriptor/sun-ejb-jar.xml
@@ -25,7 +25,7 @@
<ejb>
<ejb-name>MyVersionChecker</ejb-name>
<jndi-name>ejb/MyVersionChecker</jndi-name>
-<!--
+<!--
<ior-security-config>
<transport-config>
<integrity>supported</integrity>
@@ -42,10 +42,10 @@
<caller-propagation>supported</caller-propagation>
</sas-context>
</ior-security-config>
--->
+-->
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.xml
index 73e9805..a988eb8 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/testjdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/testjdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index bfcbf0b..4ebed6e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/**
@@ -273,184 +273,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -500,162 +500,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index e60338f..c5ada46 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
public static final int VERSION = 2;
@@ -37,39 +37,39 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
/*
@@ -77,16 +77,16 @@
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
+ }
*/
}
-
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -96,5 +96,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 60e1e4e..65e8fb5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -122,136 +122,136 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>9092</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBUSER</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBPASSWORD</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DatabaseName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:pointbase:server://localhost:9092/sqe-samples,new</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>NetworkProtocol</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Delimiter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>com.pointbase.jdbc.jdbcDataSource</config-property-value>
</config-property>
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
-
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 411b73f..d9874a0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,55 +68,55 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
setIsolation(mc);
isValid(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -127,409 +127,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -539,35 +539,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DataSource.java
index 2068430..739ff4d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,91 +114,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index ae16b51..824510d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,8 +34,8 @@
public Integer getNoOfRows();
- public boolean checkSetup();
-
+ public boolean checkSetup();
+
public int getVersion();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 1a9e5c6..c72d74c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -66,62 +66,62 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- DataSource ds = (DataSource) ic.lookup(jndiName);
+ InitialContext ic = new InitialContext();
+ DataSource ds = (DataSource) ic.lookup(jndiName);
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
}
-
+ System.out.println("Returning setup :" +b);
+ return b;
+ }
+
public int getVersion(){
- return ResourceAdapter.VERSION;
+ return ResourceAdapter.VERSION;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/force-deploy-rar/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.properties
index 5923fe3..862a084 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="installed-libraries"/>
<property name="appname" value="${module}-embedded"/>
@@ -24,7 +24,7 @@
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="installed_libraries_embedded"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.xml
index 9089c0c..9a913f9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/build.xml
@@ -42,22 +42,22 @@
<target name="all-ext" depends="clean, disable-resource-validation, build-ra-with-extension, build, deploy-ear, setup, run-ear, unsetup, undeploy-ear, enable-resource-validation"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="setup">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
@@ -71,13 +71,13 @@
<antcall target="create-connector-connpool-common">
<param name="ra.name" value="${appname}App#jdbcra"/>
<param name="connection.defname" value="javax.sql.DataSource"/>
- <param name="extra-params" value="--matchconnections=false"/>
+ <param name="extra-params" value="--matchconnections=false"/>
<param name="connector.conpool.name" value="embedded-ra-pool"/>
</antcall>
<antcall target="set-oracle-props">
- <param name="pool.type" value="connector"/>
- <param name="conpool.name" value="embedded-ra-pool"/>
- </antcall>
+ <param name="pool.type" value="connector"/>
+ <param name="conpool.name" value="embedded-ra-pool"/>
+ </antcall>
</target>
<target name="create-resource">
<antcall target="create-connector-resource-common">
@@ -86,53 +86,53 @@
</antcall>
</target>
- <target name="disable-resource-validation">
- <antcall target="create-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="disable-resource-validation">
+ <antcall target="create-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
- <target name="enable-resource-validation">
- <antcall target="delete-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="enable-resource-validation">
+ <antcall target="delete-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
<target name="create-admin-object" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-installed-libraries-embedded:SchemaName=DBUSER:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
-
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
-
+
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
<target name="unsetup">
@@ -144,7 +144,7 @@
<antcall target="delete-pool"/>
<antcall target="delete-admin-object"/>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -154,7 +154,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-installed-libraries-embedded"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -169,9 +169,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
<target name="build-ra-with-extension">
@@ -189,27 +189,27 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
@@ -245,28 +245,28 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="installed-libraries-embedded (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="installed-libraries-embedded (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="installed-libraries-embedded (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="installed-libraries-embedded (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common"/>
<antcall target="uninstall-library"/>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/descriptor/sun-ejb-jar.xml
index cf55e21..0a31162 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-installed-libraries-embedded</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-installed-libraries-embedded</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/Customer.java
index ac9c971..f8324ba 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/Customer.java
@@ -44,4 +44,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerChecking.java
index 1149f38..c1200a7 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerChecking.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerCheckingEJB.java
index 82c41a6..8868e6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerEJB.java
index 0f9c9af..ab87030 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -147,7 +147,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -214,12 +214,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavings.java
index ae40c68..3675711 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavings.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavingsEJB.java
index 9f5b76b..d58bab5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.xml
index 045d794..fb30972 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/build.xml
@@ -21,64 +21,64 @@
<!ENTITY testcommon SYSTEM "../../../../../config/properties.xml">
]>
-<project name="JDBCConnector top level" default="build">
+<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="clean,compile,assemble"/>
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
+ failonerror="true">
+ <classpath>
<fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
+ <include name="**/*.jar" />
</fileset>
- </classpath>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar" manifest="${jar.mf}"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar" manifest="${jar.mf}"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" manifest="${rar.mf}" excludes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" manifest="${rar.mf}" excludes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index 70029f1..e966f98 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,169 +50,169 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
System.out.println("V3-TEST : " + dataSourceObject);
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
System.out.println("V3-TEST : " + dataSourceObject);
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index a956d97..11ad746 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/*
@@ -279,184 +279,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -506,162 +506,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 1be4ded..4362561 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -24,8 +24,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
@Connector(
description = "Resource adapter wrapping Datasource implementation of driver",
@@ -49,52 +49,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -104,5 +104,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 2c29be6..09ce63d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -28,7 +28,7 @@
<outbound-resourceadapter>
<connection-definition>
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>User</config-property-name>
@@ -50,7 +50,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>testdb</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -60,7 +60,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientDataSource40</config-property-value>
@@ -77,7 +77,7 @@
<connection-interface>java.sql.Connection</connection-interface>
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
<transaction-support>LocalTransaction</transaction-support>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 85916e5..99a46e1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,8 +31,8 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
@ConnectionDefinition(
@@ -42,31 +42,31 @@
connectionFactoryImpl = com.sun.jdbcra.spi.DataSource.class
)
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -74,7 +74,7 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
@@ -84,36 +84,36 @@
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
sqle.printStackTrace();
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
} catch(Exception e){
System.out.println("V3-TEST : unable to get connection");
- e.printStackTrace();
+ e.printStackTrace();
}
System.out.println("V3-TEST : got connection");
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
/*
@@ -123,15 +123,15 @@
System.out.println("V3-TEST : returning connection");
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -142,38 +142,38 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
@ConfigProperty(
defaultValue = "localhost",
@@ -182,42 +182,42 @@
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
@ConfigProperty(
defaultValue = "1527",
@@ -226,42 +226,42 @@
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
@ConfigProperty(
defaultValue="testdb",
@@ -270,42 +270,42 @@
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
@ConfigProperty(
type=java.lang.String.class
@@ -313,203 +313,203 @@
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
@ConfigProperty(
defaultValue = "#",
@@ -518,52 +518,52 @@
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -573,35 +573,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DataSource.java
index d90085d..51f1773 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,58 +51,58 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
re.printStackTrace();
- throw new SQLException (re.getMessage());
- }
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -115,91 +115,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index f89be57..fc3a957 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -84,11 +84,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -97,10 +97,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -109,93 +109,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/servlet/SimpleBankServlet.java
index a8205cf..be9d2f5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/servlet/SimpleBankServlet.java
@@ -17,16 +17,16 @@
package samples.ejb.installed_libraries_embedded.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
-import jakarta.ejb.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
+import jakarta.ejb.*;
import samples.ejb.installed_libraries_embedded.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -42,14 +42,14 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -65,14 +65,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -89,7 +89,7 @@
customerSavings = customerSavingsLocalHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -102,7 +102,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -114,7 +114,7 @@
customerSavings = customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -126,12 +126,12 @@
customerSavingsLocalHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -141,7 +141,7 @@
customerSavings = (CustomerSavings)customerSavingsLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -150,7 +150,7 @@
customerChecking = (CustomerChecking)customerCheckingLocalHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -210,9 +210,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-embedded/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/build.properties
index 4434f01..7e1b0c1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="installed-libraries-test"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="rarfile" value="rar/blackbox-tx.rar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/descriptor/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/descriptor/glassfish-resources.xml
index 71d89c4..afcfbd3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/descriptor/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/descriptor/glassfish-resources.xml
@@ -46,4 +46,4 @@
<property name="booleanWithGetBooleanAccessor" value="true" />
</connector-connection-pool>
<connector-resource pool-name="installed-libraries-test-ccp" jndi-name="eis/connector-resource" />
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/JdbcConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/JdbcConnection.java
index fa64959..bb3656a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/JdbcConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/JdbcConnection.java
@@ -183,7 +183,7 @@
}
/////////////////////////////////////////////
- // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
+ // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
/////////////////////////////////////////////
///////////// BEGIN JDK 1.4 //////////////
@@ -329,27 +329,27 @@
}
///////////// END JDK 1.4 //////////////
-
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
void associateConnection(JdbcManagedConnection newMc)
throws ResourceException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
index 0e47ddc..a968601 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
@@ -109,7 +109,7 @@
if (!getBooleanWithGetBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Get Boolean Accessor is false");
}
-
+
if (!isBooleanWithIsBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Is Boolean Accessor is false");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
index 8f2f354..7925098 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
@@ -44,7 +44,7 @@
}
public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException {
- return null;
+ return null;
}
public BootstrapContext getBootstrapContext(){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/servlet/SimpleServlet.java
index 0fb1406..362849b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/servlet/SimpleServlet.java
@@ -74,7 +74,7 @@
}catch(NamingException ne){
ne.printStackTrace();
} catch (CreateException e) {
- e.printStackTrace();
+ e.printStackTrace();
}finally{
out.println("END_OF_TEST");
out.flush();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/create_pointbase.sql
index 4234115..ed6dbab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/create_pointbase.sql
@@ -1,20 +1,20 @@
-Drop table TXLEVELSWITCH;
-
-CREATE TABLE TXLEVELSWITCH (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
-INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
-
-Drop table TXLEVELSWITCH2;
-
-CREATE TABLE TXLEVELSWITCH2 (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
-INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
-
+Drop table TXLEVELSWITCH;
+
+CREATE TABLE TXLEVELSWITCH (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
+INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
+
+Drop table TXLEVELSWITCH2;
+
+CREATE TABLE TXLEVELSWITCH2 (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
+INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/drop_pointbase.sql
index 0c1242f..d11a115 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries-resources/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table TXLEVELSWITCH;
-Drop table TXLEVELSWITCH2;
+Drop table TXLEVELSWITCH;
+Drop table TXLEVELSWITCH2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/build.properties
index 4434f01..7e1b0c1 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="installed-libraries-test"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="rarfile" value="rar/blackbox-tx.rar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/JdbcConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/JdbcConnection.java
index fa64959..bb3656a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/JdbcConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/JdbcConnection.java
@@ -183,7 +183,7 @@
}
/////////////////////////////////////////////
- // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
+ // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
/////////////////////////////////////////////
///////////// BEGIN JDK 1.4 //////////////
@@ -329,27 +329,27 @@
}
///////////// END JDK 1.4 //////////////
-
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
void associateConnection(JdbcManagedConnection newMc)
throws ResourceException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
index 0e47ddc..a968601 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
@@ -109,7 +109,7 @@
if (!getBooleanWithGetBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Get Boolean Accessor is false");
}
-
+
if (!isBooleanWithIsBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Is Boolean Accessor is false");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
index 8f2f354..7925098 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
@@ -44,7 +44,7 @@
}
public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException {
- return null;
+ return null;
}
public BootstrapContext getBootstrapContext(){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/servlet/SimpleServlet.java
index 0fb1406..362849b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/servlet/SimpleServlet.java
@@ -74,7 +74,7 @@
}catch(NamingException ne){
ne.printStackTrace();
} catch (CreateException e) {
- e.printStackTrace();
+ e.printStackTrace();
}finally{
out.println("END_OF_TEST");
out.flush();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/create_pointbase.sql
index 4234115..ed6dbab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/create_pointbase.sql
@@ -1,20 +1,20 @@
-Drop table TXLEVELSWITCH;
-
-CREATE TABLE TXLEVELSWITCH (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
-INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
-
-Drop table TXLEVELSWITCH2;
-
-CREATE TABLE TXLEVELSWITCH2 (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
-INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
-
+Drop table TXLEVELSWITCH;
+
+CREATE TABLE TXLEVELSWITCH (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
+INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
+
+Drop table TXLEVELSWITCH2;
+
+CREATE TABLE TXLEVELSWITCH2 (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
+INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/drop_pointbase.sql
index 0c1242f..d11a115 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/installed-libraries/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table TXLEVELSWITCH;
-Drop table TXLEVELSWITCH2;
+Drop table TXLEVELSWITCH;
+Drop table TXLEVELSWITCH2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jms-connection-factory-definition/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/jms-connection-factory-definition/build.properties
index 88aaaea..6cd1dda 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jms-connection-factory-definition/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jms-connection-factory-definition/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="jms-connection-factory-definition"/>
<property name="appname" value="${module}"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jms-destination-definition/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/jms-destination-definition/build.properties
index 90d184e..93ec2e8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jms-destination-definition/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jms-destination-definition/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="jms-destination-definition"/>
<property name="appname" value="${module}"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.properties
index 5d78233..299559b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.properties
@@ -15,10 +15,10 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="ejb-ejb30-persistence-tx_propagation"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="simple.client" value="com.sun.s1asdev.ejb.ejb30.persistence.tx_propagation.client.Client"/>
<property name="test.client" value="Client"/>
@@ -26,10 +26,10 @@
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.xml
index 713334c..d77e681 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/build.xml
@@ -34,7 +34,7 @@
<target name="clean" depends="init-common">
<antcall target="clean-common"/>
</target>
-
+
<target name="compile" depends="clean">
<antcall target="compile-common">
<param name="src" value="ejb"/>
@@ -51,7 +51,7 @@
<param name="jdbc.resource.type" value="javax.sql.XADataSource"/>
<param name="jdbc.resource.name" value="jdbc/xa"/>
</antcall>
- <antcall target="asadmin-common">
+ <antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props"
value="${resources.dottedname.prefix}.jdbc-connection-pool.jdbc-xa-pool.property.connectionAttributes=;create=true"/>
@@ -81,10 +81,10 @@
<target name="build" depends="compile">
<mkdir dir="${assemble.dir}/lib"/>
- <jar destfile="${assemble.dir}/lib/${appname}-lib.jar"
+ <jar destfile="${assemble.dir}/lib/${appname}-lib.jar"
basedir="${build.classes.dir}"
includes="**/Person.class">
- </jar>
+ </jar>
<jar destfile="${assemble.dir}/lib/${appname}-par1.jar">
<metainf file="descriptor/persistence.xml"/>
</jar>
@@ -92,9 +92,9 @@
</copy>-->
<antcall target="build-ear-common">
- <param name="ejbjar.classes"
+ <param name="ejbjar.classes"
value="**/Sful*.class"/>
- <param name="appclientjar.classes"
+ <param name="appclientjar.classes"
value="**/Client.class,**/Sful.class"/>
<param name="glassfish-resources-ear.xml" value="descriptor/glassfish-resources.xml"/>
</antcall>
@@ -103,9 +103,9 @@
includes="lib/${appname}-lib.jar, lib/${appname}-par1.jar">
</jar>
- </target>
-
- <target name="deploy"
+ </target>
+
+ <target name="deploy"
depends="init-common">
<antcall target="deploy-common"/>
</target>
@@ -114,10 +114,10 @@
<antcall target="runclient-common"/>
<!-- <antcall target="runclient-standalone"/>-->
</target>
-
+
<target name="undeploy" depends="init-common">
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/client/Client.java
index 7467c41..6060593 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/client/Client.java
@@ -64,7 +64,7 @@
PreparedStatement s = null;
try {
System.err.println("I am in client");
-
+
UserTransaction utx = (UserTransaction)(new javax.naming.InitialContext()).lookup("java:comp/UserTransaction");
ds = (DataSource)(new javax.naming.InitialContext()).lookup("java:app/jdbc/xa");
@@ -78,7 +78,7 @@
utx.begin();
System.err.println("utx.begin called ");
-
+
connection = ds.getConnection();
s = connection.prepareStatement("insert into EJB30_PERSISTENCE_EEM_INJECTION_PERSON values('1', '1')");
s.execute();
@@ -94,7 +94,7 @@
utx.rollback();
System.err.println("utx.rollback called ");
}
-
+
Iterator<String> iter = map.keySet().iterator();
while (iter.hasNext()) {
String testName = iter.next();
@@ -125,7 +125,7 @@
}
- return;
+ return;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/descriptor/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/descriptor/glassfish-resources.xml
index 0786c54..ccdeaa4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/descriptor/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/descriptor/glassfish-resources.xml
@@ -51,4 +51,4 @@
<property name="connectionAttributes" value=";create=true" />
</jdbc-connection-pool>
<jdbc-resource pool-name="java:app/jdbc-xa-pool" jndi-name="java:app/jdbc/xa" />
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/Person.java b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/Person.java
index 14358ff..952cbec 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/Person.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/Person.java
@@ -45,7 +45,7 @@
this.data = data;
}
- @Override
+ @Override
public String toString() {
return "Person: (name=" + name + "; data= " + data + ")";
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulBean.java
index 3d4f30b..4b24df7 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulBean.java
@@ -34,25 +34,25 @@
import jakarta.ejb.EJBException;
@Stateful
-@EJB(name="ejb/SfulBean",
+@EJB(name="ejb/SfulBean",
beanInterface=com.sun.s1asdev.ejb.ejb30.persistence.tx_propagation.SfulDelegate.class)
public class SfulBean
implements Sful {
private String name;
-
+
private @EJB SfulDelegate delegate;
-
+
private @PersistenceContext(unitName="lib/ejb-ejb30-persistence-tx_propagation-par1.jar#em",
- type=PersistenceContextType.EXTENDED)
+ type=PersistenceContextType.EXTENDED)
EntityManager extendedEM;
-
+
public void setName(String name) {
this.name = name;
try {
String lookupName = "java:comp/env/ejb/SfulBean";
-
+
InitialContext initCtx = new InitialContext();
delegate = (SfulDelegate) initCtx.lookup(lookupName);
} catch (Exception ex) {
@@ -62,7 +62,7 @@
public Map<String, Boolean> doTests() {
Person person = new Person(name);
-
+
String delegateName = "delgname_" + name;
String delegateData= "delgdata: " + name;
delegate.create(delegateName, delegateData);
@@ -71,8 +71,8 @@
extendedEM.persist(person);
Person foundPerson = delegate.find(name);
-
-
+
+
Map<String, Boolean> map = new HashMap<String, Boolean>();
map.put("findDelegateCreatedPerson", (dPerson != null));
map.put("delegateFoundMe", (foundPerson != null));
@@ -100,5 +100,5 @@
}
return removed;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegate.java b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegate.java
index 62d2097..337a43f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegate.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegate.java
@@ -28,7 +28,7 @@
Person find(String name);
boolean remove(String name);
-
+
EntityManager getEM();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegateBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegateBean.java
index 8a96e20..f7a7aad 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegateBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/ejb/SfulDelegateBean.java
@@ -37,12 +37,12 @@
public EntityManager getEM() {
return extendedEM;
}
-
+
public Person create(String name, String data) {
Person p = new Person(name);
p.setData(data);
-
+
extendedEM.persist(p);
return p;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/create.sql b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/create.sql
index fa60742..c0ab43f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/create.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/create.sql
@@ -1,4 +1,4 @@
-CREATE TABLE EJB30_PERSISTENCE_EEM_INJECTION_PERSON (
- NAME VARCHAR(256) NOT NULL PRIMARY KEY,
- DATA VARCHAR(256)
-);
+CREATE TABLE EJB30_PERSISTENCE_EEM_INJECTION_PERSON (
+ NAME VARCHAR(256) NOT NULL PRIMARY KEY,
+ DATA VARCHAR(256)
+);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/drop.sql b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/drop.sql
index 5eb136f..d012c69 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/drop.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/jpa-tx-propagation-gf-resources-xml/sql/drop.sql
@@ -1 +1 @@
-DROP TABLE EJB30_PERSISTENCE_EEM_INJECTION_PERSON;
+DROP TABLE EJB30_PERSISTENCE_EEM_INJECTION_PERSON;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/META-INF/glassfish-resources.xml
index 21be062..b741fed 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/META-INF/glassfish-resources.xml
@@ -72,4 +72,4 @@
<property name="ResetControl" value="BEGINNING"/>
</admin-object-resource>-->
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-gf-resources.xml
index 3eae403..389779a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-gf-resources.xml
@@ -57,4 +57,4 @@
<admin-object-resource enabled="true" jndi-name="java:module/eis/testAdmin" object-type="user" res-adapter="generic-ra" res-type="connector.MyAdminObject">
<property name="ResetControl" value="BEGINNING"/>
</admin-object-resource>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-jar.xml
index 582b781..12fb6d3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/ejb-jar.xml
@@ -114,8 +114,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/sun-ejb-jar.xml
index b88a868..69b0149 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/sun-ejb-jar.xml
@@ -32,7 +32,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -84,7 +84,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:module/eis/testAdmin</jndi-name>
+ <jndi-name>java:module/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/web-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/web-gf-resources.xml
index 816d5a9..c658a07 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/web-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/META-INF/web-gf-resources.xml
@@ -53,4 +53,4 @@
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/web-level-ds" object-type="user" pool-name="java:module/jdbc/web-level-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/beans/MessageCheckerEJB.java
index 3f653e3..e4a50f4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -73,7 +73,7 @@
System.out.println("mao.getRA() is null");
}
}catch(Exception e){
- e.printStackTrace();
+ e.printStackTrace();
}
try{
@@ -97,11 +97,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -120,22 +120,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -161,10 +161,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -199,7 +199,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -210,7 +210,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/client/Client.java
index 9343506..3939257 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("connector1.6ID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/mdb/MyMessageBean.java
index b7427aa..62c42ad 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/mdb/MyMessageBean.java
@@ -29,41 +29,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -74,7 +74,7 @@
//log("onMessage:: getCallerPrincipal : " + mdc.getCallerPrincipal());
//System.out.println("onMessage : ThreadID : " + Thread.currentThread().getName());
if(mdc.getCallerPrincipal() != null){
- log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
+ log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
}
log("onMessage : isCallerInRole('jagadish') : " + mdc.isCallerInRole("jagadish"));
@@ -83,7 +83,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -97,10 +97,10 @@
ex.printStackTrace();
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -110,62 +110,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -176,7 +176,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -185,9 +185,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -203,9 +203,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -218,9 +218,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/servlet/SimpleServlet.java
index ea0d5d1..97a63e3 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/app/src/servlet/SimpleServlet.java
@@ -45,17 +45,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.6 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
@@ -94,18 +94,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.6 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.6 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/build.properties
index 207a486..083b262 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/connector16/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/glassfish-resources.xml
index a9349fc..0fcabdd 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/glassfish-resources.xml
@@ -48,4 +48,4 @@
<principal-map eis-principal="eis-prasath" mapped-principal="prasath" />
<principal-map eis-principal="eis-jagadish" mapped-principal="jagadish" />
</work-security-map>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/ra.xml
index 9781e16..3ccf296 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/META-INF/ra.xml
@@ -51,7 +51,7 @@
</config-property-confidential>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -62,7 +62,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/build.xml
index ed29889..8528818 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/JSR322Work.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/JSR322Work.java
index 5107ac1..0203f4a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/JSR322Work.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/JSR322Work.java
@@ -48,6 +48,6 @@
public void run(){
super.run();
-
+
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MyAdminObject.java
index a68a5b7..9c28812 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MyAdminObject.java
@@ -51,11 +51,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MySecurityContext.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MySecurityContext.java
index 3178c1c..e19051e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MySecurityContext.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/MySecurityContext.java
@@ -62,7 +62,7 @@
CallerPrincipalCallback cpc = new CallerPrincipalCallback(execSubject, new PrincipalImpl(principalName));
debug("setting caller principal callback with principal : " + principalName);
callbacks.add(cpc);
-
+
/*
GroupPrincipalCallback gpc = new GroupPrincipalCallback(execSubject, null);
callbacks.add(gpc);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/WorkDispatcher.java
index ddff005..4e921a2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/WorkDispatcher.java
@@ -86,7 +86,7 @@
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/XID.java
index 18a970d..b2a906c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources-app-module-scoped/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/META-INF/glassfish-resources.xml
index 3bb4549..8cdf859 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/META-INF/glassfish-resources.xml
@@ -73,4 +73,4 @@
</admin-object-resource>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-gf-resources.xml
index fe4a090..d7f8f9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-gf-resources.xml
@@ -53,4 +53,4 @@
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="java:module/jdbc/ejb-level-ds" object-type="user" pool-name="java:module/jdbc/ejb-level-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-jar.xml
index 582b781..12fb6d3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/ejb-jar.xml
@@ -114,8 +114,8 @@
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>connector.MyAdminObject</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/sun-ejb-jar.xml
index e46577f..cb8cd23 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/sun-ejb-jar.xml
@@ -33,7 +33,7 @@
TestIntegerProp
</activation-config-property-name>
<activation-config-property-value>
- 2
+ 2
</activation-config-property-value>
</activation-config-property>
</activation-config>
@@ -85,7 +85,7 @@
</resource-ref>
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>java:app/eis/testAdmin</jndi-name>
+ <jndi-name>java:app/eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/web-gf-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/web-gf-resources.xml
index ae6fc11..8c2976f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/web-gf-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/META-INF/web-gf-resources.xml
@@ -53,4 +53,4 @@
</jdbc-connection-pool>
<jdbc-resource enabled="true" jndi-name="jdbc/web-level-ds" object-type="user" pool-name="jdbc/web-level-pool"/>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/beans/MessageCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/beans/MessageCheckerEJB.java
index b648e91..21f7e92 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/beans/MessageCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/beans/MessageCheckerEJB.java
@@ -40,7 +40,7 @@
public MessageCheckerEJB() {}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
System.out.println("bean created");
heldCon = null;
@@ -73,7 +73,7 @@
System.out.println("mao.getRA() is null");
}
}catch(Exception e){
- e.printStackTrace();
+ e.printStackTrace();
}
try{
@@ -98,11 +98,11 @@
try {
synchronized (Controls.getLockObject()) {
//Tell the resource adapter the client is ready to run
- Controls.getLockObject().notifyAll();
-
+ Controls.getLockObject().notifyAll();
+
debug("NOTIFIED... START WAITING");
//Wait until being told to read from the database
- Controls.getLockObject().wait();
+ Controls.getLockObject().wait();
}
} catch (Exception ex) {
ex.printStackTrace();
@@ -121,22 +121,22 @@
}
public int getMessageCount() {
- try {
+ try {
Connection con = getFreshConnection();
int count1 = getCount(con);
con.close();
-
- /*
+
+ /*
synchronized(Controls.getLockObject()) {
Controls.getLockObject().notify();
}
- */
-
+ */
+
return count1;
} catch (Exception e) {
e.printStackTrace(System.out);
throw new EJBException(e);
- }
+ }
}
private int getCount(Connection con) throws SQLException {
@@ -162,10 +162,10 @@
Context ic = new InitialContext();
user = (String) ic.lookup("java:comp/env/user");
password = (String) ic.lookup("java:comp/env/password");
- Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
- System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
- Controls.initialize();
- System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
+ Controls = (MyAdminObject) ic.lookup("java:comp/env/eis/testAdmin");
+ System.out.println("CALLING INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]");
+ Controls.initialize();
+ System.out.println("CALLED INITILIZE ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]" + Controls);
} catch (Exception ex) {
ex.printStackTrace();
}
@@ -200,7 +200,7 @@
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
con = ds.getConnection();
-
+
if (con != null) {
return con;
} else {
@@ -211,7 +211,7 @@
throw ex1;
}
}
-
+
private void closeConnection(Connection con) throws SQLException {
if (heldCon != null) {
return;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/build.properties
index dad207b..0b38c19 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
ejb-jar.xml=META-INF/ejb-jar.xml
sun-ejb-jar.xml=META-INF/sun-ejb-jar.xml
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/client/Client.java
index 9343506..3939257 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/client/Client.java
@@ -28,45 +28,45 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public Client (String[] args) {
//super(args);
}
-
+
public static void main(String[] args) {
Client client = new Client(args);
client.doTest();
}
-
+
public String doTest() {
stat.addDescription("This is to test connector 1.5 "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
while (!done()) {
-
+
notifyAndWait();
if (!done()) {
debug("Running...");
pass = checkResults(expectedResults());
debug("Got expected results = " + pass);
-
+
//do not continue if one test failed
if (!pass) {
res = "SOME TESTS FAILED";
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.FAIL);
} else {
stat.addStatus("ID Connector 1.6 test - " + testCount, stat.PASS);
- }
+ }
} else {
break;
}
- testCount ++;
+ testCount ++;
}
} catch (Exception ex) {
@@ -76,14 +76,14 @@
}
stat.printSummary("connector1.6ID");
-
+
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
int result = checker.getMessageCount();
@@ -92,7 +92,7 @@
private boolean done() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.done();
@@ -100,7 +100,7 @@
private int expectedResults() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
return checker.expectedResults();
@@ -108,7 +108,7 @@
private void notifyAndWait() throws Exception {
Object o = (new InitialContext()).lookup("MyMessageChecker");
- MessageCheckerHome home = (MessageCheckerHome)
+ MessageCheckerHome home = (MessageCheckerHome)
PortableRemoteObject.narrow(o, MessageCheckerHome.class);
MessageChecker checker = home.create();
checker.notifyAndWait();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/mdb/MyMessageBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/mdb/MyMessageBean.java
index 78a3ee9..3ab0c2a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/mdb/MyMessageBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/mdb/MyMessageBean.java
@@ -30,41 +30,41 @@
/**
*/
-public class MyMessageBean implements MessageDrivenBean,
+public class MyMessageBean implements MessageDrivenBean,
MyMessageListener {
private transient MessageDrivenContext mdc = null;
private Context context;
-
+
/**
* Constructor, which is public and takes no arguments.
*/
public MyMessageBean() {}
/**
- * setMessageDrivenContext method, declared as public (but
- * not final or static), with a return type of void, and
+ * setMessageDrivenContext method, declared as public (but
+ * not final or static), with a return type of void, and
* with one argument of type jakarta.ejb.MessageDrivenContext.
*
* @param mdc the context to set
*/
public void setMessageDrivenContext(MessageDrivenContext mdc) {
- this.mdc = mdc;
+ this.mdc = mdc;
}
/**
- * ejbCreate method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbCreate method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbCreate() { }
/**
- * onMessage method, declared as public (but not final or
+ * onMessage method, declared as public (but not final or
* static), with a return type of void, and with one argument
* of type jakarta.jms.Message.
*
- * Casts the incoming Message to a TextMessage and displays
+ * Casts the incoming Message to a TextMessage and displays
* the text.
*
* @param inMessage the incoming message
@@ -75,7 +75,7 @@
//log("onMessage:: getCallerPrincipal : " + mdc.getCallerPrincipal());
//System.out.println("onMessage : ThreadID : " + Thread.currentThread().getName());
if(mdc.getCallerPrincipal() != null){
- log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
+ log("onMessage:: getCallerPrincipal Name : " + mdc.getCallerPrincipal().getName());
}
log("onMessage : isCallerInRole('jagadish') : " + mdc.isCallerInRole("jagadish"));
@@ -84,7 +84,7 @@
try {
if (inMessage.endsWith("WRITE")) {
- doDbStuff("WRITE",
+ doDbStuff("WRITE",
inMessage.substring(0, inMessage.lastIndexOf(":")));
} else if (inMessage.endsWith("DELETE")) {
doDbStuff("DELETE",
@@ -98,10 +98,10 @@
ex.printStackTrace();
}
}
-
+
/**
- * ejbRemove method, declared as public (but not final or
- * static), with a return type of void, and with no
+ * ejbRemove method, declared as public (but not final or
+ * static), with a return type of void, and with no
* arguments.
*/
public void ejbRemove() {}
@@ -111,62 +111,62 @@
java.sql.Connection dbConnection = null;
String id = message.substring(0, message.indexOf(":"));
- String body = message.substring(message.indexOf(":")+1);
+ String body = message.substring(message.indexOf(":")+1);
try {
Context ic = new InitialContext();
-
+
if ("READ".equals(op)) {
-
+
debug("Reading row from database...");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
debug("Looked up Datasource\n");
debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
Statement stmt = dbConnection.createStatement();
- String query =
+ String query =
"SELECT id from messages where id = 'QQ'";
ResultSet results = stmt.executeQuery(query);
results.next();
- System.out.println("QQ has balance " +
+ System.out.println("QQ has balance " +
results.getInt("balance") + " dollars");
results.close();
stmt.close();
-
+
System.out.println("Read one account\n");
} else if ("WRITE".equals(op)) {
debug("Inserting one message in the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
createRow(id, body, dbConnection);
System.out.println("Created one message\n");
-
+
} else if ("DELETE".equals(op)) {
-
+
debug("Deleting one message from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
//debug("Get JDBC connection, auto sign on");
dbConnection = ds.getConnection();
-
+
deleteRow(id, dbConnection);
System.out.println("Deleted one message\n");
} else if ("DELETE_ALL".equals(op)) {
-
+
debug("Deleting all messages from the database\n");
-
+
// Creating a database connection
DataSource ds = (DataSource) ic.lookup("java:comp/env/MyDB");
//debug("Looked up Datasource\n");
@@ -177,7 +177,7 @@
} else {
//unsupported op
}
-
+
}finally{
try{
dbConnection.close();
@@ -186,9 +186,9 @@
}
}
}
-
- private void createRow(String id, String body,
- java.sql.Connection dbConnection)
+
+ private void createRow(String id, String body,
+ java.sql.Connection dbConnection)
throws Exception {
// Create row for this message
@@ -204,9 +204,9 @@
stmt.close();
}
- private void deleteRow(String id, java.sql.Connection dbConnection)
+ private void deleteRow(String id, java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
debug("DeleteRow with ID = " + id);
Statement stmt = dbConnection.createStatement();
@@ -219,9 +219,9 @@
stmt.close();
}
- private void deleteAll(java.sql.Connection dbConnection)
+ private void deleteAll(java.sql.Connection dbConnection)
throws Exception {
-
+
// Delete row for this message
Statement stmt = dbConnection.createStatement();
String query = "DELETE FROM messages";
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/servlet/SimpleServlet.java
index ac89e36..63878c6 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/app/src/servlet/SimpleServlet.java
@@ -45,17 +45,17 @@
public String doTest(HttpServletRequest request, HttpServletResponse response) throws IOException{
System.out.println("This is to test connector 1.6 "+
- "contracts.");
+ "contracts.");
response.setContentType("text/html");
PrintWriter out = response.getWriter();
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
res = "ALL TESTS PASSED";
- int testCount = 1;
+ int testCount = 1;
out.println("Starting the test");
out.flush();
@@ -94,18 +94,18 @@
res = "SOME TESTS FAILED";
System.out.println("ID Connector 1.6 test - " + testCount + " FAIL");
out.println("TEST:FAIL");
-
+
} else {
System.out.println("ID Connector 1.6 test - " + testCount + " PASS");
out.println("TEST:PASS");
- }
+ }
} else {
out.println("END_OF_EXECUTION");
break;
}
}
out.println("END_OF_EXECUTION");
-
+
} catch (Exception ex) {
System.out.println("Importing transaction test failed.");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/build.properties
index 207a486..083b262 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="contextroot" value="/connector16/servlet"/>
<property name="http:host" value="localhost"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/glassfish-resources.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/glassfish-resources.xml
index a9349fc..0fcabdd 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/glassfish-resources.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/glassfish-resources.xml
@@ -48,4 +48,4 @@
<principal-map eis-principal="eis-prasath" mapped-principal="prasath" />
<principal-map eis-principal="eis-jagadish" mapped-principal="jagadish" />
</work-security-map>
-</resources>
+</resources>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/ra.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/ra.xml
index 9781e16..3ccf296 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/ra.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/META-INF/ra.xml
@@ -51,7 +51,7 @@
</config-property-confidential>
</config-property>
<inbound-resourceadapter>
- <messageadapter>
+ <messageadapter>
<messagelistener>
<messagelistener-type>
connector.MyMessageListener
@@ -62,7 +62,7 @@
</activationspec-class>
</activationspec>
</messagelistener>
- </messageadapter>
+ </messageadapter>
</inbound-resourceadapter>
<adminobject>
<adminobject-interface>connector.MyAdminObject</adminobject-interface>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/build.xml
index ed29889..8528818 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/build.xml
@@ -30,8 +30,8 @@
<target name="all" depends="init-common" >
<antcall target="compile-common">
- <param name="build.classes.dir" value="classes" />
- <param name="src" value="connector" />
+ <param name="build.classes.dir" value="classes" />
+ <param name="src" value="connector" />
</antcall>
<jar jarfile="../generic-ra.jar" basedir="classes"
includes="connector/*.class" />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/Controls.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/Controls.java
index 55533d4..f59b2b3 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/Controls.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/Controls.java
@@ -18,7 +18,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class Controls {
public static Object readyLock = new Object();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/DeliveryWork.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/DeliveryWork.java
index 658233e..d73c862 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/DeliveryWork.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/DeliveryWork.java
@@ -27,7 +27,7 @@
/**
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
public class DeliveryWork implements Work {
@@ -36,7 +36,7 @@
private String op;
private boolean keepCount;
private static int counter = 0;
-
+
public DeliveryWork(MessageEndpoint ep, int numOfMessages, String op) {
this.ep = ep;
this.num = numOfMessages;
@@ -44,7 +44,7 @@
this.keepCount = false;
}
- public DeliveryWork(MessageEndpoint ep, int numOfMessages,
+ public DeliveryWork(MessageEndpoint ep, int numOfMessages,
String op, boolean keepCount) {
this.ep = ep;
this.num = numOfMessages;
@@ -55,7 +55,7 @@
public void run() {
debug("ENTER...");
-
+
try {
//Method onMessage = getOnMessageMethod();
//ep.beforeDelivery(onMessage);
@@ -78,11 +78,11 @@
}
//ep.afterDelivery();
-
+
} catch (Exception ex) {
ex.printStackTrace();
}
-
+
debug("LEAVE...");
}
@@ -93,14 +93,14 @@
}
private Method getOnMessageMethod() {
-
+
Method onMessageMethod = null;
try {
Class msgListenerClass = connector.MyMessageListener.class;
Class[] paramTypes = { java.lang.String.class };
- onMessageMethod =
+ onMessageMethod =
msgListenerClass.getMethod("onMessage", paramTypes);
-
+
} catch (NoSuchMethodException ex) {
ex.printStackTrace();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/FakeXAResource.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/FakeXAResource.java
index 100cace..fa93f63 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/FakeXAResource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/FakeXAResource.java
@@ -36,7 +36,7 @@
flagToString(flags));
}
-
+
public void forget(Xid xid) throws XAException {
print("FakeXAResource.forget: " + xidToString(xid));
}
@@ -53,7 +53,7 @@
print("FakeXAResource.prepare: " + xidToString(xid));
return XAResource.XA_OK;
}
-
+
public Xid[] recover(int flag) throws XAException {
print("FakeXAResource.recover: " + flagToString(flag));
return null;
@@ -66,7 +66,7 @@
public boolean setTransactionTimeout(int seconds) throws XAException {
return false;
}
-
+
public void start(Xid xid, int flags) throws XAException {
print("FakeXAResource.start: " + xidToString(xid) + "," +
flagToString(flags));
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/JSR322Work.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/JSR322Work.java
index 5107ac1..0203f4a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/JSR322Work.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/JSR322Work.java
@@ -48,6 +48,6 @@
public void run(){
super.run();
-
+
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MyAdminObject.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MyAdminObject.java
index a68a5b7..9c28812 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MyAdminObject.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MyAdminObject.java
@@ -51,11 +51,11 @@
}
public void initialize() {
- System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
+ System.out.println("[MyAdminObject] Initializing the Controls to false:"+resetControl);
if (resetControl.equals("BEGINNING")) {
Controls.done=false;
- System.out.println("[MyAdminObject] Initialized the Controls to false");
- }
+ System.out.println("[MyAdminObject] Initialized the Controls to false");
+ }
}
public boolean done() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MySecurityContext.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MySecurityContext.java
index 3178c1c..e19051e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MySecurityContext.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/MySecurityContext.java
@@ -62,7 +62,7 @@
CallerPrincipalCallback cpc = new CallerPrincipalCallback(execSubject, new PrincipalImpl(principalName));
debug("setting caller principal callback with principal : " + principalName);
callbacks.add(cpc);
-
+
/*
GroupPrincipalCallback gpc = new GroupPrincipalCallback(execSubject, null);
callbacks.add(gpc);
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/SimpleActivationSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/SimpleActivationSpec.java
index 8182ef5..3fce544 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/SimpleActivationSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/SimpleActivationSpec.java
@@ -24,9 +24,9 @@
* so that the app server can instantiate and configure
* it at the runtime.
*
- * @author Qingqing Ouyang
+ * @author Qingqing Ouyang
*/
-public class SimpleActivationSpec
+public class SimpleActivationSpec
implements ActivationSpec, java.io.Serializable {
private String destinationName;
@@ -43,7 +43,7 @@
public String getDestinationName () {
return this.destinationName;
}
-
+
public void setDestinationName (String name) {
debug("setDestinationName() called... name = " + name);
this.destinationName = name;
@@ -52,7 +52,7 @@
public String getDestinationType() {
return this.destinationType;
}
-
+
public void setDestinationType (String type) {
debug("setDestinationType () called... type = " + type);
this.destinationType= type;
@@ -61,7 +61,7 @@
public String getTestProp() {
return this.testProp;
}
-
+
public void setTestProp (String testProp) {
debug("setTestProp () called... testProp = " + testProp);
this.testProp = testProp;
@@ -70,7 +70,7 @@
public Integer getTestIntegerProp() {
return this.testIntegerProp;
}
-
+
public void setTestIntegerProp (Integer testProp1) {
debug("setTestIntegerProp () called... testIntegerProp = " + testProp1);
this.testIntegerProp = testProp1;
@@ -94,7 +94,7 @@
}
- }
+ }
private void debug (String message)
{
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/WorkDispatcher.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/WorkDispatcher.java
index ddff005..4e921a2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/WorkDispatcher.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/WorkDispatcher.java
@@ -86,7 +86,7 @@
if (!factory.isDeliveryTransacted(onMessage)) {
//MessageEndpoint ep = factory.createEndpoint(null);
- //DeliveryWork d = new DeliveryWork("NO_TX", ep);
+ //DeliveryWork d = new DeliveryWork("NO_TX", ep);
//wm.doWork(d, 0, null, null);
} else {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/XID.java b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/XID.java
index 18a970d..b2a906c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/XID.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/multiple-resources.xml/ra/src/connector/XID.java
@@ -35,8 +35,8 @@
public int branchQualifier;
public int globalTxID;
- static public final int MAXGTRIDSIZE= 64;
- static public final int MAXBQUALSIZE= 64;
+ static public final int MAXGTRIDSIZE= 64;
+ static public final int MAXBQUALSIZE= 64;
public XID() {
int foo = ID++;
@@ -54,10 +54,10 @@
{
return false; // It can't be equal
}
-
+
other = (XID)o; // The other XID, now properly cast
-
- if (this.formatID == other.formatID
+
+ if (this.formatID == other.formatID
&& this.branchQualifier == other.branchQualifier
&& this.globalTxID == other.globalTxID) {
return true;
@@ -97,7 +97,7 @@
"formatID(" + formatID + "), " +
"branchQualifier (" + branchQualifier + "), " +
"globalTxID(" + globalTxID + ")}");
-
+
return s;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.xml
index 80d07c4..75eaa5b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/build.xml
@@ -31,7 +31,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<!--
<target name="all" depends="build,setup,deploy-war, run-war, undeploy-war, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -40,15 +40,15 @@
<target name="all" depends="build, disable-resource-validation, deploy-ear, setup, run-ear, unsetup, undeploy-ear, enable-resource-validation"/>
<!--
- <antcall target="build"/>
- <antcall target="setup"/>
- <antcall target="deploy-war"/>
- <antcall target="run-war"/>
- <antcall target="undeploy-war"/>
- <antcall target="deploy-ear"/>
- <antcall target="run-ear"/>
- <antcall target="undeploy-ear"/>
- <antcall target="unsetup"/>
+ <antcall target="build"/>
+ <antcall target="setup"/>
+ <antcall target="deploy-war"/>
+ <antcall target="run-war"/>
+ <antcall target="undeploy-war"/>
+ <antcall target="deploy-ear"/>
+ <antcall target="run-ear"/>
+ <antcall target="undeploy-ear"/>
+ <antcall target="unsetup"/>
</target>
-->
@@ -56,7 +56,7 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup" depends="init-common">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
@@ -64,7 +64,7 @@
<antcall target="create-pool"/>
<antcall target="create-resource"/>
<antcall target="create-admin-object"/>
-
+
</target>
<target name="create-pool">
<antcall target="create-connector-connpool-common">
@@ -84,37 +84,37 @@
</antcall>
</target>
- <target name="disable-resource-validation">
- <antcall target="create-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="disable-resource-validation">
+ <antcall target="create-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
- <target name="enable-resource-validation">
- <antcall target="delete-jvm-options">
- <param name="option" value="-Ddeployment.resource.validation=false"/>
- </antcall>
- <antcall target="restart-server"/>
- </target>
+ <target name="enable-resource-validation">
+ <antcall target="delete-jvm-options">
+ <param name="option" value="-Ddeployment.resource.validation=false"/>
+ </antcall>
+ <antcall target="restart-server"/>
+ </target>
<target name="create-admin-object" depends="init-common">
<!--<property file="../config/oracle.properties"/>-->
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname ${appname}App#jdbcra --property TableName=customer2:JndiName=jdbc/ejb-subclassing:SchemaName=DBUSER:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
-<!-- <antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+<!-- <antcall target="reconfig-common"/>-->
</target>
-
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -122,16 +122,16 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="${appname}App#jdbcra"/>
- </antcall>
-<!-- <antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="${appname}App#jdbcra"/>
+ </antcall>
+<!-- <antcall target="reconfig-common"/>-->
</target>
<target name="unsetup">
@@ -143,7 +143,7 @@
<antcall target="delete-pool"/>
<antcall target="delete-admin-object"/>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="embedded-ra-pool"/>
@@ -153,7 +153,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -169,9 +169,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -180,34 +180,34 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
<fileset dir="${assemble.dir}">
<include name="*.jar"/>
<include name="*.war"/>
- </fileset>
+ </fileset>
<fileset dir="ra/publish/lib">
<include name="*.rar"/>
</fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="create-ra-config"/>
<antcall target="deploy-common"/>
@@ -216,27 +216,27 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="non-string-mcf-properties (stand-alone war based)"/>
- </antcall>
+ <param name="testsuite.id" value="non-string-mcf-properties (stand-alone war based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="non-string-mcf-properties (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="non-string-mcf-properties (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/descriptor/sun-ejb-jar.xml
index 1d1200d..df4bb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/Customer.java
index 08107a5..0b2b49a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/Customer.java
@@ -47,4 +47,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerChecking.java
index 61de291..b341c34 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerChecking.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerCheckingEJB.java
index 9093b7e..b690099 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerCheckingEJB.java
@@ -92,5 +92,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerEJB.java
index 0520b60..07220db 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavings.java
index 338c921..883e04a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavings.java
@@ -20,4 +20,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.xml
index 74484fe..2b67446 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index bfcbf0b..4ebed6e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/**
@@ -273,184 +273,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -500,162 +500,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 0f3d510..173bfec 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -128,7 +128,7 @@
<config-property-value>testdb</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbuser</config-property-value>
@@ -139,12 +139,12 @@
<config-property-value>dbuser</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbpassword</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -154,7 +154,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>-->
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
@@ -165,17 +165,17 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
@@ -186,7 +186,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientDataSource40</config-property-value>
@@ -197,31 +197,31 @@
<config-property-value>;create=true</config-property-value>
</config-property>
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
<!-- properties to test setting of a non-String value with overridden setters -->
<config-property>
<config-property-name>NonStringWithNoOverriddenSetter</config-property-name>
@@ -235,54 +235,54 @@
</config-property>
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 4bf9fed..3234032 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,14 +31,14 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -49,19 +49,19 @@
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -69,55 +69,55 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
setIsolation(mc);
isValid(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -128,409 +128,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -538,19 +538,19 @@
public Double getNonStringWithNoOverriddenSetter(){
System.out.println("DSManagedConnectionFactory : getNonStringWithNoOverriddenSetter() called");
- return this.nonStringWithNoOverriddenSetter;
+ return this.nonStringWithNoOverriddenSetter;
}
public void setNonStringWithNoOverriddenSetter(Double dbl) {
System.out.println("DSManagedConnectionFactory : setNonStringWithNoOverriddenSetter() called");
- this.nonStringWithNoOverriddenSetter = dbl;
+ this.nonStringWithNoOverriddenSetter = dbl;
}
public Double getNonStringWithOverriddenSetter(){
System.out.println("DSManagedConnectionFactory : getNonStringWithOverriddenSetter() called");
return this.nonStringWithOverriddenSetter;
}
-
+
public void setNonStringWithOverriddenSetter(Double dbl) {
System.out.println("DSManagedConnectionFactory : setNonStringWithOverriddenSetter(Double) called");
this.nonStringWithOverriddenSetter = dbl;
@@ -567,35 +567,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java
index 2068430..739ff4d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,91 +114,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/servlet/SimpleBankServlet.java
index ee3695f..a45dc0f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/servlet/SimpleBankServlet.java
@@ -17,15 +17,15 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -41,13 +41,13 @@
{
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
throws ServletException, IOException {
@@ -57,7 +57,7 @@
}catch(Exception e){
e.printStackTrace();
}
-
+
doLookup();
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -73,14 +73,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -97,7 +97,7 @@
customerSavings = customerSavingsHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -110,7 +110,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -122,7 +122,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -134,12 +134,12 @@
customerSavingsHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -149,7 +149,7 @@
customerSavings = (CustomerSavings)customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -158,7 +158,7 @@
customerChecking = (CustomerChecking)customerCheckingHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -218,9 +218,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/nonstringmcfproperties/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/src/main/java/org/glassfish/osgi_resources_test/ResourcesTestActivator.java b/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/src/main/java/org/glassfish/osgi_resources_test/ResourcesTestActivator.java
index 72f367a..a4d3b57 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/src/main/java/org/glassfish/osgi_resources_test/ResourcesTestActivator.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/osgi-resources-test/src/main/java/org/glassfish/osgi_resources_test/ResourcesTestActivator.java
@@ -92,7 +92,7 @@
/*
testJdbcResources(null);
-
+
testJdbcResources("(osgi.jdbc.driver.class=oracle.jdbc.pool.OracleDataSource)");
testJdbcResources("(jndi-name=jdbc/oracle_type4_resource)");
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.properties
index 835c7cf..0ee661f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.properties
@@ -15,21 +15,21 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="rar-accessibility-test"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="rarfile" value="rar/blackbox-tx.rar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.xml
index d423e11..c700356 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/build.xml
@@ -52,7 +52,7 @@
<antcall target="exec">
<param name="expected_count" value="2"/>
</antcall>
-
+
<antcall target="asadmin-common">
<param name="admin.command" value="set"/>
<param name="operand.props"
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/ejb/SimpleSessionBean.java b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/ejb/SimpleSessionBean.java
index 6c4056a..2dd0273 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/ejb/SimpleSessionBean.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/ejb/SimpleSessionBean.java
@@ -57,7 +57,7 @@
InitialContext ctx = new InitialContext();
Object o = ctx.lookup(res);
System.out.println("CLASS_NAME: "+o.getClass().getName());
- System.out.println("CLASS_LOADER: " +
+ System.out.println("CLASS_LOADER: " +
Thread.currentThread().getContextClassLoader().loadClass(o.getClass().getName()).getClassLoader());
count++;
}catch(Throwable e){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/JdbcConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/JdbcConnection.java
index 70100b8..eb51323 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/JdbcConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/JdbcConnection.java
@@ -184,7 +184,7 @@
}
/////////////////////////////////////////////
- // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
+ // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
/////////////////////////////////////////////
///////////// BEGIN JDK 1.4 //////////////
@@ -330,27 +330,27 @@
}
///////////// END JDK 1.4 //////////////
-
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
void associateConnection(JdbcManagedConnection newMc)
throws ResourceException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
index 2480518..1b23b04 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/LocalTxManagedConnectionFactory.java
@@ -109,7 +109,7 @@
if (!getBooleanWithGetBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Get Boolean Accessor is false");
}
-
+
if (!isBooleanWithIsBooleanAccessor()) {
throw new ResourceException("Blackbox RAR : Is Boolean Accessor is false");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
index 9d78e6a..de70d4a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
@@ -44,7 +44,7 @@
}
public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException {
- return null;
+ return null;
}
public BootstrapContext getBootstrapContext(){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/servlet/SimpleServlet.java
index 4514f3e..58614b8 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/servlet/SimpleServlet.java
@@ -76,7 +76,7 @@
}catch(NamingException ne){
ne.printStackTrace();
} catch (CreateException e) {
- e.printStackTrace();
+ e.printStackTrace();
}finally{
out.println("END_OF_TEST");
out.flush();
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/create_pointbase.sql
index 4234115..ed6dbab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/create_pointbase.sql
@@ -1,20 +1,20 @@
-Drop table TXLEVELSWITCH;
-
-CREATE TABLE TXLEVELSWITCH (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
-INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
-
-Drop table TXLEVELSWITCH2;
-
-CREATE TABLE TXLEVELSWITCH2 (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
-INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
-
+Drop table TXLEVELSWITCH;
+
+CREATE TABLE TXLEVELSWITCH (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
+INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
+
+Drop table TXLEVELSWITCH2;
+
+CREATE TABLE TXLEVELSWITCH2 (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
+INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/drop_pointbase.sql
index 0c1242f..d11a115 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/rar-accessibility/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table TXLEVELSWITCH;
-Drop table TXLEVELSWITCH2;
+Drop table TXLEVELSWITCH;
+Drop table TXLEVELSWITCH2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/build.xml
index 53f8dde..501f37c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/build.xml
@@ -36,8 +36,8 @@
<antcall target="build-ear"/>
<!--
<antcall target="ear-common">
- <param name="appname" value="generic-embedded"/>
- <param name="application.xml" value="META-INF/application.xml"/>
+ <param name="appname" value="generic-embedded"/>
+ <param name="application.xml" value="META-INF/application.xml"/>
</antcall>
-->
</target>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/ejb-jar.xml
index e94042b..8e547c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/ejb-jar.xml
@@ -33,8 +33,8 @@
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/sun-ejb-jar.xml
index e73cb46..3fde230 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/META-INF/sun-ejb-jar.xml
@@ -25,7 +25,7 @@
<ejb>
<ejb-name>MyVersionChecker</ejb-name>
<jndi-name>MyVersionChecker</jndi-name>
-<!--
+<!--
<ior-security-config>
<transport-config>
<integrity>supported</integrity>
@@ -42,10 +42,10 @@
<caller-propagation>supported</caller-propagation>
</sas-context>
</ior-security-config>
--->
+-->
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/client/Client.java
index 7edb357..7663ed6 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/client/Client.java
@@ -27,36 +27,36 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public static void main(String[] args) {
Client client = new Client();
- System.out.println("Client: Args: ");
- for(int i = 0 ; i< args.length; i++) {
- System.out.println("Client: Args: " + args[i]);
- }
- Integer versionNumber = new Integer(args[0]);
+ System.out.println("Client: Args: ");
+ for(int i = 0 ; i< args.length; i++) {
+ System.out.println("Client: Args: " + args[i]);
+ }
+ Integer versionNumber = new Integer(args[0]);
client.doTest(versionNumber.intValue());
}
-
+
public String doTest(int versionToTest) {
stat.addDescription("This is to test redeployment of connectors "+
- "contracts.");
-
+ "contracts.");
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
- pass = checkResults(versionToTest);
- debug("Got expected results = " + pass);
-
- //do not continue if one test failed
- if (!pass) {
- res = "SOME TESTS FAILED";
- stat.addStatus("Redeploy Connector 1.5 test - ", stat.FAIL);
- } else {
- res = "ALL TESTS PASSED";
- stat.addStatus("Redeploy Connector 1.5 test - " , stat.PASS);
- }
+ pass = checkResults(versionToTest);
+ debug("Got expected results = " + pass);
+
+ //do not continue if one test failed
+ if (!pass) {
+ res = "SOME TESTS FAILED";
+ stat.addStatus("Redeploy Connector 1.5 test - ", stat.FAIL);
+ } else {
+ res = "ALL TESTS PASSED";
+ stat.addStatus("Redeploy Connector 1.5 test - " , stat.PASS);
+ }
} catch (Exception ex) {
System.out.println("Redeploy connector test failed.");
@@ -68,20 +68,20 @@
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
- debug("checkResult" + num);
- debug("got initial context" + (new InitialContext()).toString());
+ debug("checkResult" + num);
+ debug("got initial context" + (new InitialContext()).toString());
Object o = (new InitialContext()).lookup("MyVersionChecker");
- debug("got o" + o);
- VersionCheckerHome home = (VersionCheckerHome)
+ debug("got o" + o);
+ VersionCheckerHome home = (VersionCheckerHome)
PortableRemoteObject.narrow(o, VersionCheckerHome.class);
debug("got home" + home);
- VersionChecker checker = home.create();
- debug("got o" + checker);
+ VersionChecker checker = home.create();
+ debug("got o" + checker);
//problem here!
- int result = checker.getVersion();
- debug("checkResult" + result);
+ int result = checker.getVersion();
+ debug("checkResult" + result);
return result == num;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/ejb/VersionCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/ejb/VersionCheckerEJB.java
index a00913a..68211d8 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/ejb/VersionCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/app/src/ejb/VersionCheckerEJB.java
@@ -23,47 +23,47 @@
import com.sun.jdbcra.spi.JdbcSetupAdmin;
public class VersionCheckerEJB implements SessionBean {
- private InitialContext initContext = null;
- private SessionContext sessionContext = null;
+ private InitialContext initContext = null;
+ private SessionContext sessionContext = null;
public VersionCheckerEJB() {
debug("Constructor");
}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
- debug("ejbCreate()");
+ debug("ejbCreate()");
}
public int getVersion(){
- try {
- initContext = new javax.naming.InitialContext();
- } catch (Exception e) {
- System.out.println("Exception occured when creating InitialContext: " + e.toString());
- return -1;
- }
-
- try {
- JdbcSetupAdmin ja = (JdbcSetupAdmin) initContext.lookup("eis/jdbcAdmin");
- int versionno = ja.getVersion();
- debug("Version number is " + versionno);
- return versionno;
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException(e.getMessage());
- }
+ try {
+ initContext = new javax.naming.InitialContext();
+ } catch (Exception e) {
+ System.out.println("Exception occured when creating InitialContext: " + e.toString());
+ return -1;
+ }
+
+ try {
+ JdbcSetupAdmin ja = (JdbcSetupAdmin) initContext.lookup("eis/jdbcAdmin");
+ int versionno = ja.getVersion();
+ debug("Version number is " + versionno);
+ return versionno;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e.getMessage());
+ }
}
public void setSessionContext(SessionContext context) {
- debug(" bean removed");
+ debug(" bean removed");
sessionContext = context;
}
public void ejbRemove() {
- debug(" bean removed");
+ debug(" bean removed");
}
public void ejbActivate() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/build.properties
index 1493d12..b00fb16 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/build.properties
@@ -15,10 +15,10 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="redeploy"/>
-<property name="appname" value="${module}-rar"/>
+<property name="appname" value="${module}-rar"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="test.client"
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/client/Client.java
index f999a8a..492e79a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/client/Client.java
@@ -27,35 +27,35 @@
private static SimpleReporterAdapter stat =
new SimpleReporterAdapter("appserv-tests");
-
+
public static void main(String[] args) {
Client client = new Client();
- System.out.println("Client: Args: ");
- for(int i = 0 ; i< args.length; i++) {
- System.out.println("Client: Args: " + args[i]);
- }
- Integer versionNumber = new Integer(args[0]);
+ System.out.println("Client: Args: ");
+ for(int i = 0 ; i< args.length; i++) {
+ System.out.println("Client: Args: " + args[i]);
+ }
+ Integer versionNumber = new Integer(args[0]);
client.doTest(versionNumber.intValue());
}
-
+
public String doTest(int versionToTest) {
stat.addDescription("This is to test redeployment of connector modules. Testing version " + versionToTest);
-
+
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
- pass = checkResults(versionToTest);
- debug("Got expected results = " + pass);
-
- //do not continue if one test failed
- if (!pass) {
- res = "SOME TESTS FAILED";
- stat.addStatus("Redeploy Connector 1.5 test - Version : "+ versionToTest, stat.FAIL);
- } else {
- res = "ALL TESTS PASSED";
- stat.addStatus("Redeploy Connector 1.5 test - Version : " + versionToTest , stat.PASS);
- }
+ pass = checkResults(versionToTest);
+ debug("Got expected results = " + pass);
+
+ //do not continue if one test failed
+ if (!pass) {
+ res = "SOME TESTS FAILED";
+ stat.addStatus("Redeploy Connector 1.5 test - Version : "+ versionToTest, stat.FAIL);
+ } else {
+ res = "ALL TESTS PASSED";
+ stat.addStatus("Redeploy Connector 1.5 test - Version : " + versionToTest , stat.PASS);
+ }
} catch (Exception ex) {
System.out.println("Redeploy connector test failed.");
ex.printStackTrace();
@@ -66,20 +66,20 @@
debug("EXITING... STATUS = " + res);
return res;
}
-
+
private boolean checkResults(int num) throws Exception {
- debug("checkResult" + num);
- debug("got initial context" + (new InitialContext()).toString());
+ debug("checkResult" + num);
+ debug("got initial context" + (new InitialContext()).toString());
Object o = (new InitialContext()).lookup("java:comp/env/ejb/MyVersionChecker");
- debug("got o" + o);
- VersionCheckerHome home = (VersionCheckerHome)
+ debug("got o" + o);
+ VersionCheckerHome home = (VersionCheckerHome)
PortableRemoteObject.narrow(o, VersionCheckerHome.class);
debug("got home" + home);
- VersionChecker checker = home.create();
- debug("got o" + checker);
+ VersionChecker checker = home.create();
+ debug("got o" + checker);
//problem here!
- int result = checker.getVersion();
- debug("checkResult" + result);
+ int result = checker.getVersion();
+ debug("checkResult" + result);
return result == num;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/ejb-jar.xml
index e94042b..8e547c4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/ejb-jar.xml
@@ -33,8 +33,8 @@
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<resource-env-ref>
- <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
+ <resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
+ <resource-env-ref-type>com.sun.jdbcra.spi.JdbcSetupAdmin</resource-env-ref-type>
</resource-env-ref>
<security-identity>
<use-caller-identity/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/sun-ejb-jar.xml
index cc5a3f9..e146722 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/descriptor/sun-ejb-jar.xml
@@ -25,7 +25,7 @@
<ejb>
<ejb-name>MyVersionChecker</ejb-name>
<jndi-name>ejb/MyVersionChecker</jndi-name>
-<!--
+<!--
<ior-security-config>
<transport-config>
<integrity>supported</integrity>
@@ -42,10 +42,10 @@
<caller-propagation>supported</caller-propagation>
</sas-context>
</ior-security-config>
--->
+-->
<resource-env-ref>
<resource-env-ref-name>eis/testAdmin</resource-env-ref-name>
- <jndi-name>eis/testAdmin</jndi-name>
+ <jndi-name>eis/testAdmin</jndi-name>
</resource-env-ref>
<gen-classes/>
</ejb>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ejb/VersionCheckerEJB.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ejb/VersionCheckerEJB.java
index ac147cc..1949476 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ejb/VersionCheckerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ejb/VersionCheckerEJB.java
@@ -32,15 +32,15 @@
//import com.sun.jdbcra.spi.JdbcSetupAdmin;
public class VersionCheckerEJB implements SessionBean {
- private InitialContext initContext = null;
- private SessionContext sessionContext = null;
+ private InitialContext initContext = null;
+ private SessionContext sessionContext = null;
public VersionCheckerEJB() {
debug("Constructor");
}
- public void ejbCreate()
+ public void ejbCreate()
throws CreateException {
debug("ejbCreate()");
}
@@ -48,24 +48,24 @@
public int getVersion(){
debug("Checking the version!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
- try {
- initContext = new javax.naming.InitialContext();
- } catch (Exception e) {
- System.out.println("Exception occured when creating InitialContext: " + e.toString());
+ try {
+ initContext = new javax.naming.InitialContext();
+ } catch (Exception e) {
+ System.out.println("Exception occured when creating InitialContext: " + e.toString());
e.printStackTrace();
- return -1;
- }
-
- try {
- com.sun.jdbcra.spi.JdbcSetupAdmin ja = (com.sun.jdbcra.spi.JdbcSetupAdmin) initContext.lookup("eis/testAdmin");
- int versionno = ja.getVersion();
- debug("Version number is " + versionno);
- return versionno;
- } catch (Exception e) {
- e.printStackTrace();
- throw new RuntimeException(e.getMessage());
- }
-
+ return -1;
+ }
+
+ try {
+ com.sun.jdbcra.spi.JdbcSetupAdmin ja = (com.sun.jdbcra.spi.JdbcSetupAdmin) initContext.lookup("eis/testAdmin");
+ int versionno = ja.getVersion();
+ debug("Version number is " + versionno);
+ return versionno;
+ } catch (Exception e) {
+ e.printStackTrace();
+ throw new RuntimeException(e.getMessage());
+ }
+
// return -1;
}
@@ -76,7 +76,7 @@
}
public void ejbRemove() {
- debug(" bean removed");
+ debug(" bean removed");
}
public void ejbActivate() {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.properties
index ee2eca0..fd21c3d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.xml
index 15f345a..ef59eba 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
- failonerror="true">
- <classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
- </classpath>
+ failonerror="true">
+ <classpath>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
+ </classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/testjdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/testjdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index bfcbf0b..4ebed6e 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
/**
@@ -273,184 +273,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -500,162 +500,162 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
/**
- * Installs the given <code>Map</code> object as the tyoe map for this
+ * Installs the given <code>Map</code> object as the tyoe map for this
* <code> Connection </code> object.
*
- * @param map <code>Map</code> a Map object to install.
- * @throws SQLException In case of a database error.
+ * @param map <code>Map</code> a Map object to install.
+ * @throws SQLException In case of a database error.
*/
public void setTypeMap(Map map) throws SQLException {
- checkValidity();
- con.setTypeMap(map);
+ checkValidity();
+ con.setTypeMap(map);
}
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index e60338f..c5ada46 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
public static final int VERSION = 2;
@@ -37,39 +37,39 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
/*
@@ -77,16 +77,16 @@
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
+ }
*/
}
-
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -96,5 +96,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index 60e1e4e..65e8fb5 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -122,136 +122,136 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>9092</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBUSER</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>DBPASSWORD</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DatabaseName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:pointbase:server://localhost:9092/sqe-samples,new</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DataSourceName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>NetworkProtocol</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Delimiter</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>com.pointbase.jdbc.jdbcDataSource</config-property-value>
</config-property>
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
-
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>javax.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index 411b73f..d9874a0 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,55 +68,55 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
setIsolation(mc);
isValid(mc);
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -127,409 +127,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -539,35 +539,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DataSource.java
index 2068430..739ff4d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re.getMessage());
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re.getMessage());
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,91 +114,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index ae16b51..824510d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,8 +34,8 @@
public Integer getNoOfRows();
- public boolean checkSetup();
-
+ public boolean checkSetup();
+
public int getVersion();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 1a9e5c6..c72d74c 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -66,62 +66,62 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- DataSource ds = (DataSource) ic.lookup(jndiName);
+ InitialContext ic = new InitialContext();
+ DataSource ds = (DataSource) ic.lookup(jndiName);
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
}
-
+ System.out.println("Returning setup :" +b);
+ return b;
+ }
+
public int getVersion(){
- return ResourceAdapter.VERSION;
+ return ResourceAdapter.VERSION;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/build.xml
index 967868b..6410557 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/spi/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -37,5 +37,5 @@
<target name="build14" depends="compile14"/>
- <target name="build" depends="build13, build14"/>
+ <target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/servlet/SimpleServlet.java b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/servlet/SimpleServlet.java
index c9b67b2..91c2d43 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/servlet/SimpleServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/redeployRar/servlet/SimpleServlet.java
@@ -52,22 +52,22 @@
String res = "NOT RUN";
- debug("doTest() ENTER...");
+ debug("doTest() ENTER...");
boolean pass = false;
try {
- pass = checkResults(versionToTest);
- debug("Got expected results = " + pass);
+ pass = checkResults(versionToTest);
+ debug("Got expected results = " + pass);
- //do not continue if one test failed
- if (!pass) {
- res = "SOME TESTS FAILED";
- System.out.println("Redeploy Connector 1.5 test - Version : "+ versionToTest + " FAIL");
+ //do not continue if one test failed
+ if (!pass) {
+ res = "SOME TESTS FAILED";
+ System.out.println("Redeploy Connector 1.5 test - Version : "+ versionToTest + " FAIL");
out.println("TEST:FAIL");
- } else {
- res = "ALL TESTS PASSED";
- System.out.println("Redeploy Connector 1.5 test - Version : "+ versionToTest + " PASS");
+ } else {
+ res = "ALL TESTS PASSED";
+ System.out.println("Redeploy Connector 1.5 test - Version : "+ versionToTest + " PASS");
out.println("TEST:PASS");
- }
+ }
} catch (Exception ex) {
System.out.println("Redeploy connector test failed.");
ex.printStackTrace();
@@ -83,18 +83,18 @@
}
private boolean checkResults(int num) throws Exception {
- debug("checkResult" + num);
- debug("got initial context" + (new InitialContext()).toString());
+ debug("checkResult" + num);
+ debug("got initial context" + (new InitialContext()).toString());
Object o = (new InitialContext()).lookup("java:comp/env/ejb/MyVersionChecker");
- debug("got o" + o);
+ debug("got o" + o);
VersionCheckerHome home = (VersionCheckerHome)
PortableRemoteObject.narrow(o, VersionCheckerHome.class);
debug("got home" + home);
- VersionChecker checker = home.create();
- debug("got o" + checker);
+ VersionChecker checker = home.create();
+ debug("got o" + checker);
//problem here!
- int result = checker.getVersion();
- debug("checkResult" + result);
+ int result = checker.getVersion();
+ debug("checkResult" + result);
return result == num;
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/report.xml b/appserver/tests/appserv-tests/devtests/connector/v3/report.xml
index 65a32ae..094e365 100644
--- a/appserver/tests/appserv-tests/devtests/connector/v3/report.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/report.xml
@@ -23,7 +23,7 @@
<target name="report">
<echo message="Comparing results with expected results"/>
-
+
<xslt style="${stylesheet}"
in="${xmlfile}" out="${htmlfile}"
basedir="." destdir="." />
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/run_test.sh b/appserver/tests/appserv-tests/devtests/connector/v3/run_test.sh
index 4e9a412..704f1dd 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/run_test.sh
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/run_test.sh
@@ -18,7 +18,7 @@
list_test_ids(){
echo connector_all connector_group_1 connector_group_2 connector_group_3 connector_group_4
}
-
+
test_run(){
#test functions goes here, maven test or ant test etc.
export HUDSON=true
@@ -45,16 +45,16 @@
}
get_test_target(){
- case ${1} in
- connector_all )
- TARGET=all
- export TARGET;;
+ case ${1} in
+ connector_all )
+ TARGET=all
+ export TARGET;;
* )
TARGET=$1
export TARGET;;
- esac
+ esac
}
-
+
OPT=${1}
TEST_ID=${2}
source `dirname ${0}`/../../../../common_test.sh
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.properties
index 0c68ad4..ec07f22 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.properties
@@ -15,7 +15,7 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector/securitymapweb"/>
<property name="poolname" value="MyPool"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.xml
index fab9d0b..93ce3f8 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/securitymapweb/build.xml
@@ -130,7 +130,7 @@
<arg line="${as.props}"/>
<arg line="domain.resources.connector-connection-pool.${poolname}.property.Password=${db.pwd}"/>
</exec>
-
+
<exec executable="${ASADMIN}" failonerror="false">
<arg line="set"/>
<arg line="${as.props}"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.properties b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.properties
index 1b5985f..f63357a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.properties
@@ -15,19 +15,19 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="connector-serializable-test"/>
-<property name="appname" value="${module}"/>
+<property name="appname" value="${module}"/> \u0020
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="application-client.xml"
- value="descriptor/application-client.xml"/>
-<property name="sun-application-client.xml"
- value="descriptor/sun-application-client.xml"/>
-<property name="appclientjar.files" value="${build.classes.dir}"/>
+<property name="application-client.xml"\u0020
+ value="descriptor/application-client.xml"/>
+<property name="sun-application-client.xml"\u0020
+ value="descriptor/sun-application-client.xml"/>
+<property name="appclientjar.files" value="${build.classes.dir}"/> \u0020
<property name="appclient.jar" value="${assemble.dir}/${appname}-client.jar"/>
<property name="app.type" value="application"/>
<property name="rarfile" value="rar/blackbox-tx.rar"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.xml b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.xml
index 7cd7df6..626bbd9 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/build.xml
@@ -56,7 +56,7 @@
srcdir="."
classpath="${env.APS_HOME}/lib/reporter.jar"
includes="client/WebTest.java" destdir="."/>
-
+
</target>
<target name="build" depends="compile">
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/client/Client.java b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/client/Client.java
index 96f872d..468b72a 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/client/Client.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/client/Client.java
@@ -49,7 +49,7 @@
} catch (Exception e) {
e.printStackTrace();
}
-
+
stat.printSummary();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/BootstrapHolder.java b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/BootstrapHolder.java
index 994cad8..390744f 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/BootstrapHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/BootstrapHolder.java
@@ -28,7 +28,7 @@
private WorkManager wm;
public BootstrapHolder(BootstrapContext context) {
- this.context = context;
+ this.context = context;
this.wm = (WorkManager) makeCopyOfObject(context.getWorkManager());
checkEquality(wm, context.getWorkManager());
this.xat = (XATerminator) makeCopyOfObject(context.getXATerminator());
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/JdbcConnection.java b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/JdbcConnection.java
index 6a7267c..d58af44 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/JdbcConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/JdbcConnection.java
@@ -183,7 +183,7 @@
}
/////////////////////////////////////////////
- // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
+ // THE FOLLOWING APIS ARE NEW FROM JDK 1.4 //
/////////////////////////////////////////////
///////////// BEGIN JDK 1.4 //////////////
@@ -329,27 +329,27 @@
}
///////////// END JDK 1.4 //////////////
-
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
void associateConnection(JdbcManagedConnection newMc)
throws ResourceException {
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
index 8f2f354..7925098 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/rar/src/com/sun/connector/blackbox/ResourceAdapter.java
@@ -44,7 +44,7 @@
}
public XAResource[] getXAResources(ActivationSpec[] activationSpecs) throws ResourceException {
- return null;
+ return null;
}
public BootstrapContext getBootstrapContext(){
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/create_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/create_pointbase.sql
index 4234115..ed6dbab 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/create_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/create_pointbase.sql
@@ -1,20 +1,20 @@
-Drop table TXLEVELSWITCH;
-
-CREATE TABLE TXLEVELSWITCH (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
-INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
-
-Drop table TXLEVELSWITCH2;
-
-CREATE TABLE TXLEVELSWITCH2 (
- c_id integer not null,
- c_phone char(16)
-);
-
-INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
-INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
-
+Drop table TXLEVELSWITCH;
+
+CREATE TABLE TXLEVELSWITCH (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH VALUES(10, 'abcd');
+INSERT INTO TXLEVELSWITCH VALUES(11, 'pqrs');
+
+Drop table TXLEVELSWITCH2;
+
+CREATE TABLE TXLEVELSWITCH2 (
+ c_id integer not null,
+ c_phone char(16)
+);
+
+INSERT INTO TXLEVELSWITCH2 VALUES(1, 'abcd');
+INSERT INTO TXLEVELSWITCH2 VALUES(2, 'pqrs');
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/drop_pointbase.sql b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/drop_pointbase.sql
index 0c1242f..d11a115 100755
--- a/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/drop_pointbase.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/v3/serializabletest/sql/drop_pointbase.sql
@@ -1,2 +1,2 @@
-Drop table TXLEVELSWITCH;
-Drop table TXLEVELSWITCH2;
+Drop table TXLEVELSWITCH;
+Drop table TXLEVELSWITCH2;
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/build.properties b/appserver/tests/appserv-tests/devtests/connector/web2connector/build.properties
index e2cc75d..dc19c9b 100755
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/build.properties
@@ -15,16 +15,16 @@
SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
-->
-
+
<property name="module" value="web"/>
-<property name="appname" value="${module}-subclassing"/>
+<property name="appname" value="${module}-subclassing"/> \u0020
<property name="assemble" value="${build.classes.dir}/archive"/>
<property name="application.xml" value="descriptor/application.xml"/>
<property name="sun-application.xml" value="descriptor/sun-application.xml"/>
<property name="ejb-jar.xml" value="descriptor/ejb-jar.xml"/>
<property name="sun-ejb-jar.xml" value="descriptor/sun-ejb-jar.xml"/>
-<property name="app.type" value="application"/>
+<property name="app.type" value="application"/> \u0020
<property name="web.xml" value="descriptor/web.xml"/>
<property name="sun-web.xml" value="descriptor/sun-web.xml"/>
<property name="contextroot" value="subclassing"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/build.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/build.xml
index 0fd090a..52ed34f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/build.xml
@@ -31,7 +31,7 @@
&commonBuild;
&commonRun;
&testproperties;
-
+
<target name="all" depends="build, setup, deploy-ear, run-ear, undeploy-ear, unsetup"/>
@@ -39,14 +39,14 @@
<antcall target="clean-common"/>
<ant dir="ra" target="clean"/>
</target>
-
+
<target name="setup">
<antcall target="execute-sql-connector">
<param name="sql.file" value="sql/simpleBank.sql"/>
</antcall>
-
+
<antcall target="create-ra-config"/>
-
+
<antcall target="deploy-rar-common">
<param name="rarfile" value="ra/publish/lib/jdbcra.rar"/>
</antcall>
@@ -80,18 +80,18 @@
<target name="create-admin-object" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-admin-object --target ${appserver.instance.name} --restype com.sun.jdbcra.spi.JdbcSetupAdmin --raname jdbcra --property TableName=customer2:JndiName=jdbc/ejb-subclassing:SchemaName=DBUSER:NoOfRows=1"/>
- <param name="operand.props" value="eis/jdbcAdmin"/>
+ <param name="operand.props" value="eis/jdbcAdmin"/>
</antcall>
</target>
<target name="delete-admin-object" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-admin-object"/>
- <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-admin-object"/>
+ <param name="operand.props" value="--target ${appserver.instance.name} eis/jdbcAdmin"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
-
+
<target name="restart">
<antcall target="restart-server-instance-common"/>
</target>
@@ -99,31 +99,31 @@
<target name="create-ra-config" depends="init-common">
<antcall target="asadmin-common">
<param name="admin.command" value="create-resource-adapter-config --property RAProperty=VALID"/>
- <param name="operand.props" value="jdbcra"/>
+ <param name="operand.props" value="jdbcra"/>
</antcall>
</target>
<target name="delete-ra-config" depends="init-common">
<antcall target="asadmin-common">
- <param name="admin.command" value="delete-resource-adapter-config"/>
- <param name="operand.props" value="jdbcra"/>
- </antcall>
- <!--<antcall target="reconfig-common"/>-->
+ <param name="admin.command" value="delete-resource-adapter-config"/>
+ <param name="operand.props" value="jdbcra"/>
+ </antcall>
+ <!--<antcall target="reconfig-common"/>-->
</target>
<target name="unsetup">
- <antcall target="execute-sql-connector">
- <param name="sql.file" value="sql/dropBankTables.sql"/>
- </antcall>
-
- <antcall target="delete-resource"/>
- <antcall target="delete-pool"/>
- <antcall target="delete-admin-object"/>
- <antcall target="undeploy-rar-common">
- <param name="undeployrar" value="jdbcra"/>
- </antcall>
+ <antcall target="execute-sql-connector">
+ <param name="sql.file" value="sql/dropBankTables.sql"/>
+ </antcall>
+
+ <antcall target="delete-resource"/>
+ <antcall target="delete-pool"/>
+ <antcall target="delete-admin-object"/>
+ <antcall target="undeploy-rar-common">
+ <param name="undeployrar" value="jdbcra"/>
+ </antcall>
</target>
-
+
<target name="delete-pool">
<antcall target="delete-connector-connpool-common">
<param name="connector.conpool.name" value="standalone-ra-pool"/>
@@ -133,7 +133,7 @@
<target name="delete-resource">
<antcall target="delete-connector-resource-common">
<param name="connector.jndi.name" value="jdbc/ejb-subclassing"/>
- </antcall>
+ </antcall>
</target>
<target name="compile" depends="clean">
@@ -149,9 +149,9 @@
<echo message="common.xml: Compiling test source files" level="verbose"/>
<javac srcdir="servlet"
destdir="${build.classes.dir}"
- classpath="${s1astest.classpath}:ra/publish/internal/classes"
+ classpath="${s1astest.classpath}:ra/publish/internal/classes"
debug="on"
- failonerror="true"/>
+ failonerror="true"/>
</target>
@@ -160,31 +160,31 @@
</target>
<target name="build" depends="compile">
- <property name="hasWebclient" value="yes"/>
+ <property name="hasWebclient" value="yes"/>
<ant dir="ra" target="assemble"/>
<antcall target="webclient-war-common">
<param name="hasWebclient" value="yes"/>
- <param name="webclient.war.classes" value="**/*.class"/>
+ <param name="webclient.war.classes" value="**/*.class"/>
</antcall>
-
+
<antcall target="ejb-jar-common">
<param name="ejbjar.classes" value="**/*.class"/>
</antcall>
-
+
<delete file="${assemble.dir}/${appname}.ear"/>
<mkdir dir="${assemble.dir}"/>
- <mkdir dir="${build.classes.dir}/META-INF"/>
- <ear earfile="${assemble.dir}/${appname}App.ear"
+ <mkdir dir="${build.classes.dir}/META-INF"/>
+ <ear earfile="${assemble.dir}/${appname}App.ear"
appxml="${application.xml}">
- <fileset dir="${assemble.dir}">
- <include name="*.jar"/>
- <include name="*.war"/>
- </fileset>
+ <fileset dir="${assemble.dir}">
+ <include name="*.jar"/>
+ <include name="*.war"/>
+ </fileset>
</ear>
- </target>
+ </target>
-
+
<target name="deploy-ear" depends="init-common">
<antcall target="deploy-common"/>
</target>
@@ -192,27 +192,27 @@
<target name="deploy-war" depends="init-common">
<antcall target="deploy-war-common"/>
</target>
-
+
<target name="run-war" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-connector (stand-alone war and rar based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-connector (stand-alone war and rar based)"/>
+ </antcall>
</target>
<target name="run-ear" depends="init-common">
<antcall target="runwebclient-common">
- <param name="testsuite.id" value="web-to-connector (ear based)"/>
- </antcall>
+ <param name="testsuite.id" value="web-to-connector (ear based)"/>
+ </antcall>
</target>
-
+
<target name="undeploy-ear" depends="init-common">
<antcall target="delete-ra-config"/>
<antcall target="undeploy-common"/>
- </target>
+ </target>
<target name="undeploy-war" depends="init-common">
<antcall target="undeploy-war-common"/>
- </target>
+ </target>
<target name="usage">
<antcall target="usage-common"/>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/descriptor/sun-ejb-jar.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/descriptor/sun-ejb-jar.xml
index 1d1200d..df4bb93 100755
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/descriptor/sun-ejb-jar.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/descriptor/sun-ejb-jar.xml
@@ -29,20 +29,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
- <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
- <max-cache-size>100</max-cache-size>
- <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
- <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
- <victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
+ <pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
+ </bean-pool>
+ <bean-cache>
+ <max-cache-size>100</max-cache-size>
+ <cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
+ <removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
+ <victim-selection-policy>LRU</victim-selection-policy>
+ </bean-cache>
</ejb>
<ejb>
<ejb-name>CustomerCheckingEJB</ejb-name>
@@ -51,20 +51,20 @@
<res-ref-name>jdbc/SimpleBank</res-ref-name>
<jndi-name>jdbc/ejb-subclassing</jndi-name>
</resource-ref>
- <is-read-only-bean>false</is-read-only-bean>
- <commit-option>B</commit-option>
- <bean-pool>
- <steady-pool-size>0</steady-pool-size>
- <resize-quantity>1</resize-quantity>
- <max-pool-size>10</max-pool-size>
+ <is-read-only-bean>false</is-read-only-bean>
+ <commit-option>B</commit-option>
+ <bean-pool>
+ <steady-pool-size>0</steady-pool-size>
+ <resize-quantity>1</resize-quantity>
+ <max-pool-size>10</max-pool-size>
<pool-idle-timeout-in-seconds>3600</pool-idle-timeout-in-seconds>
- </bean-pool>
- <bean-cache>
+ </bean-pool>
+ <bean-cache>
<max-cache-size>100</max-cache-size>
<cache-idle-timeout-in-seconds>60</cache-idle-timeout-in-seconds>
<removal-timeout-in-seconds>3600</removal-timeout-in-seconds>
<victim-selection-policy>LRU</victim-selection-policy>
- </bean-cache>
+ </bean-cache>
</ejb>
</enterprise-beans>
</sun-ejb-jar>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/Customer.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/Customer.java
index 5922f31..3615e16 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/Customer.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/Customer.java
@@ -46,4 +46,4 @@
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerChecking.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerChecking.java
index ff15e7e..89dc323 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerChecking.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerChecking.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerCheckingEJB.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerCheckingEJB.java
index ee0d17c..4b54444 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerCheckingEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerCheckingEJB.java
@@ -94,5 +94,5 @@
}
}
-
-
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerEJB.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerEJB.java
index 0520b60..07220db 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerEJB.java
@@ -53,7 +53,7 @@
public String getAddress1()
{
- return address1;
+ return address1;
}
public String getAddress2()
@@ -139,7 +139,7 @@
System.out.println("SQL exception occured in ejbRemove method");
e.printStackTrace();
}
-
+
}
public void ejbStore()
@@ -206,12 +206,12 @@
} catch (SQLException e) {
System.out.println("SQLException occurred in ejbLoad() method");
e.printStackTrace();
- }
+ }
}
public void ejbActivate() {}
public void ejbPassivate() {}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavings.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavings.java
index 2740692..c45a1c5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavings.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavings.java
@@ -22,4 +22,4 @@
{
}
-
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavingsEJB.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavingsEJB.java
index f30b506..b0ce7b5 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavingsEJB.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ejb/CustomerSavingsEJB.java
@@ -95,6 +95,6 @@
}
}
-
-
-
+
+
+
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.properties b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.properties
index ee2eca0..fd21c3d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.properties
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.properties
@@ -14,7 +14,7 @@
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
#
-
+
### Component Properties ###
src.dir=src
component.publish.home=.
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.xml
index cb66a45..3aceef2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/build.xml
@@ -23,62 +23,62 @@
<project name="JDBCConnector top level" default="build">
<property name="pkg.dir" value="com/sun/jdbcra/spi"/>
-
+
&common;
&testcommon;
<property file="./build.properties"/>
-
+
<target name="build" depends="compile,assemble" />
-
+
<!-- init. Initialization involves creating publishing directories and
- OS specific targets. -->
+ OS specific targets. -->
<target name="init" description="${component.name} initialization">
<tstamp>
<format property="start.time" pattern="MM/dd/yyyy hh:mm aa"/>
- </tstamp>
+ </tstamp>
<echo message="Building component ${component.name}"/>
<mkdir dir="${component.classes.dir}"/>
- <mkdir dir="${component.lib.home}"/>
+ <mkdir dir="${component.lib.home}"/>
</target>
- <!-- compile -->
+ <!-- compile -->
<target name="compile" depends="init"
- description="Compile com/sun/* com/iplanet/* sources">
+ description="Compile com/sun/* com/iplanet/* sources">
<!--<echo message="Connector api resides in ${connector-api.jar}"/>-->
- <javac srcdir="${src.dir}"
+ <javac srcdir="${src.dir}"
destdir="${component.classes.dir}"
failonerror="true">
<classpath>
- <fileset dir="${env.S1AS_HOME}/modules">
- <include name="**/*.jar" />
- </fileset>
+ <fileset dir="${env.S1AS_HOME}/modules">
+ <include name="**/*.jar" />
+ </fileset>
</classpath>
<include name="com/sun/jdbcra/**"/>
<include name="com/sun/appserv/**"/>
</javac>
</target>
-
+
<target name="all" depends="build"/>
- <target name="assemble">
-
- <jar jarfile="${component.lib.home}/jdbc.jar"
- basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
- com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
-
- <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
- tofile="${component.lib.home}/ra.xml" overwrite="yes">
+ <target name="assemble">
+
+ <jar jarfile="${component.lib.home}/jdbc.jar"
+ basedir="${component.classes.dir}" includes="${pkg.dir}/**/*,
+ com/sun/appserv/**/*, com/sun/jdbcra/util/**/*, com/sun/jdbcra/common/**/*"/>
+
+ <copy file="${src.dir}/com/sun/jdbcra/spi/1.4/ra-ds.xml"
+ tofile="${component.lib.home}/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${component.lib.home}/jdbcra.rar"
- basedir="${component.lib.home}" includes="jdbc.jar">
+ <jar jarfile="${component.lib.home}/jdbcra.rar"
+ basedir="${component.lib.home}" includes="jdbc.jar">
- <metainf dir="${component.lib.home}">
- <include name="ra.xml"/>
- </metainf>
- </jar>
+ <metainf dir="${component.lib.home}">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
- <delete file="${component.lib.home}/ra.xml"/>
-
+ <delete file="${component.lib.home}/ra.xml"/>
+
</target>
<target name="clean" description="Clean the build">
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/appserv/jdbcra/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/appserv/jdbcra/DataSource.java
index 9f8399a..b6ef30b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/appserv/jdbcra/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/appserv/jdbcra/DataSource.java
@@ -20,15 +20,15 @@
import java.sql.SQLException;
/**
- * The <code>javax.sql.DataSource</code> implementation of SunONE application
+ * The <code>javax.sql.DataSource</code> implementation of SunONE application
* server will implement this interface. An application program would be able
- * to use this interface to do the extended functionality exposed by SunONE
+ * to use this interface to do the extended functionality exposed by SunONE
* application server.
- * <p>A sample code for getting driver's connection implementation would like
+ * <p>A sample code for getting driver's connection implementation would like
* the following.
* <pre>
InitialContext ic = new InitialContext();
- com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
+ com.sun.appserv.DataSource ds = (com.sun.appserv.DataSOurce) ic.lookup("jdbc/PointBase");
Connection con = ds.getConnection();
Connection drivercon = ds.getConnection(con);
@@ -36,13 +36,13 @@
con.close();
</pre>
- *
+ *
* @author Binod P.G
*/
public interface DataSource extends javax.sql.DataSource {
/**
- * Retrieves the actual SQLConnection from the Connection wrapper
+ * Retrieves the actual SQLConnection from the Connection wrapper
* implementation of SunONE application server. If an actual connection is
* supplied as argument, then it will be just returned.
*
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
index c2822e2..6a366b0 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceObjectBuilder.java
@@ -27,22 +27,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Utility class, which would create necessary Datasource object according to the
+ * Utility class, which would create necessary Datasource object according to the
* specification.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
- * @see com.sun.jdbcra.common.DataSourceSpec
- * @see com.sun.jdbcra.util.MethodExcecutor
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
+ * @see com.sun.jdbcra.common.DataSourceSpec
+ * @see com.sun.jdbcra.util.MethodExcecutor
*/
public class DataSourceObjectBuilder implements java.io.Serializable{
private DataSourceSpec spec;
-
+
private Hashtable driverProperties = null;
-
- private MethodExecutor executor = null;
-
+
+ private MethodExecutor executor = null;
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -50,167 +50,167 @@
private boolean debug = false;
/**
* Construct a DataSource Object from the spec.
- *
- * @param spec <code> DataSourceSpec </code> object.
+ *
+ * @param spec <code> DataSourceSpec </code> object.
*/
public DataSourceObjectBuilder(DataSourceSpec spec) {
- this.spec = spec;
- executor = new MethodExecutor();
+ this.spec = spec;
+ executor = new MethodExecutor();
}
-
+
/**
* Construct the DataSource Object from the spec.
*
- * @return Object constructed using the DataSourceSpec.
- * @throws <code>ResourceException</code> if the class is not found or some issue in executing
- * some method.
+ * @return Object constructed using the DataSourceSpec.
+ * @throws <code>ResourceException</code> if the class is not found or some issue in executing
+ * some method.
*/
public Object constructDataSourceObject() throws ResourceException{
- driverProperties = parseDriverProperties(spec);
+ driverProperties = parseDriverProperties(spec);
Object dataSourceObject = getDataSourceObject();
Method[] methods = dataSourceObject.getClass().getMethods();
for (int i=0; i < methods.length; i++) {
String methodName = methods[i].getName();
- if (methodName.equalsIgnoreCase("setUser")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPassword")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setLogWriter")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDatabaseName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDataSourceName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setDescription")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPortNumber")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setRoleName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setServerName")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxStatements")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
-
- } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
- executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
-
- } else if (driverProperties.containsKey(methodName.toUpperCase())){
- Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
- executor.runMethod(methods[i],dataSourceObject, values);
- }
+ if (methodName.equalsIgnoreCase("setUser")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.USERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPassword")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PASSWORD),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLoginTimeOut")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGINTIMEOUT),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setLogWriter")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.LOGWRITER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDatabaseName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATABASENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDataSourceName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DATASOURCENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setDescription")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.DESCRIPTION),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setNetworkProtocol")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.NETWORKPROTOCOL),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPortNumber")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PORTNUMBER),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setRoleName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.ROLENAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setServerName")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.SERVERNAME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxStatements")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXSTATEMENTS),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setInitialPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.INITIALPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMinPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MINPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxPoolSize")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXPOOLSIZE),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setMaxIdleTime")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.MAXIDLETIME),methods[i],dataSourceObject);
+
+ } else if (methodName.equalsIgnoreCase("setPropertyCycle")){
+ executor.runJavaBeanMethod(spec.getDetail(DataSourceSpec.PROPERTYCYCLE),methods[i],dataSourceObject);
+
+ } else if (driverProperties.containsKey(methodName.toUpperCase())){
+ Vector values = (Vector) driverProperties.get(methodName.toUpperCase());
+ executor.runMethod(methods[i],dataSourceObject, values);
+ }
}
return dataSourceObject;
}
-
+
/**
* Get the extra driver properties from the DataSourceSpec object and
* parse them to a set of methodName and parameters. Prepare a hashtable
* containing these details and return.
*
- * @param spec <code> DataSourceSpec </code> object.
- * @return Hashtable containing method names and parameters,
- * @throws ResourceException If delimiter is not provided and property string
- * is not null.
+ * @param spec <code> DataSourceSpec </code> object.
+ * @return Hashtable containing method names and parameters,
+ * @throws ResourceException If delimiter is not provided and property string
+ * is not null.
*/
private Hashtable parseDriverProperties(DataSourceSpec spec) throws ResourceException{
- String delim = spec.getDetail(DataSourceSpec.DELIMITER);
+ String delim = spec.getDetail(DataSourceSpec.DELIMITER);
String prop = spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
- if ( prop == null || prop.trim().equals("")) {
- return new Hashtable();
- } else if (delim == null || delim.equals("")) {
- throw new ResourceException ("Delimiter is not provided in the configuration");
- }
-
- Hashtable properties = new Hashtable();
- delim = delim.trim();
- String sep = delim+delim;
- int sepLen = sep.length();
- String cache = prop;
- Vector methods = new Vector();
-
- while (cache.indexOf(sep) != -1) {
- int index = cache.indexOf(sep);
- String name = cache.substring(0,index);
- if (name.trim() != "") {
- methods.add(name);
- cache = cache.substring(index+sepLen);
- }
- }
-
- Enumeration allMethods = methods.elements();
- while (allMethods.hasMoreElements()) {
- String oneMethod = (String) allMethods.nextElement();
- if (!oneMethod.trim().equals("")) {
- String methodName = null;
- Vector parms = new Vector();
- StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
- for (int i=0; methodDetails.hasMoreTokens();i++ ) {
- String token = (String) methodDetails.nextToken();
- if (i==0) {
- methodName = token.toUpperCase();
- } else {
- parms.add(token);
- }
- }
- properties.put(methodName,parms);
- }
- }
- return properties;
+ if ( prop == null || prop.trim().equals("")) {
+ return new Hashtable();
+ } else if (delim == null || delim.equals("")) {
+ throw new ResourceException ("Delimiter is not provided in the configuration");
}
-
+
+ Hashtable properties = new Hashtable();
+ delim = delim.trim();
+ String sep = delim+delim;
+ int sepLen = sep.length();
+ String cache = prop;
+ Vector methods = new Vector();
+
+ while (cache.indexOf(sep) != -1) {
+ int index = cache.indexOf(sep);
+ String name = cache.substring(0,index);
+ if (name.trim() != "") {
+ methods.add(name);
+ cache = cache.substring(index+sepLen);
+ }
+ }
+
+ Enumeration allMethods = methods.elements();
+ while (allMethods.hasMoreElements()) {
+ String oneMethod = (String) allMethods.nextElement();
+ if (!oneMethod.trim().equals("")) {
+ String methodName = null;
+ Vector parms = new Vector();
+ StringTokenizer methodDetails = new StringTokenizer(oneMethod,delim);
+ for (int i=0; methodDetails.hasMoreTokens();i++ ) {
+ String token = (String) methodDetails.nextToken();
+ if (i==0) {
+ methodName = token.toUpperCase();
+ } else {
+ parms.add(token);
+ }
+ }
+ properties.put(methodName,parms);
+ }
+ }
+ return properties;
+ }
+
/**
* Creates a Datasource object according to the spec.
*
- * @return Initial DataSource Object instance.
- * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
- * properly.
+ * @return Initial DataSource Object instance.
+ * @throws <code>ResourceException</code> If class name is wrong or classpath is not set
+ * properly.
*/
private Object getDataSourceObject() throws ResourceException{
- String className = spec.getDetail(DataSourceSpec.CLASSNAME);
- try {
+ String className = spec.getDetail(DataSourceSpec.CLASSNAME);
+ try {
Class dataSourceClass = Class.forName(className);
Object dataSourceObject = dataSourceClass.newInstance();
return dataSourceObject;
} catch(ClassNotFoundException cfne){
- _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
-
+ _logger.log(Level.SEVERE, "jdbc.exc_cnfe_ds", cfne);
+
throw new ResourceException("Class Name is wrong or Class path is not set for :" + className);
} catch(InstantiationException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_inst", className);
throw new ResourceException("Error in instantiating" + className);
} catch(IllegalAccessException ce) {
- _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
+ _logger.log(Level.SEVERE, "jdbc.exc_acc_inst", className);
throw new ResourceException("Access Error in instantiating" + className);
}
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceSpec.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
index ef6c4c9..3dc154d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/DataSourceSpec.java
@@ -19,92 +19,92 @@
import java.util.Hashtable;
/**
- * Encapsulate the DataSource object details obtained from
+ * Encapsulate the DataSource object details obtained from
* ManagedConnectionFactory.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class DataSourceSpec implements java.io.Serializable{
- public static final int USERNAME = 1;
- public static final int PASSWORD = 2;
- public static final int URL = 3;
- public static final int LOGINTIMEOUT = 4;
- public static final int LOGWRITER = 5;
- public static final int DATABASENAME = 6;
- public static final int DATASOURCENAME = 7;
- public static final int DESCRIPTION = 8;
- public static final int NETWORKPROTOCOL = 9;
- public static final int PORTNUMBER = 10;
- public static final int ROLENAME = 11;
- public static final int SERVERNAME = 12;
- public static final int MAXSTATEMENTS = 13;
- public static final int INITIALPOOLSIZE = 14;
- public static final int MINPOOLSIZE = 15;
- public static final int MAXPOOLSIZE = 16;
- public static final int MAXIDLETIME = 17;
- public static final int PROPERTYCYCLE = 18;
- public static final int DRIVERPROPERTIES = 19;
- public static final int CLASSNAME = 20;
- public static final int DELIMITER = 21;
-
- public static final int XADATASOURCE = 22;
- public static final int DATASOURCE = 23;
- public static final int CONNECTIONPOOLDATASOURCE = 24;
-
- //GJCINT
- public static final int CONNECTIONVALIDATIONREQUIRED = 25;
- public static final int VALIDATIONMETHOD = 26;
- public static final int VALIDATIONTABLENAME = 27;
-
- public static final int TRANSACTIONISOLATION = 28;
- public static final int GUARANTEEISOLATIONLEVEL = 29;
-
+ public static final int USERNAME = 1;
+ public static final int PASSWORD = 2;
+ public static final int URL = 3;
+ public static final int LOGINTIMEOUT = 4;
+ public static final int LOGWRITER = 5;
+ public static final int DATABASENAME = 6;
+ public static final int DATASOURCENAME = 7;
+ public static final int DESCRIPTION = 8;
+ public static final int NETWORKPROTOCOL = 9;
+ public static final int PORTNUMBER = 10;
+ public static final int ROLENAME = 11;
+ public static final int SERVERNAME = 12;
+ public static final int MAXSTATEMENTS = 13;
+ public static final int INITIALPOOLSIZE = 14;
+ public static final int MINPOOLSIZE = 15;
+ public static final int MAXPOOLSIZE = 16;
+ public static final int MAXIDLETIME = 17;
+ public static final int PROPERTYCYCLE = 18;
+ public static final int DRIVERPROPERTIES = 19;
+ public static final int CLASSNAME = 20;
+ public static final int DELIMITER = 21;
+
+ public static final int XADATASOURCE = 22;
+ public static final int DATASOURCE = 23;
+ public static final int CONNECTIONPOOLDATASOURCE = 24;
+
+ //GJCINT
+ public static final int CONNECTIONVALIDATIONREQUIRED = 25;
+ public static final int VALIDATIONMETHOD = 26;
+ public static final int VALIDATIONTABLENAME = 27;
+
+ public static final int TRANSACTIONISOLATION = 28;
+ public static final int GUARANTEEISOLATIONLEVEL = 29;
+
private Hashtable details = new Hashtable();
-
+
/**
* Set the property.
*
- * @param property Property Name to be set.
- * @param value Value of property to be set.
+ * @param property Property Name to be set.
+ * @param value Value of property to be set.
*/
public void setDetail(int property, String value) {
- details.put(new Integer(property),value);
+ details.put(new Integer(property),value);
}
-
+
/**
* Get the value of property
*
- * @return Value of the property.
+ * @return Value of the property.
*/
public String getDetail(int property) {
- if (details.containsKey(new Integer(property))) {
- return (String) details.get(new Integer(property));
- } else {
- return null;
- }
+ if (details.containsKey(new Integer(property))) {
+ return (String) details.get(new Integer(property));
+ } else {
+ return null;
+ }
}
-
+
/**
* Checks whether two <code>DataSourceSpec</code> objects
* are equal or not.
*
- * @param obj Instance of <code>DataSourceSpec</code> object.
+ * @param obj Instance of <code>DataSourceSpec</code> object.
*/
public boolean equals(Object obj) {
- if (obj instanceof DataSourceSpec) {
- return this.details.equals(((DataSourceSpec)obj).details);
- }
- return false;
+ if (obj instanceof DataSourceSpec) {
+ return this.details.equals(((DataSourceSpec)obj).details);
+ }
+ return false;
}
-
+
/**
* Retrieves the hashCode of this <code>DataSourceSpec</code> object.
*
- * @return hashCode of this object.
+ * @return hashCode of this object.
*/
public int hashCode() {
- return this.details.hashCode();
- }
+ return this.details.hashCode();
+ }
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/build.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/build.xml
index ef438fc..3b4faeb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/common/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/common"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -36,13 +36,13 @@
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
-
+
<target name="package13" depends="package"/>
<target name="package14" depends="package"/>
<target name="build13" depends="compile13, package13"/>
<target name="build14" depends="compile14, package14"/>
-
+
<target name="build" depends="build13, build14"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
index dbb5729..beabe55 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ConnectionHolder.java
@@ -24,24 +24,24 @@
import java.util.concurrent.Executor;
/**
- * Holds the java.sql.Connection object, which is to be
+ * Holds the java.sql.Connection object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
-public class ConnectionHolder implements Connection{
+public class ConnectionHolder implements Connection{
private Connection con;
-
+
private ManagedConnection mc;
-
- private boolean wrappedAlready = false;
-
+
+ private boolean wrappedAlready = false;
+
private boolean isClosed = false;
-
+
private boolean valid = true;
-
+
private boolean active = false;
/**
* The active flag is false when the connection handle is
@@ -53,219 +53,219 @@
* function, the above method invocation succeeds; otherwise
* an exception is thrown.
*/
-
+
/**
* Constructs a Connection holder.
- *
- * @param con <code>java.sql.Connection</code> object.
+ *
+ * @param con <code>java.sql.Connection</code> object.
*/
public ConnectionHolder(Connection con, ManagedConnection mc) {
this.con = con;
this.mc = mc;
}
-
+
/**
* Returns the actual connection in this holder object.
- *
- * @return Connection object.
+ *
+ * @return Connection object.
*/
Connection getConnection() {
- return con;
+ return con;
}
-
+
/**
* Sets the flag to indicate that, the connection is wrapped already or not.
*
- * @param wrapFlag
+ * @param wrapFlag
*/
void wrapped(boolean wrapFlag){
this.wrappedAlready = wrapFlag;
}
-
+
/**
* Returns whether it is wrapped already or not.
*
- * @return wrapped flag.
+ * @return wrapped flag.
*/
boolean isWrapped(){
return wrappedAlready;
}
-
+
/**
* Returns the <code>ManagedConnection</code> instance responsible
* for this connection.
*
- * @return <code>ManagedConnection</code> instance.
+ * @return <code>ManagedConnection</code> instance.
*/
ManagedConnection getManagedConnection() {
return mc;
}
-
+
/**
* Replace the actual <code>java.sql.Connection</code> object with the one
- * supplied. Also replace <code>ManagedConnection</code> link.
+ * supplied. Also replace <code>ManagedConnection</code> link.
*
- * @param con <code>Connection</code> object.
- * @param mc <code> ManagedConnection</code> object.
+ * @param con <code>Connection</code> object.
+ * @param mc <code> ManagedConnection</code> object.
*/
void associateConnection(Connection con, ManagedConnection mc) {
- this.mc = mc;
- this.con = con;
+ this.mc = mc;
+ this.con = con;
}
-
+
/**
* Clears all warnings reported for the underlying connection object.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- public void clearWarnings() throws SQLException{
- checkValidity();
+ public void clearWarnings() throws SQLException{
+ checkValidity();
con.clearWarnings();
}
-
+
/**
- * Closes the logical connection.
+ * Closes the logical connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void close() throws SQLException{
isClosed = true;
- mc.connectionClosed(null, this);
+ mc.connectionClosed(null, this);
}
-
+
/**
* Invalidates this object.
*/
public void invalidate() {
- valid = false;
+ valid = false;
}
-
+
/**
* Closes the physical connection involved in this.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
- void actualClose() throws SQLException{
+ void actualClose() throws SQLException{
con.close();
}
-
+
/**
* Commit the changes in the underlying Connection.
*
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public void commit() throws SQLException {
- checkValidity();
- con.commit();
+ checkValidity();
+ con.commit();
}
-
+
/**
* Creates a statement from the underlying Connection
*
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement() throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement();
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException {
- checkValidity();
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency);
}
-
+
/**
* Creates a statement from the underlying Connection.
*
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code>Statement</code> object.
- * @throws SQLException In case of a database error.
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code>Statement</code> object.
+ * @throws SQLException In case of a database error.
*/
- public Statement createStatement(int resultSetType, int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
+ public Statement createStatement(int resultSetType, int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
return con.createStatement(resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ resultSetHoldabilty);
}
-
+
/**
* Retrieves the current auto-commit mode for the underlying <code> Connection</code>.
*
* @return The current state of connection's auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public boolean getAutoCommit() throws SQLException {
- checkValidity();
- return con.getAutoCommit();
- }
-
+ checkValidity();
+ return con.getAutoCommit();
+ }
+
/**
* Retrieves the underlying <code>Connection</code> object's catalog name.
*
- * @return Catalog Name.
- * @throws SQLException In case of a database error.
+ * @return Catalog Name.
+ * @throws SQLException In case of a database error.
*/
public String getCatalog() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getCatalog();
}
-
+
/**
* Retrieves the current holdability of <code>ResultSet</code> objects created
* using this connection object.
*
- * @return holdability value.
- * @throws SQLException In case of a database error.
+ * @return holdability value.
+ * @throws SQLException In case of a database error.
*/
public int getHoldability() throws SQLException {
- checkValidity();
- return con.getHoldability();
+ checkValidity();
+ return con.getHoldability();
}
-
+
/**
* Retrieves the <code>DatabaseMetaData</code>object from the underlying
* <code> Connection </code> object.
*
* @return <code>DatabaseMetaData</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public DatabaseMetaData getMetaData() throws SQLException {
- checkValidity();
- return con.getMetaData();
+ checkValidity();
+ return con.getMetaData();
}
-
+
/**
* Retrieves this <code>Connection</code> object's current transaction isolation level.
*
* @return Transaction level
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public int getTransactionIsolation() throws SQLException {
- checkValidity();
+ checkValidity();
return con.getTransactionIsolation();
}
-
+
/**
- * Retrieves the <code>Map</code> object associated with
+ * Retrieves the <code>Map</code> object associated with
* <code> Connection</code> Object.
*
- * @return TypeMap set in this object.
- * @throws SQLException In case of a database error.
+ * @return TypeMap set in this object.
+ * @throws SQLException In case of a database error.
*/
public Map getTypeMap() throws SQLException {
- checkValidity();
- return con.getTypeMap();
+ checkValidity();
+ return con.getTypeMap();
}
public void setTypeMap(Map<String, Class<?>> map) throws SQLException {
@@ -277,184 +277,184 @@
* <code>Connection</code> object.
*
* @return First <code> SQLWarning</code> Object or null.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public SQLWarning getWarnings() throws SQLException {
- checkValidity();
- return con.getWarnings();
+ checkValidity();
+ return con.getWarnings();
}
-
+
/**
* Retrieves whether underlying <code>Connection</code> object is closed.
*
- * @return true if <code>Connection</code> object is closed, false
- * if it is closed.
- * @throws SQLException In case of a database error.
+ * @return true if <code>Connection</code> object is closed, false
+ * if it is closed.
+ * @throws SQLException In case of a database error.
*/
public boolean isClosed() throws SQLException {
- return isClosed;
+ return isClosed;
}
-
+
/**
* Retrieves whether this <code>Connection</code> object is read-only.
*
- * @return true if <code> Connection </code> is read-only, false other-wise
- * @throws SQLException In case of a database error.
+ * @return true if <code> Connection </code> is read-only, false other-wise
+ * @throws SQLException In case of a database error.
*/
public boolean isReadOnly() throws SQLException {
- checkValidity();
- return con.isReadOnly();
+ checkValidity();
+ return con.isReadOnly();
}
-
+
/**
* Converts the given SQL statement into the system's native SQL grammer.
*
- * @param sql SQL statement , to be converted.
- * @return Converted SQL string.
- * @throws SQLException In case of a database error.
+ * @param sql SQL statement , to be converted.
+ * @return Converted SQL string.
+ * @throws SQLException In case of a database error.
*/
public String nativeSQL(String sql) throws SQLException {
- checkValidity();
- return con.nativeSQL(sql);
+ checkValidity();
+ return con.nativeSQL(sql);
}
-
+
/**
* Creates a <code> CallableStatement </code> object for calling database
* stored procedures.
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public CallableStatement prepareCall(String sql) throws SQLException {
- checkValidity();
- return con.prepareCall(sql);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> CallableStatement </code> object for calling database
- * stored procedures.
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> CallableStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public CallableStatement prepareCall(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException{
- checkValidity();
- return con.prepareCall(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
+ checkValidity();
+ return con.prepareCall(sql);
}
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> CallableStatement </code> object for calling database
+ * stored procedures.
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> CallableStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public CallableStatement prepareCall(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException{
+ checkValidity();
+ return con.prepareCall(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
+ * @param sql SQL Statement
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql);
+ checkValidity();
+ return con.prepareStatement(sql);
}
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,autoGeneratedKeys);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param columnIndexes an array of column indexes indicating the columns that should be
- * returned from the inserted row or rows.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnIndexes);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql,int resultSetType,
- int resultSetConcurrency) throws SQLException{
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
- }
-
- /**
- * Creates a <code> PreparedStatement </code> object for sending
- * paramterized SQL statements to database
- *
- * @param sql SQL Statement
- * @param resultSetType Type of the ResultSet
- * @param resultSetConcurrency ResultSet Concurrency.
- * @param resultSetHoldability ResultSet Holdability.
- * @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
- */
- public PreparedStatement prepareStatement(String sql, int resultSetType,
- int resultSetConcurrency,
- int resultSetHoldabilty) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
- resultSetHoldabilty);
- }
/**
- * Creates a <code> PreparedStatement </code> object for sending
+ * Creates a <code> PreparedStatement </code> object for sending
* paramterized SQL statements to database
*
- * @param sql SQL Statement
- * @param columnNames Name of bound columns.
+ * @param sql SQL Statement
+ * @param autoGeneratedKeys a flag indicating AutoGeneratedKeys need to be returned.
* @return <code> PreparedStatement</code> object.
- * @throws SQLException In case of a database error.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,autoGeneratedKeys);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnIndexes an array of column indexes indicating the columns that should be
+ * returned from the inserted row or rows.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql,columnIndexes);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql,int resultSetType,
+ int resultSetConcurrency) throws SQLException{
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param resultSetType Type of the ResultSet
+ * @param resultSetConcurrency ResultSet Concurrency.
+ * @param resultSetHoldability ResultSet Holdability.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
+ */
+ public PreparedStatement prepareStatement(String sql, int resultSetType,
+ int resultSetConcurrency,
+ int resultSetHoldabilty) throws SQLException {
+ checkValidity();
+ return con.prepareStatement(sql, resultSetType, resultSetConcurrency,
+ resultSetHoldabilty);
+ }
+
+ /**
+ * Creates a <code> PreparedStatement </code> object for sending
+ * paramterized SQL statements to database
+ *
+ * @param sql SQL Statement
+ * @param columnNames Name of bound columns.
+ * @return <code> PreparedStatement</code> object.
+ * @throws SQLException In case of a database error.
*/
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException {
- checkValidity();
- return con.prepareStatement(sql,columnNames);
+ checkValidity();
+ return con.prepareStatement(sql,columnNames);
}
public Clob createClob() throws SQLException {
@@ -504,150 +504,150 @@
/**
* Removes the given <code>Savepoint</code> object from the current transaction.
*
- * @param savepoint <code>Savepoint</code> object
- * @throws SQLException In case of a database error.
+ * @param savepoint <code>Savepoint</code> object
+ * @throws SQLException In case of a database error.
*/
public void releaseSavepoint(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.releaseSavepoint(savepoint);
- }
-
+ checkValidity();
+ con.releaseSavepoint(savepoint);
+ }
+
/**
* Rolls back the changes made in the current transaction.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback() throws SQLException {
- checkValidity();
- con.rollback();
+ checkValidity();
+ con.rollback();
}
-
+
/**
* Rolls back the changes made after the savepoint.
*
- * @throws SQLException In case of a database error.
- */
+ * @throws SQLException In case of a database error.
+ */
public void rollback(Savepoint savepoint) throws SQLException {
- checkValidity();
- con.rollback(savepoint);
+ checkValidity();
+ con.rollback(savepoint);
}
-
+
/**
* Sets the auto-commmit mode of the <code>Connection</code> object.
*
- * @param autoCommit boolean value indicating the auto-commit mode.
- * @throws SQLException In case of a database error.
+ * @param autoCommit boolean value indicating the auto-commit mode.
+ * @throws SQLException In case of a database error.
*/
public void setAutoCommit(boolean autoCommit) throws SQLException {
- checkValidity();
- con.setAutoCommit(autoCommit);
+ checkValidity();
+ con.setAutoCommit(autoCommit);
}
-
+
/**
* Sets the catalog name to the <code>Connection</code> object
*
- * @param catalog Catalog name.
- * @throws SQLException In case of a database error.
+ * @param catalog Catalog name.
+ * @throws SQLException In case of a database error.
*/
public void setCatalog(String catalog) throws SQLException {
- checkValidity();
- con.setCatalog(catalog);
+ checkValidity();
+ con.setCatalog(catalog);
}
-
+
/**
- * Sets the holdability of <code>ResultSet</code> objects created
+ * Sets the holdability of <code>ResultSet</code> objects created
* using this <code>Connection</code> object.
*
- * @param holdability A <code>ResultSet</code> holdability constant
- * @throws SQLException In case of a database error.
+ * @param holdability A <code>ResultSet</code> holdability constant
+ * @throws SQLException In case of a database error.
*/
public void setHoldability(int holdability) throws SQLException {
- checkValidity();
- con.setHoldability(holdability);
+ checkValidity();
+ con.setHoldability(holdability);
}
-
+
/**
- * Puts the connection in read-only mode as a hint to the driver to
+ * Puts the connection in read-only mode as a hint to the driver to
* perform database optimizations.
*
- * @param readOnly true enables read-only mode, false disables it.
- * @throws SQLException In case of a database error.
+ * @param readOnly true enables read-only mode, false disables it.
+ * @throws SQLException In case of a database error.
*/
public void setReadOnly(boolean readOnly) throws SQLException {
- checkValidity();
- con.setReadOnly(readOnly);
+ checkValidity();
+ con.setReadOnly(readOnly);
}
-
+
/**
* Creates and unnamed savepoint and returns an object corresponding to that.
*
- * @return <code>Savepoint</code> object.
+ * @return <code>Savepoint</code> object.
* @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint() throws SQLException {
- checkValidity();
- return con.setSavepoint();
+ checkValidity();
+ return con.setSavepoint();
}
-
+
/**
* Creates a savepoint with the name and returns an object corresponding to that.
*
- * @param name Name of the savepoint.
- * @return <code>Savepoint</code> object.
- * @throws SQLException In case of a database error.
+ * @param name Name of the savepoint.
+ * @return <code>Savepoint</code> object.
+ * @throws SQLException In case of a database error.
*/
public Savepoint setSavepoint(String name) throws SQLException {
- checkValidity();
- return con.setSavepoint(name);
- }
-
+ checkValidity();
+ return con.setSavepoint(name);
+ }
+
/**
* Creates the transaction isolation level.
*
- * @param level transaction isolation level.
- * @throws SQLException In case of a database error.
+ * @param level transaction isolation level.
+ * @throws SQLException In case of a database error.
*/
public void setTransactionIsolation(int level) throws SQLException {
- checkValidity();
- con.setTransactionIsolation(level);
- }
-
+ checkValidity();
+ con.setTransactionIsolation(level);
+ }
+
public int getNetworkTimeout() throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException {
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void abort(Executor executor) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public String getSchema() throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
+
public void setSchema(String schema) throws SQLException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 new feature.");
}
-
-
+
+
/**
* Checks the validity of this object
*/
private void checkValidity() throws SQLException {
- if (isClosed) throw new SQLException ("Connection closed");
- if (!valid) throw new SQLException ("Invalid Connection");
- if(active == false) {
- mc.checkIfActive(this);
- }
+ if (isClosed) throw new SQLException ("Connection closed");
+ if (!valid) throw new SQLException ("Invalid Connection");
+ if(active == false) {
+ mc.checkIfActive(this);
+ }
}
-
+
/**
* Sets the active flag to true
*
- * @param actv boolean
+ * @param actv boolean
*/
void setActive(boolean actv) {
active = actv;
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
index ac7e748..f0675a4 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ManagedConnectionFactory.java
@@ -33,19 +33,19 @@
* This class is extended by the DataSource specific <code>ManagedConnection</code> factories
* and the <code>ManagedConnectionFactory</code> for the <code>DriverManager</code>.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
-public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
+public abstract class ManagedConnectionFactory implements jakarta.resource.spi.ManagedConnectionFactory,
java.io.Serializable {
-
+
protected DataSourceSpec spec = new DataSourceSpec();
protected transient DataSourceObjectBuilder dsObjBuilder;
-
+
protected java.io.PrintWriter logWriter = null;
protected jakarta.resource.spi.ResourceAdapter ra = null;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -54,8 +54,8 @@
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the resource adapter is used here.
- *
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory() {
if(logWriter != null) {
@@ -63,16 +63,16 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, null);
-
+
return cf;
}
-
+
/**
* Creates a Connection Factory instance. The <code>ConnectionManager</code> implementation
* of the application server is used here.
- *
- * @param cxManager <code>ConnectionManager</code> passed by the application server
- * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
+ *
+ * @param cxManager <code>ConnectionManager</code> passed by the application server
+ * @return Generic JDBC Connector implementation of <code>javax.sql.DataSource</code>
*/
public Object createConnectionFactory(jakarta.resource.spi.ConnectionManager cxManager) {
if(logWriter != null) {
@@ -80,55 +80,55 @@
}
com.sun.jdbcra.spi.DataSource cf = new com.sun.jdbcra.spi.DataSource(
(jakarta.resource.spi.ManagedConnectionFactory)this, cxManager);
- return cf;
+ return cf;
}
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public abstract jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException;
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public abstract boolean equals(Object other);
-
+
/**
* Get the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setLogWriter</code>
+ * @return <code>PrintWriter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setLogWriter</code>
*/
public java.io.PrintWriter getLogWriter() {
return logWriter;
}
-
+
/**
* Get the <code>ResourceAdapter</code> for this <code>ManagedConnectionFactory</code> instance.
*
- * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
- * @see <code>setResourceAdapter</code>
+ * @return <code>ResourceAdapter</code> associated with this <code>ManagedConnectionFactory</code> instance
+ * @see <code>setResourceAdapter</code>
*/
public jakarta.resource.spi.ResourceAdapter getResourceAdapter() {
if(logWriter != null) {
@@ -136,11 +136,11 @@
}
return ra;
}
-
+
/**
* Returns the hash code for this <code>ManagedConnectionFactory</code>.
*
- * @return hash code for this <code>ManagedConnectionFactory</code>
+ * @return hash code for this <code>ManagedConnectionFactory</code>
*/
public int hashCode(){
if(logWriter != null) {
@@ -148,41 +148,41 @@
}
return spec.hashCode();
}
-
+
/**
- * Returns a matched <code>ManagedConnection</code> from the candidate
+ * Returns a matched <code>ManagedConnection</code> from the candidate
* set of <code>ManagedConnection</code> objects.
- *
- * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
- * @param subject passed by the application server
- * for retrieving information required for matching
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
- * for retrieving information required for matching
- * @return <code>ManagedConnection</code> that is the best match satisfying this request
- * @throws ResourceException if there is an error accessing the <code>Subject</code>
- * parameter or the <code>Set</code> of <code>ManagedConnection</code>
- * objects passed by the application server
+ *
+ * @param connectionSet <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
+ * @param subject passed by the application server
+ * for retrieving information required for matching
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> passed by the application server
+ * for retrieving information required for matching
+ * @return <code>ManagedConnection</code> that is the best match satisfying this request
+ * @throws ResourceException if there is an error accessing the <code>Subject</code>
+ * parameter or the <code>Set</code> of <code>ManagedConnection</code>
+ * objects passed by the application server
*/
- public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
+ public jakarta.resource.spi.ManagedConnection matchManagedConnections(java.util.Set connectionSet,
javax.security.auth.Subject subject, ConnectionRequestInfo cxRequestInfo) throws ResourceException {
if(logWriter != null) {
logWriter.println("In matchManagedConnections");
}
-
+
if(connectionSet == null) {
return null;
}
-
+
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
java.util.Iterator iter = connectionSet.iterator();
com.sun.jdbcra.spi.ManagedConnection mc = null;
while(iter.hasNext()) {
try {
mc = (com.sun.jdbcra.spi.ManagedConnection) iter.next();
} catch(java.util.NoSuchElementException nsee) {
- _logger.log(Level.SEVERE, "jdbc.exc_iter");
+ _logger.log(Level.SEVERE, "jdbc.exc_iter");
throw new ResourceException(nsee.getMessage());
}
if(pc == null && this.equals(mc.getManagedConnectionFactory())) {
@@ -191,7 +191,7 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.exc_re", re);
+ _logger.log(Level.SEVERE, "jdbc.exc_re", re);
mc.connectionErrorOccurred(re, null);
}
} else if(SecurityUtils.isPasswordCredentialEqual(pc, mc.getPasswordCredential()) == true) {
@@ -200,45 +200,45 @@
isValid(mc);
return mc;
} catch(ResourceException re) {
- _logger.log(Level.SEVERE, "jdbc.re");
+ _logger.log(Level.SEVERE, "jdbc.re");
mc.connectionErrorOccurred(re, null);
}
}
}
return null;
}
-
+
//GJCINT
/**
* Checks if a <code>ManagedConnection</code> is to be validated or not
* and validates it or returns.
- *
- * @param mc <code>ManagedConnection</code> to be validated
- * @throws ResourceException if the connection is not valid or
- * if validation method is not proper
+ *
+ * @param mc <code>ManagedConnection</code> to be validated
+ * @throws ResourceException if the connection is not valid or
+ * if validation method is not proper
*/
void isValid(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
if(mc.isTransactionInProgress()) {
- return;
+ return;
}
-
- boolean connectionValidationRequired =
+
+ boolean connectionValidationRequired =
(new Boolean(spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED).toLowerCase())).booleanValue();
if( connectionValidationRequired == false || mc == null) {
return;
}
-
-
+
+
String validationMethod = spec.getDetail(DataSourceSpec.VALIDATIONMETHOD).toLowerCase();
-
+
mc.checkIfValid();
/**
* The above call checks if the actual physical connection
* is usable or not.
*/
java.sql.Connection con = mc.getActualConnection();
-
+
if(validationMethod.equals("auto-commit") == true) {
isValidByAutoCommit(con);
} else if(validationMethod.equalsIgnoreCase("meta-data") == true) {
@@ -249,28 +249,28 @@
throw new ResourceException("The validation method is not proper");
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its auto commit property.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByAutoCommit(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
- // Notice that using something like
+ // Notice that using something like
// dbCon.setAutoCommit(dbCon.getAutoCommit()) will cause problems with
// some drivers like sybase
- // We do not validate connections that are already enlisted
- //in a transaction
- // We cycle autocommit to true and false to by-pass drivers that
- // might cache the call to set autocomitt
+ // We do not validate connections that are already enlisted
+ //in a transaction
+ // We cycle autocommit to true and false to by-pass drivers that
+ // might cache the call to set autocomitt
// Also notice that some XA data sources will throw and exception if
// you try to call setAutoCommit, for them this method is not recommended
@@ -281,90 +281,90 @@
con.rollback(); // prevents uncompleted transaction exceptions
con.setAutoCommit(true);
}
-
- con.setAutoCommit(ac);
+
+ con.setAutoCommit(ac);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
+ _logger.log(Level.SEVERE, "jdbc.exc_autocommit");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by checking its meta data.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @throws ResourceException if the connection is not valid
*/
protected void isValidByMetaData(java.sql.Connection con) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.DatabaseMetaData dmd = con.getMetaData();
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException("The connection is not valid as "
+ "getting the meta data failed: " + sqle.getMessage());
}
}
-
+
/**
* Checks if a <code>java.sql.Connection</code> is valid or not
* by querying a table.
- *
- * @param con <code>java.sql.Connection</code> to be validated
- * @param tableName table which should be queried
- * @throws ResourceException if the connection is not valid
+ *
+ * @param con <code>java.sql.Connection</code> to be validated
+ * @param tableName table which should be queried
+ * @throws ResourceException if the connection is not valid
*/
- protected void isValidByTableQuery(java.sql.Connection con,
+ protected void isValidByTableQuery(java.sql.Connection con,
String tableName) throws ResourceException {
if(con == null) {
throw new ResourceException("The connection is not valid as "
+ "the connection is null");
}
-
+
try {
java.sql.Statement stmt = con.createStatement();
java.sql.ResultSet rs = stmt.executeQuery("SELECT * FROM " + tableName);
} catch(Exception sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_execute");
+ _logger.log(Level.SEVERE, "jdbc.exc_execute");
throw new ResourceException("The connection is not valid as "
+ "querying the table " + tableName + " failed: " + sqle.getMessage());
}
}
-
+
/**
* Sets the isolation level specified in the <code>ConnectionRequestInfo</code>
* for the <code>ManagedConnection</code> passed.
*
- * @param mc <code>ManagedConnection</code>
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
protected void setIsolation(com.sun.jdbcra.spi.ManagedConnection mc) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- con.setTransactionIsolation(tranIsolationInt);
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The transaction isolation could "
- + "not be set: " + sqle.getMessage());
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ con.setTransactionIsolation(tranIsolationInt);
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The transaction isolation could "
+ + "not be set: " + sqle.getMessage());
+ }
+ }
}
-
+
/**
* Resets the isolation level for the <code>ManagedConnection</code> passed.
* If the transaction level is to be guaranteed to be the same as the one
@@ -373,382 +373,382 @@
* isolation level from the <code>ConnectionRequestInfo</code> passed. Else,
* it sets it to the transaction isolation passed.
*
- * @param mc <code>ManagedConnection</code>
- * @param tranIsol int
- * @throws ResourceException if the isolation property is invalid
- * or if the isolation cannot be set over the connection
+ * @param mc <code>ManagedConnection</code>
+ * @param tranIsol int
+ * @throws ResourceException if the isolation property is invalid
+ * or if the isolation cannot be set over the connection
*/
void resetIsolation(com.sun.jdbcra.spi.ManagedConnection mc, int tranIsol) throws ResourceException {
-
- java.sql.Connection con = mc.getActualConnection();
- if(con == null) {
- return;
- }
-
- String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
- if(tranIsolation != null && tranIsolation.equals("") == false) {
- String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
-
- if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
- boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
-
- if(guarantee) {
- int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
- try {
- if(tranIsolationInt != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsolationInt);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- } else {
- try {
- if(tranIsol != con.getTransactionIsolation()) {
- con.setTransactionIsolation(tranIsol);
- }
- } catch(java.sql.SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
- throw new ResourceException("The isolation level could not be set: "
- + sqle.getMessage());
- }
- }
- }
- }
+
+ java.sql.Connection con = mc.getActualConnection();
+ if(con == null) {
+ return;
+ }
+
+ String tranIsolation = spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
+ if(tranIsolation != null && tranIsolation.equals("") == false) {
+ String guaranteeIsolationLevel = spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
+
+ if(guaranteeIsolationLevel != null && guaranteeIsolationLevel.equals("") == false) {
+ boolean guarantee = (new Boolean(guaranteeIsolationLevel.toLowerCase())).booleanValue();
+
+ if(guarantee) {
+ int tranIsolationInt = getTransactionIsolationInt(tranIsolation);
+ try {
+ if(tranIsolationInt != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsolationInt);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ } else {
+ try {
+ if(tranIsol != con.getTransactionIsolation()) {
+ con.setTransactionIsolation(tranIsol);
+ }
+ } catch(java.sql.SQLException sqle) {
+ _logger.log(Level.SEVERE, "jdbc.exc_tx_level");
+ throw new ResourceException("The isolation level could not be set: "
+ + sqle.getMessage());
+ }
+ }
+ }
+ }
}
-
+
/**
* Gets the integer equivalent of the string specifying
* the transaction isolation.
*
- * @param tranIsolation string specifying the isolation level
- * @return tranIsolationInt the <code>java.sql.Connection</code> constant
- * for the string specifying the isolation.
+ * @param tranIsolation string specifying the isolation level
+ * @return tranIsolationInt the <code>java.sql.Connection</code> constant
+ * for the string specifying the isolation.
*/
private int getTransactionIsolationInt(String tranIsolation) throws ResourceException {
- if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
- return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
- return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
- return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- } else if(tranIsolation.equalsIgnoreCase("serializable")) {
- return java.sql.Connection.TRANSACTION_SERIALIZABLE;
- } else {
- throw new ResourceException("Invalid transaction isolation; the transaction "
- + "isolation level can be empty or any of the following: "
- + "read-uncommitted, read-committed, repeatable-read, serializable");
- }
+ if(tranIsolation.equalsIgnoreCase("read-uncommitted")) {
+ return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("read-committed")) {
+ return java.sql.Connection.TRANSACTION_READ_COMMITTED;
+ } else if(tranIsolation.equalsIgnoreCase("repeatable-read")) {
+ return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
+ } else if(tranIsolation.equalsIgnoreCase("serializable")) {
+ return java.sql.Connection.TRANSACTION_SERIALIZABLE;
+ } else {
+ throw new ResourceException("Invalid transaction isolation; the transaction "
+ + "isolation level can be empty or any of the following: "
+ + "read-uncommitted, read-committed, repeatable-read, serializable");
+ }
}
-
+
/**
* Set the log writer for this <code>ManagedConnectionFactory</code> instance.
*
- * @param out <code>PrintWriter</code> passed by the application server
- * @see <code>getLogWriter</code>
+ * @param out <code>PrintWriter</code> passed by the application server
+ * @see <code>getLogWriter</code>
*/
public void setLogWriter(java.io.PrintWriter out) {
logWriter = out;
}
-
+
/**
* Set the associated <code>ResourceAdapter</code> JavaBean.
*
- * @param ra <code>ResourceAdapter</code> associated with this
- * <code>ManagedConnectionFactory</code> instance
- * @see <code>getResourceAdapter</code>
+ * @param ra <code>ResourceAdapter</code> associated with this
+ * <code>ManagedConnectionFactory</code> instance
+ * @see <code>getResourceAdapter</code>
*/
public void setResourceAdapter(jakarta.resource.spi.ResourceAdapter ra) {
- this.ra = ra;
+ this.ra = ra;
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setUser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getUser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the user name
*
- * @param user <code>String</code>
+ * @param user <code>String</code>
*/
public void setuser(String user) {
spec.setDetail(DataSourceSpec.USERNAME, user);
}
-
+
/**
* Gets the user name
*
- * @return user
+ * @return user
*/
public String getuser() {
return spec.getDetail(DataSourceSpec.USERNAME);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setPassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getPassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the password
*
- * @param passwd <code>String</code>
+ * @param passwd <code>String</code>
*/
public void setpassword(String passwd) {
spec.setDetail(DataSourceSpec.PASSWORD, passwd);
}
-
+
/**
* Gets the password
*
- * @return passwd
+ * @return passwd
*/
public String getpassword() {
return spec.getDetail(DataSourceSpec.PASSWORD);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setClassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getClassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets the class name of the data source
*
- * @param className <code>String</code>
+ * @param className <code>String</code>
*/
public void setclassName(String className) {
spec.setDetail(DataSourceSpec.CLASSNAME, className);
}
-
+
/**
* Gets the class name of the data source
*
- * @return className
+ * @return className
*/
public String getclassName() {
return spec.getDetail(DataSourceSpec.CLASSNAME);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setConnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getConnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets if connection validation is required or not
*
- * @param conVldReq <code>String</code>
+ * @param conVldReq <code>String</code>
*/
public void setconnectionValidationRequired(String conVldReq) {
spec.setDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED, conVldReq);
}
-
+
/**
* Returns if connection validation is required or not
*
- * @return connection validation requirement
+ * @return connection validation requirement
*/
public String getconnectionValidationRequired() {
return spec.getDetail(DataSourceSpec.CONNECTIONVALIDATIONREQUIRED);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setValidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getValidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the validation method required
*
- * @param validationMethod <code>String</code>
+ * @param validationMethod <code>String</code>
*/
public void setvalidationMethod(String validationMethod) {
spec.setDetail(DataSourceSpec.VALIDATIONMETHOD, validationMethod);
}
-
+
/**
* Returns the connection validation method type
*
- * @return validation method
+ * @return validation method
*/
public String getvalidationMethod() {
return spec.getDetail(DataSourceSpec.VALIDATIONMETHOD);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setValidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getValidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the table checked for during validation
*
- * @param table <code>String</code>
+ * @param table <code>String</code>
*/
public void setvalidationTableName(String table) {
spec.setDetail(DataSourceSpec.VALIDATIONTABLENAME, table);
}
-
+
/**
* Returns the table checked for during validation
*
- * @return table
+ * @return table
*/
public String getvalidationTableName() {
return spec.getDetail(DataSourceSpec.VALIDATIONTABLENAME);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void setTransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String getTransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets the transaction isolation level
*
- * @param trnIsolation <code>String</code>
+ * @param trnIsolation <code>String</code>
*/
public void settransactionIsolation(String trnIsolation) {
spec.setDetail(DataSourceSpec.TRANSACTIONISOLATION, trnIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return transaction isolation level
+ * @return transaction isolation level
*/
public String gettransactionIsolation() {
return spec.getDetail(DataSourceSpec.TRANSACTIONISOLATION);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setGuaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getGuaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
/**
* Sets if the transaction isolation level is to be guaranteed
*
- * @param guaranteeIsolation <code>String</code>
+ * @param guaranteeIsolation <code>String</code>
*/
public void setguaranteeIsolationLevel(String guaranteeIsolation) {
spec.setDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL, guaranteeIsolation);
}
-
+
/**
* Returns the transaction isolation level
*
- * @return isolation level guarantee
+ * @return isolation level guarantee
*/
public String getguaranteeIsolationLevel() {
return spec.getDetail(DataSourceSpec.GUARANTEEISOLATIONLEVEL);
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
index 555be77..ea54076 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ResourceAdapter.java
@@ -26,8 +26,8 @@
/**
* <code>ResourceAdapter</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/05
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/05
+ * @author Evani Sai Surya Kiran
*/
public class ResourceAdapter implements jakarta.resource.spi.ResourceAdapter {
@@ -37,52 +37,52 @@
* Empty method implementation for endpointActivation
* which just throws <code>NotSupportedException</code>
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
- * @throws <code>NotSupportedException</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
+ * @throws <code>NotSupportedException</code>
*/
public void endpointActivation(MessageEndpointFactory mef, ActivationSpec as) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty method implementation for endpointDeactivation
*
- * @param mef <code>MessageEndpointFactory</code>
- * @param as <code>ActivationSpec</code>
+ * @param mef <code>MessageEndpointFactory</code>
+ * @param as <code>ActivationSpec</code>
*/
public void endpointDeactivation(MessageEndpointFactory mef, ActivationSpec as) {
-
+
}
-
+
/**
* Empty method implementation for getXAResources
* which just throws <code>NotSupportedException</code>
*
- * @param specs <code>ActivationSpec</code> array
- * @throws <code>NotSupportedException</code>
+ * @param specs <code>ActivationSpec</code> array
+ * @throws <code>NotSupportedException</code>
*/
public XAResource[] getXAResources(ActivationSpec[] specs) throws NotSupportedException {
throw new NotSupportedException("This method is not supported for this JDBC connector");
}
-
+
/**
* Empty implementation of start method
*
- * @param ctx <code>BootstrapContext</code>
+ * @param ctx <code>BootstrapContext</code>
*/
public void start(BootstrapContext ctx) throws ResourceAdapterInternalException {
System.out.println("Resource Adapter is starting with configuration :" + raProp);
if (raProp == null || !raProp.equals("VALID")) {
- throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
- }
+ throw new ResourceAdapterInternalException("Resource adapter cannot start. It is configured as : " + raProp);
}
-
+ }
+
/**
* Empty implementation of stop method
*/
public void stop() {
-
+
}
public void setRAProperty(String s) {
@@ -92,5 +92,5 @@
public String getRAProperty() {
return raProp;
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/build.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/build.xml
index 5e14d44..ff0f02b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="${gjc.home}" default="build">
<property name="pkg.dir" value="com/sun/gjc/spi"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -29,55 +29,55 @@
</target>
<target name="package14">
-
- <mkdir dir="${gjc.home}/dist/spi/1.5"/>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
+
+ <mkdir dir="${gjc.home}/dist/spi/1.5"/>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/jdbc.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*, com/sun/gjc/util/**/*, com/sun/gjc/common/**/*" excludes="com/sun/gjc/cci/**/*,com/sun/gjc/spi/1.4/**/*"/>
-
+
<jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-cp.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__cp.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-xa.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__xa.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-dm.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
- <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__dm.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" basedir="${gjc.home}/dist/spi/1.5" includes="jdbc.jar"/>
+ <copy file="${gjc.home}/src/com/sun/gjc/spi/1.4/ra-ds.xml" tofile="${gjc.home}/dist/spi/1.5/ra.xml" overwrite="yes">
</copy>
- <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
- <metainf dir="${gjc.home}/dist/spi/1.5">
- <include name="ra.xml"/>
- </metainf>
- </jar>
-
- <delete dir="${gjc.home}/dist/com"/>
- <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
- <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
-
+ <jar jarfile="${gjc.home}/dist/spi/1.5/__ds.rar" update="yes">
+ <metainf dir="${gjc.home}/dist/spi/1.5">
+ <include name="ra.xml"/>
+ </metainf>
+ </jar>
+
+ <delete dir="${gjc.home}/dist/com"/>
+ <delete file="${gjc.home}/dist/spi/1.5/jdbc.jar"/>
+ <delete file="${gjc.home}/dist/spi/1.5/ra.xml"/>
+
</target>
<target name="build14" depends="compile14, package14"/>
<target name="build13"/>
- <target name="build" depends="build14, build13"/>
+ <target name="build" depends="build14, build13"/>
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
index df45777..a897f06 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/1.4/ra-ds.xml
@@ -22,69 +22,69 @@
version="1.5">
<!-- There can be any number of "description" elements including 0 -->
- <!-- This field can be optionally used by the driver vendor to provide a
+ <!-- This field can be optionally used by the driver vendor to provide a
description for the resource adapter.
-->
<description>Resource adapter wrapping Datasource implementation of driver</description>
-
+
<!-- There can be any number of "display-name" elements including 0 -->
- <!-- The field can be optionally used by the driver vendor to provide a name that
+ <!-- The field can be optionally used by the driver vendor to provide a name that
is intended to be displayed by tools.
-->
<display-name>DataSource Resource Adapter</display-name>
-
+
<!-- There can be any number of "icon" elements including 0 -->
<!-- The following is an example.
<icon>
- This "small-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (16 x 16)
+ This "small-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (16 x 16)
icon - JPEG or GIF image. The following is an example.
<small-icon>smallicon.jpg</small-icon>
-
- This "large-icon" element can occur atmost once. This should specify the
- absolute or the relative path name of a file containing a small (32 x 32)
+
+ This "large-icon" element can occur atmost once. This should specify the
+ absolute or the relative path name of a file containing a small (32 x 32)
icon - JPEG or GIF image. The following is an example.
- <large-icon>largeicon.jpg</large-icon>
+ <large-icon>largeicon.jpg</large-icon>
</icon>
-->
<icon>
<small-icon></small-icon>
- <large-icon></large-icon>
+ <large-icon></large-icon>
</icon>
-
+
<!-- The "vendor-name" element should occur exactly once. -->
<!-- This should specify the name of the driver vendor. The following is an example.
<vendor-name>XYZ INC.</vendor-name>
-->
<vendor-name>Sun Microsystems</vendor-name>
-
+
<!-- The "eis-type" element should occur exactly once. -->
- <!-- This should specify the database, for example the product name of
+ <!-- This should specify the database, for example the product name of
the database independent of any version information. The following
is an example.
<eis-type>XYZ</eis-type>
-->
<eis-type>Database</eis-type>
-
+
<!-- The "resourceadapter-version" element should occur exactly once. -->
- <!-- This specifies a string based version of the resource adapter from
+ <!-- This specifies a string based version of the resource adapter from
the driver vendor. The default is being set as 1.0. The driver
vendor can change it as required.
-->
<resourceadapter-version>1.0</resourceadapter-version>
-
+
<!-- This "license" element can occur atmost once -->
<!-- This specifies licensing requirements for the resource adapter module.
The following is an example.
<license>
There can be any number of "description" elements including 0.
<description>
- This field can be optionally used by the driver vendor to
- provide a description for the licensing requirements of the
- resource adapter like duration of license, numberof connection
+ This field can be optionally used by the driver vendor to
+ provide a description for the licensing requirements of the
+ resource adapter like duration of license, numberof connection
restrictions.
</description>
-
+
This specifies whether a license is required to deploy and use the resource adapter.
Default is false.
<license-required>false</license-required>
@@ -93,24 +93,24 @@
<license>
<license-required>false</license-required>
</license>
-
+
<resourceadapter>
-
- <!--
- The "config-property" elements can have zero or more "description"
+
+ <!--
+ The "config-property" elements can have zero or more "description"
elements. The "description" elements are not being included
in the "config-property" elements below. The driver vendor can
add them as required.
-->
-
+
<resourceadapter-class>com.sun.jdbcra.spi.ResourceAdapter</resourceadapter-class>
-
+
<outbound-resourceadapter>
-
+
<connection-definition>
-
+
<managedconnectionfactory-class>com.sun.jdbcra.spi.DSManagedConnectionFactory</managedconnectionfactory-class>
-
+
<!-- There can be any number of these elements including 0 -->
<config-property>
<config-property-name>ServerName</config-property-name>
@@ -128,7 +128,7 @@
<config-property-value>testdb</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>User</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbuser</config-property-value>
@@ -139,12 +139,12 @@
<config-property-value>dbuser</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>Password</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>dbpassword</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>URL</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>jdbc:derby://localhost:1527/testdb;create=true</config-property-value>
@@ -154,7 +154,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>-->
- <config-property>
+ <config-property>
<config-property-name>Description</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>Oracle thin driver Datasource</config-property-value>
@@ -165,17 +165,17 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>RoleName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>LoginTimeOut</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>0</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>DriverProperties</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value></config-property-value>
@@ -186,7 +186,7 @@
<config-property-type>java.lang.String</config-property-type>
<config-property-value>#</config-property-value>
</config-property>
- <config-property>
+ <config-property>
<config-property-name>ClassName</config-property-name>
<config-property-type>java.lang.String</config-property-type>
<config-property-value>org.apache.derby.jdbc.ClientDataSource40</config-property-value>
@@ -198,82 +198,82 @@
</config-property>
<!--
- <config-property>
- <config-property-name>ConnectionValidationRequired</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value>false</config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationMethod</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>ValidationTableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>TransactionIsolation</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>GuaranteeIsolationLevel</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
+ <config-property>
+ <config-property-name>ConnectionValidationRequired</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value>false</config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationMethod</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>ValidationTableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>TransactionIsolation</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>GuaranteeIsolationLevel</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
-->
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
-
+
<connectionfactory-impl-class>com.sun.jdbcra.spi.DataSource</connectionfactory-impl-class>
-
+
<connection-interface>java.sql.Connection</connection-interface>
-
+
<connection-impl-class>com.sun.jdbcra.spi.ConnectionHolder</connection-impl-class>
-
+
</connection-definition>
-
+
<transaction-support>LocalTransaction</transaction-support>
-
+
<authentication-mechanism>
<!-- There can be any number of "description" elements including 0 -->
<!-- Not including the "description" element -->
-
+
<authentication-mechanism-type>BasicPassword</authentication-mechanism-type>
-
+
<credential-interface>jakarta.resource.spi.security.PasswordCredential</credential-interface>
</authentication-mechanism>
-
+
<reauthentication-support>false</reauthentication-support>
-
+
</outbound-resourceadapter>
- <adminobject>
- <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
- <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
- <config-property>
- <config-property-name>TableName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>SchemaName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>JndiName</config-property-name>
- <config-property-type>java.lang.String</config-property-type>
- <config-property-value></config-property-value>
- </config-property>
- <config-property>
- <config-property-name>NoOfRows</config-property-name>
- <config-property-type>java.lang.Integer</config-property-type>
- <config-property-value>0</config-property-value>
- </config-property>
+ <adminobject>
+ <adminobject-interface>com.sun.jdbcra.spi.JdbcSetupAdmin</adminobject-interface>
+ <adminobject-class>com.sun.jdbcra.spi.JdbcSetupAdminImpl</adminobject-class>
+ <config-property>
+ <config-property-name>TableName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>SchemaName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>JndiName</config-property-name>
+ <config-property-type>java.lang.String</config-property-type>
+ <config-property-value></config-property-value>
+ </config-property>
+ <config-property>
+ <config-property-name>NoOfRows</config-property-name>
+ <config-property-type>java.lang.Integer</config-property-type>
+ <config-property-value>0</config-property-value>
+ </config-property>
</adminobject>
-
+
</resourceadapter>
-
+
</connector>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionManager.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
index b219cd2..124809c 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionManager.java
@@ -24,26 +24,26 @@
/**
* ConnectionManager implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
+public class ConnectionManager implements jakarta.resource.spi.ConnectionManager{
/**
* Returns a <code>Connection </code> object to the <code>ConnectionFactory</code>
*
- * @param mcf <code>ManagedConnectionFactory</code> object.
- * @param info <code>ConnectionRequestInfo</code> object.
- * @return A <code>Connection</code> Object.
- * @throws ResourceException In case of an error in getting the <code>Connection</code>.
+ * @param mcf <code>ManagedConnectionFactory</code> object.
+ * @param info <code>ConnectionRequestInfo</code> object.
+ * @return A <code>Connection</code> Object.
+ * @throws ResourceException In case of an error in getting the <code>Connection</code>.
*/
public Object allocateConnection(ManagedConnectionFactory mcf,
- ConnectionRequestInfo info)
- throws ResourceException {
- ManagedConnection mc = mcf.createManagedConnection(null, info);
- return mc.getConnection(null, info);
+ ConnectionRequestInfo info)
+ throws ResourceException {
+ ManagedConnection mc = mcf.createManagedConnection(null, info);
+ return mc.getConnection(null, info);
}
-
+
/*
* This class could effectively implement Connection pooling also.
* Could be done for FCS.
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
index 39c7876..c477fc2 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ConnectionRequestInfo.java
@@ -19,10 +19,10 @@
/**
* ConnectionRequestInfo implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
-public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
+public class ConnectionRequestInfo implements jakarta.resource.spi.ConnectionRequestInfo{
private String user;
private String password;
@@ -30,8 +30,8 @@
/**
* Constructs a new <code>ConnectionRequestInfo</code> object
*
- * @param user User Name.
- * @param password Password
+ * @param user User Name.
+ * @param password Password
*/
public ConnectionRequestInfo(String user, String password) {
this.user = user;
@@ -41,7 +41,7 @@
/**
* Retrieves the user name of the ConnectionRequestInfo.
*
- * @return User name of ConnectionRequestInfo.
+ * @return User name of ConnectionRequestInfo.
*/
public String getUser() {
return user;
@@ -50,7 +50,7 @@
/**
* Retrieves the password of the ConnectionRequestInfo.
*
- * @return Password of ConnectionRequestInfo.
+ * @return Password of ConnectionRequestInfo.
*/
public String getPassword() {
return password;
@@ -59,7 +59,7 @@
/**
* Verify whether two ConnectionRequestInfos are equal.
*
- * @return True, if they are equal and false otherwise.
+ * @return True, if they are equal and false otherwise.
*/
public boolean equals(Object obj) {
if (obj == null) return false;
@@ -75,18 +75,18 @@
/**
* Retrieves the hashcode of the object.
*
- * @return hashCode.
+ * @return hashCode.
*/
public int hashCode() {
String result = "" + user + password;
return result.hashCode();
}
-
+
/**
* Compares two objects.
*
- * @param o1 First object.
- * @param o2 Second object.
+ * @param o1 First object.
+ * @param o2 Second object.
*/
private boolean isEqual(Object o1, Object o2) {
if (o1 == null) {
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
index b67d23a..6537559 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DSManagedConnectionFactory.java
@@ -31,36 +31,36 @@
/**
* Data Source <code>ManagedConnectionFactory</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/30
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/30
+ * @author Evani Sai Surya Kiran
*/
public class DSManagedConnectionFactory extends ManagedConnectionFactory {
-
+
private transient javax.sql.DataSource dataSourceObj;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
}
private boolean debug = false;
-
+
/**
* Creates a new physical connection to the underlying EIS resource
* manager.
- *
- * @param subject <code>Subject</code> instance passed by the application server
- * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
- * as a result of the invocation <code>getConnection(user, password)</code>
- * on the <code>DataSource</code> object
- * @return <code>ManagedConnection</code> object created
- * @throws ResourceException if there is an error in instantiating the
- * <code>DataSource</code> object used for the
- * creation of the <code>ManagedConnection</code> object
- * @throws SecurityException if there ino <code>PasswordCredential</code> object
- * satisfying this request
- * @throws ResourceAllocationException if there is an error in allocating the
- * physical connection
+ *
+ * @param subject <code>Subject</code> instance passed by the application server
+ * @param cxRequestInfo <code>ConnectionRequestInfo</code> which may be created
+ * as a result of the invocation <code>getConnection(user, password)</code>
+ * on the <code>DataSource</code> object
+ * @return <code>ManagedConnection</code> object created
+ * @throws ResourceException if there is an error in instantiating the
+ * <code>DataSource</code> object used for the
+ * creation of the <code>ManagedConnection</code> object
+ * @throws SecurityException if there ino <code>PasswordCredential</code> object
+ * satisfying this request
+ * @throws ResourceAllocationException if there is an error in allocating the
+ * physical connection
*/
public jakarta.resource.spi.ManagedConnection createManagedConnection(javax.security.auth.Subject subject,
ConnectionRequestInfo cxRequestInfo) throws ResourceException {
@@ -68,58 +68,58 @@
logWriter.println("In createManagedConnection");
}
PasswordCredential pc = SecurityUtils.getPasswordCredential(this, subject, cxRequestInfo);
-
+
if(dataSourceObj == null) {
if(dsObjBuilder == null) {
dsObjBuilder = new DataSourceObjectBuilder(spec);
}
-
+
try {
dataSourceObj = (javax.sql.DataSource) dsObjBuilder.constructDataSourceObject();
} catch(ClassCastException cce) {
- _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
+ _logger.log(Level.SEVERE, "jdbc.exc_cce", cce);
throw new jakarta.resource.ResourceException(cce.getMessage());
}
}
-
+
java.sql.Connection dsConn = null;
-
+
try {
- /* For the case where the user/passwd of the connection pool is
- * equal to the PasswordCredential for the connection request
- * get a connection from this pool directly.
- * for all other conditions go create a new connection
- */
- if ( isEqual( pc, getUser(), getPassword() ) ) {
- dsConn = dataSourceObj.getConnection();
- } else {
- dsConn = dataSourceObj.getConnection(pc.getUserName(),
- new String(pc.getPassword()));
- }
+ /* For the case where the user/passwd of the connection pool is
+ * equal to the PasswordCredential for the connection request
+ * get a connection from this pool directly.
+ * for all other conditions go create a new connection
+ */
+ if ( isEqual( pc, getUser(), getPassword() ) ) {
+ dsConn = dataSourceObj.getConnection();
+ } else {
+ dsConn = dataSourceObj.getConnection(pc.getUserName(),
+ new String(pc.getPassword()));
+ }
} catch(java.sql.SQLException sqle) {
sqle.printStackTrace();
- _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
- throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
+ _logger.log(Level.WARNING, "jdbc.exc_create_conn", sqle);
+ throw new jakarta.resource.spi.ResourceAllocationException("The connection could not be allocated: " +
sqle.getMessage());
} catch(Exception e){
- e.printStackTrace();
+ e.printStackTrace();
}
-
+
com.sun.jdbcra.spi.ManagedConnection mc = new com.sun.jdbcra.spi.ManagedConnection(null, dsConn, pc, this);
//GJCINT
/*setIsolation(mc);
isValid(mc); */
return mc;
}
-
+
/**
- * Check if this <code>ManagedConnectionFactory</code> is equal to
+ * Check if this <code>ManagedConnectionFactory</code> is equal to
* another <code>ManagedConnectionFactory</code>.
- *
- * @param other <code>ManagedConnectionFactory</code> object for checking equality with
- * @return true if the property sets of both the
- * <code>ManagedConnectionFactory</code> objects are the same
- * false otherwise
+ *
+ * @param other <code>ManagedConnectionFactory</code> object for checking equality with
+ * @return true if the property sets of both the
+ * <code>ManagedConnectionFactory</code> objects are the same
+ * false otherwise
*/
public boolean equals(Object other) {
if(logWriter != null) {
@@ -130,409 +130,409 @@
* if and only if their properties are the same.
*/
if(other instanceof com.sun.jdbcra.spi.DSManagedConnectionFactory) {
- com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
+ com.sun.jdbcra.spi.DSManagedConnectionFactory otherMCF =
(com.sun.jdbcra.spi.DSManagedConnectionFactory) other;
return this.spec.equals(otherMCF.spec);
}
return false;
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setserverName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getserverName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the server name.
*
- * @param serverName <code>String</code>
- * @see <code>getServerName</code>
+ * @param serverName <code>String</code>
+ * @see <code>getServerName</code>
*/
public void setServerName(String serverName) {
spec.setDetail(DataSourceSpec.SERVERNAME, serverName);
}
-
+
/**
* Gets the server name.
*
- * @return serverName
- * @see <code>setServerName</code>
+ * @return serverName
+ * @see <code>setServerName</code>
*/
public String getServerName() {
return spec.getDetail(DataSourceSpec.SERVERNAME);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setportNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getportNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the port number.
*
- * @param portNumber <code>String</code>
- * @see <code>getPortNumber</code>
+ * @param portNumber <code>String</code>
+ * @see <code>getPortNumber</code>
*/
public void setPortNumber(String portNumber) {
spec.setDetail(DataSourceSpec.PORTNUMBER, portNumber);
}
-
+
/**
* Gets the port number.
*
- * @return portNumber
- * @see <code>setPortNumber</code>
+ * @return portNumber
+ * @see <code>setPortNumber</code>
*/
public String getPortNumber() {
return spec.getDetail(DataSourceSpec.PORTNUMBER);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setdatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getdatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the database name.
*
- * @param databaseName <code>String</code>
- * @see <code>getDatabaseName</code>
+ * @param databaseName <code>String</code>
+ * @see <code>getDatabaseName</code>
*/
public void setDatabaseName(String databaseName) {
spec.setDetail(DataSourceSpec.DATABASENAME, databaseName);
}
-
+
/**
* Gets the database name.
*
- * @return databaseName
- * @see <code>setDatabaseName</code>
+ * @return databaseName
+ * @see <code>setDatabaseName</code>
*/
public String getDatabaseName() {
return spec.getDetail(DataSourceSpec.DATABASENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setdataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getdataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the data source name.
*
- * @param dsn <code>String</code>
- * @see <code>getDataSourceName</code>
+ * @param dsn <code>String</code>
+ * @see <code>getDataSourceName</code>
*/
public void setDataSourceName(String dsn) {
spec.setDetail(DataSourceSpec.DATASOURCENAME, dsn);
}
-
+
/**
* Gets the data source name.
*
- * @return dsn
- * @see <code>setDataSourceName</code>
+ * @return dsn
+ * @see <code>setDataSourceName</code>
*/
public String getDataSourceName() {
return spec.getDetail(DataSourceSpec.DATASOURCENAME);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setdescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getdescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the description.
*
- * @param desc <code>String</code>
- * @see <code>getDescription</code>
+ * @param desc <code>String</code>
+ * @see <code>getDescription</code>
*/
public void setDescription(String desc) {
spec.setDetail(DataSourceSpec.DESCRIPTION, desc);
}
-
+
/**
* Gets the description.
*
- * @return desc
- * @see <code>setDescription</code>
+ * @return desc
+ * @see <code>setDescription</code>
*/
public String getDescription() {
return spec.getDetail(DataSourceSpec.DESCRIPTION);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setnetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getnetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the network protocol.
*
- * @param nwProtocol <code>String</code>
- * @see <code>getNetworkProtocol</code>
+ * @param nwProtocol <code>String</code>
+ * @see <code>getNetworkProtocol</code>
*/
public void setNetworkProtocol(String nwProtocol) {
spec.setDetail(DataSourceSpec.NETWORKPROTOCOL, nwProtocol);
}
-
+
/**
* Gets the network protocol.
*
- * @return nwProtocol
- * @see <code>setNetworkProtocol</code>
+ * @return nwProtocol
+ * @see <code>setNetworkProtocol</code>
*/
public String getNetworkProtocol() {
return spec.getDetail(DataSourceSpec.NETWORKPROTOCOL);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setroleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getroleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the role name.
*
- * @param roleName <code>String</code>
- * @see <code>getRoleName</code>
+ * @param roleName <code>String</code>
+ * @see <code>getRoleName</code>
*/
public void setRoleName(String roleName) {
spec.setDetail(DataSourceSpec.ROLENAME, roleName);
}
-
+
/**
* Gets the role name.
*
- * @return roleName
- * @see <code>setRoleName</code>
+ * @return roleName
+ * @see <code>setRoleName</code>
*/
public String getRoleName() {
return spec.getDetail(DataSourceSpec.ROLENAME);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setloginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getloginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the login timeout.
*
- * @param loginTimeOut <code>String</code>
- * @see <code>getLoginTimeOut</code>
+ * @param loginTimeOut <code>String</code>
+ * @see <code>getLoginTimeOut</code>
*/
public void setLoginTimeOut(String loginTimeOut) {
spec.setDetail(DataSourceSpec.LOGINTIMEOUT, loginTimeOut);
}
-
+
/**
* Gets the login timeout.
*
- * @return loginTimeout
- * @see <code>setLoginTimeOut</code>
+ * @return loginTimeout
+ * @see <code>setLoginTimeOut</code>
*/
public String getLoginTimeOut() {
return spec.getDetail(DataSourceSpec.LOGINTIMEOUT);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setdelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getdelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the delimiter.
*
- * @param delim <code>String</code>
- * @see <code>getDelimiter</code>
+ * @param delim <code>String</code>
+ * @see <code>getDelimiter</code>
*/
public void setDelimiter(String delim) {
spec.setDetail(DataSourceSpec.DELIMITER, delim);
}
-
+
/**
* Gets the delimiter.
*
- * @return delim
- * @see <code>setDelimiter</code>
+ * @return delim
+ * @see <code>setDelimiter</code>
*/
public String getDelimiter() {
return spec.getDetail(DataSourceSpec.DELIMITER);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setdriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getdriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
}
-
+
/**
* Sets the driver specific properties.
*
- * @param driverProps <code>String</code>
- * @see <code>getDriverProperties</code>
+ * @param driverProps <code>String</code>
+ * @see <code>getDriverProperties</code>
*/
public void setDriverProperties(String driverProps) {
spec.setDetail(DataSourceSpec.DRIVERPROPERTIES, driverProps);
}
-
+
/**
* Gets the driver specific properties.
*
- * @return driverProps
- * @see <code>setDriverProperties</code>
+ * @return driverProps
+ * @see <code>setDriverProperties</code>
*/
public String getDriverProperties() {
return spec.getDetail(DataSourceSpec.DRIVERPROPERTIES);
@@ -542,35 +542,35 @@
* Check if the PasswordCredential passed for this get connection
* request is equal to the user/passwd of this connection pool.
*/
- private boolean isEqual( PasswordCredential pc, String user,
+ private boolean isEqual( PasswordCredential pc, String user,
String password) {
-
- //if equal get direct connection else
- //get connection with user and password.
-
- if (user == null && pc == null) {
- return true;
- }
-
- if ( user == null && pc != null ) {
- return false;
- }
- if( pc == null ) {
- return true;
- }
-
- if ( user.equals( pc.getUserName() ) ) {
- if ( password == null && pc.getPassword() == null ) {
- return true;
- }
- }
-
- if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
- return true;
- }
-
-
- return false;
+ //if equal get direct connection else
+ //get connection with user and password.
+
+ if (user == null && pc == null) {
+ return true;
+ }
+
+ if ( user == null && pc != null ) {
+ return false;
+ }
+
+ if( pc == null ) {
+ return true;
+ }
+
+ if ( user.equals( pc.getUserName() ) ) {
+ if ( password == null && pc.getPassword() == null ) {
+ return true;
+ }
+ }
+
+ if ( user.equals(pc.getUserName()) && password.equals(pc.getPassword()) ) {
+ return true;
+ }
+
+
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DataSource.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DataSource.java
index 30da1fe..295c3fb 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DataSource.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/DataSource.java
@@ -28,22 +28,22 @@
import java.util.logging.Logger;
import java.util.logging.Level;
/**
- * Holds the <code>java.sql.Connection</code> object, which is to be
+ * Holds the <code>java.sql.Connection</code> object, which is to be
* passed to the application program.
*
- * @version 1.0, 02/07/31
- * @author Binod P.G
+ * @version 1.0, 02/07/31
+ * @author Binod P.G
*/
public class DataSource implements javax.sql.DataSource, java.io.Serializable,
- com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
-
+ com.sun.appserv.jdbcra.DataSource, jakarta.resource.Referenceable{
+
private ManagedConnectionFactory mcf;
- private ConnectionManager cm;
+ private ConnectionManager cm;
private int loginTimeout;
private PrintWriter logWriter;
- private String description;
+ private String description;
private Reference reference;
-
+
private static Logger _logger;
static {
_logger = Logger.getAnonymousLogger();
@@ -51,57 +51,57 @@
private boolean debug = false;
/**
- * Constructs <code>DataSource</code> object. This is created by the
+ * Constructs <code>DataSource</code> object. This is created by the
* <code>ManagedConnectionFactory</code> object.
*
- * @param mcf <code>ManagedConnectionFactory</code> object
- * creating this object.
- * @param cm <code>ConnectionManager</code> object either associated
- * with Application server or Resource Adapter.
+ * @param mcf <code>ManagedConnectionFactory</code> object
+ * creating this object.
+ * @param cm <code>ConnectionManager</code> object either associated
+ * with Application server or Resource Adapter.
*/
public DataSource (ManagedConnectionFactory mcf, ConnectionManager cm) {
- this.mcf = mcf;
- if (cm == null) {
- this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
- } else {
- this.cm = cm;
- }
- }
-
+ this.mcf = mcf;
+ if (cm == null) {
+ this.cm = (ConnectionManager) new com.sun.jdbcra.spi.ConnectionManager();
+ } else {
+ this.cm = cm;
+ }
+ }
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection() throws SQLException {
- try {
- return (Connection) cm.allocateConnection(mcf,null);
- } catch (ResourceException re) {
+ try {
+ return (Connection) cm.allocateConnection(mcf,null);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re);
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re);
+ }
}
-
+
/**
* Retrieves the <code> Connection </code> object.
- *
- * @param user User name for the Connection.
- * @param pwd Password for the Connection.
- * @return <code> Connection </code> object.
- * @throws SQLException In case of an error.
+ *
+ * @param user User name for the Connection.
+ * @param pwd Password for the Connection.
+ * @return <code> Connection </code> object.
+ * @throws SQLException In case of an error.
*/
public Connection getConnection(String user, String pwd) throws SQLException {
- try {
- ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
- return (Connection) cm.allocateConnection(mcf,info);
- } catch (ResourceException re) {
+ try {
+ ConnectionRequestInfo info = new ConnectionRequestInfo (user, pwd);
+ return (Connection) cm.allocateConnection(mcf,info);
+ } catch (ResourceException re) {
// This is temporary. This needs to be changed to SEVERE after TP
- _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
- throw new SQLException (re);
- }
- }
+ _logger.log(Level.WARNING, "jdbc.exc_get_conn", re.getMessage());
+ throw new SQLException (re);
+ }
+ }
/**
* Retrieves the actual SQLConnection from the Connection wrapper
@@ -114,91 +114,91 @@
*/
public Connection getConnection(Connection con) throws SQLException {
- Connection driverCon = con;
+ Connection driverCon = con;
if (con instanceof com.sun.jdbcra.spi.ConnectionHolder) {
- driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
- }
+ driverCon = ((com.sun.jdbcra.spi.ConnectionHolder) con).getConnection();
+ }
return driverCon;
}
-
+
/**
* Get the login timeout
*
* @return login timeout.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public int getLoginTimeout() throws SQLException{
- return loginTimeout;
+ return loginTimeout;
}
-
+
/**
* Set the login timeout
*
- * @param loginTimeout Login timeout.
- * @throws SQLException If a database error occurs.
+ * @param loginTimeout Login timeout.
+ * @throws SQLException If a database error occurs.
*/
public void setLoginTimeout(int loginTimeout) throws SQLException{
- this.loginTimeout = loginTimeout;
+ this.loginTimeout = loginTimeout;
}
-
- /**
+
+ /**
* Get the logwriter object.
*
* @return <code> PrintWriter </code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public PrintWriter getLogWriter() throws SQLException{
- return logWriter;
+ return logWriter;
}
-
+
/**
* Set the logwriter on this object.
*
* @param <code>PrintWriter</code> object.
- * @throws SQLException If a database error occurs.
+ * @throws SQLException If a database error occurs.
*/
public void setLogWriter(PrintWriter logWriter) throws SQLException{
- this.logWriter = logWriter;
- }
-
+ this.logWriter = logWriter;
+ }
+
public Logger getParentLogger() throws SQLFeatureNotSupportedException{
throw new SQLFeatureNotSupportedException("Do not support Java 7 feature.");
}
/**
* Retrieves the description.
*
- * @return Description about the DataSource.
+ * @return Description about the DataSource.
*/
public String getDescription() {
- return description;
+ return description;
}
-
+
/**
* Set the description.
*
* @param description Description about the DataSource.
*/
public void setDescription(String description) {
- this.description = description;
- }
-
+ this.description = description;
+ }
+
/**
* Get the reference.
*
* @return <code>Reference</code>object.
*/
public Reference getReference() {
- return reference;
+ return reference;
}
-
+
/**
* Get the reference.
*
- * @param reference <code>Reference</code> object.
+ * @param reference <code>Reference</code> object.
*/
public void setReference(Reference reference) {
- this.reference = reference;
+ this.reference = reference;
}
public <T> T unwrap(Class<T> iface) throws SQLException {
@@ -206,6 +206,6 @@
}
public boolean isWrapperFor(Class<?> iface) throws SQLException {
- return false;
+ return false;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
index 574ed66..bec0d6b 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdmin.java
@@ -18,13 +18,13 @@
public interface JdbcSetupAdmin {
- public void setTableName(String db);
+ public void setTableName(String db);
public String getTableName();
- public void setJndiName(String name);
+ public void setJndiName(String name);
- public String getJndiName();
+ public String getJndiName();
public void setSchemaName(String name);
@@ -34,6 +34,6 @@
public Integer getNoOfRows();
- public boolean checkSetup();
+ public boolean checkSetup();
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
index 3bd7cad..fec7443 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/JdbcSetupAdminImpl.java
@@ -65,11 +65,11 @@
private void printHierarchy(ClassLoader cl, int cnt){
while(cl != null) {
- for(int i =0; i < cnt; i++)
- System.out.print(" " );
- System.out.println("PARENT :" + cl);
- cl = cl.getParent();
- cnt += 3;
+ for(int i =0; i < cnt; i++)
+ System.out.print(" " );
+ System.out.println("PARENT :" + cl);
+ cl = cl.getParent();
+ cnt += 3;
}
}
@@ -78,10 +78,10 @@
for(int i =0; i < cnt; i++)
System.out.print(" " );
System.out.println("PARENT of ClassLoader 1 :" + cl1);
- System.out.println("PARENT of ClassLoader 2 :" + cl2);
- System.out.println("EQUALS : " + (cl1 == cl2));
+ System.out.println("PARENT of ClassLoader 2 :" + cl2);
+ System.out.println("EQUALS : " + (cl1 == cl2));
cl1 = cl1.getParent();
- cl2 = cl2.getParent();
+ cl2 = cl2.getParent();
cnt += 3;
}
}
@@ -90,93 +90,93 @@
public boolean checkSetup(){
if (jndiName== null || jndiName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
if (tableName== null || tableName.trim().equals("")) {
- return false;
- }
+ return false;
+ }
Connection con = null;
- Statement s = null;
- ResultSet rs = null;
- boolean b = false;
+ Statement s = null;
+ ResultSet rs = null;
+ boolean b = false;
try {
- InitialContext ic = new InitialContext();
- //debug
- Class clz = DataSource.class;
+ InitialContext ic = new InitialContext();
+ //debug
+ Class clz = DataSource.class;
/*
- if(clz.getClassLoader() != null) {
- System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
- printHierarchy(clz.getClassLoader().getParent(), 8);
- }
- Class cls = ic.lookup(jndiName).getClass();
- System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
- printHierarchy(cls.getClassLoader().getParent(), 8);
+ if(clz.getClassLoader() != null) {
+ System.out.println("DataSource's clasxs : " + clz.getName() + " classloader " + clz.getClassLoader());
+ printHierarchy(clz.getClassLoader().getParent(), 8);
+ }
+ Class cls = ic.lookup(jndiName).getClass();
+ System.out.println("Looked up class's : " + cls.getPackage() + ":" + cls.getName() + " classloader " + cls.getClassLoader());
+ printHierarchy(cls.getClassLoader().getParent(), 8);
- System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
- System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
- if(clz.getClassLoader() != null) {
- compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
- }
+ System.out.println("Classloaders equal ? " + (clz.getClassLoader() == cls.getClassLoader()));
+ System.out.println("&*&*&*&* Comparing Hierachy DataSource vs lookedup");
+ if(clz.getClassLoader() != null) {
+ compareHierarchy(clz.getClassLoader(), cls.getClassLoader(), 8);
+ }
- System.out.println("Before lookup");
+ System.out.println("Before lookup");
*/
- Object o = ic.lookup(jndiName);
-// System.out.println("after lookup lookup");
+ Object o = ic.lookup(jndiName);
+// System.out.println("after lookup lookup");
- DataSource ds = (DataSource)o ;
+ DataSource ds = (DataSource)o ;
/*
- System.out.println("after cast");
- System.out.println("---------- Trying our Stuff !!!");
- try {
- Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
- ClassLoader cl1 = o1.getClassLoader();
- ClassLoader cl2 = DataSource.class.getClassLoader();
- System.out.println("Cl1 == Cl2" + (cl1 == cl2));
- System.out.println("Classes equal" + (DataSource.class == o1));
- } catch (Exception ex) {
- ex.printStackTrace();
- }
+ System.out.println("after cast");
+ System.out.println("---------- Trying our Stuff !!!");
+ try {
+ Class o1 = (Class.forName("com.sun.jdbcra.spi.DataSource"));
+ ClassLoader cl1 = o1.getClassLoader();
+ ClassLoader cl2 = DataSource.class.getClassLoader();
+ System.out.println("Cl1 == Cl2" + (cl1 == cl2));
+ System.out.println("Classes equal" + (DataSource.class == o1));
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ }
*/
con = ds.getConnection();
- String fullTableName = tableName;
- if (schemaName != null && (!(schemaName.trim().equals("")))) {
- fullTableName = schemaName.trim() + "." + fullTableName;
- }
- String qry = "select * from " + fullTableName;
+ String fullTableName = tableName;
+ if (schemaName != null && (!(schemaName.trim().equals("")))) {
+ fullTableName = schemaName.trim() + "." + fullTableName;
+ }
+ String qry = "select * from " + fullTableName;
- System.out.println("Executing query :" + qry);
+ System.out.println("Executing query :" + qry);
- s = con.createStatement();
- rs = s.executeQuery(qry);
+ s = con.createStatement();
+ rs = s.executeQuery(qry);
int i = 0;
- if (rs.next()) {
- i++;
- }
+ if (rs.next()) {
+ i++;
+ }
System.out.println("No of rows found:" + i);
System.out.println("No of rows expected:" + noOfRows);
- if (i == noOfRows.intValue()) {
- b = true;
- } else {
- b = false;
- }
- } catch(Exception e) {
- e.printStackTrace();
- b = false;
- } finally {
- try {
- if (rs != null) rs.close();
- if (s != null) s.close();
- if (con != null) con.close();
+ if (i == noOfRows.intValue()) {
+ b = true;
+ } else {
+ b = false;
+ }
+ } catch(Exception e) {
+ e.printStackTrace();
+ b = false;
+ } finally {
+ try {
+ if (rs != null) rs.close();
+ if (s != null) s.close();
+ if (con != null) con.close();
} catch (Exception e) {
- }
- }
- System.out.println("Returning setup :" +b);
- return b;
+ }
+ }
+ System.out.println("Returning setup :" +b);
+ return b;
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/LocalTransaction.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
index 8ebe057..c54a216 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/LocalTransaction.java
@@ -23,45 +23,45 @@
/**
* <code>LocalTransaction</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class LocalTransaction implements jakarta.resource.spi.LocalTransaction {
-
+
private ManagedConnection mc;
-
+
/**
* Constructor for <code>LocalTransaction</code>.
- * @param mc <code>ManagedConnection</code> that returns
- * this <code>LocalTransaction</code> object as
- * a result of <code>getLocalTransaction</code>
+ * @param mc <code>ManagedConnection</code> that returns
+ * this <code>LocalTransaction</code> object as
+ * a result of <code>getLocalTransaction</code>
*/
public LocalTransaction(ManagedConnection mc) {
this.mc = mc;
}
-
+
/**
* Begin a local transaction.
*
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection
*/
public void begin() throws ResourceException {
//GJCINT
- mc.transactionStarted();
+ mc.transactionStarted();
try {
mc.getActualConnection().setAutoCommit(false);
} catch(java.sql.SQLException sqle) {
throw new LocalTransactionException(sqle.getMessage());
}
}
-
+
/**
* Commit a local transaction.
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or committing the transaction
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or committing the transaction
*/
public void commit() throws ResourceException {
Exception e = null;
@@ -72,15 +72,15 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
/**
* Rollback a local transaction.
- *
- * @throws LocalTransactionException if there is an error in changing
- * the autocommit mode of the physical
- * connection or rolling back the transaction
+ *
+ * @throws LocalTransactionException if there is an error in changing
+ * the autocommit mode of the physical
+ * connection or rolling back the transaction
*/
public void rollback() throws ResourceException {
try {
@@ -90,7 +90,7 @@
throw new LocalTransactionException(sqle.getMessage());
}
//GJCINT
- mc.transactionCompleted();
+ mc.transactionCompleted();
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnection.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
index 30f460a..2dad59a 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnection.java
@@ -41,8 +41,8 @@
/**
* <code>ManagedConnection</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnection implements jakarta.resource.spi.ManagedConnection {
@@ -52,7 +52,7 @@
private boolean isDestroyed = false;
private boolean isUsable = true;
-
+
private int connectionType = ISNOTAPOOLEDCONNECTION;
private PooledConnection pc = null;
private java.sql.Connection actualConnection = null;
@@ -62,7 +62,7 @@
private jakarta.resource.spi.ManagedConnectionFactory mcf = null;
private XAResource xar = null;
public ConnectionHolder activeConnectionHandle;
-
+
//GJCINT
private int isolationLevelWhenCleaned;
private boolean isClean = false;
@@ -77,71 +77,71 @@
static {
_logger = Logger.getAnonymousLogger();
}
-
+
/**
* Constructor for <code>ManagedConnection</code>. The pooledConn parameter is expected
- * to be null and sqlConn parameter is the actual connection in case where
- * the actual connection is got from a non pooled datasource object. The
+ * to be null and sqlConn parameter is the actual connection in case where
+ * the actual connection is got from a non pooled datasource object. The
* pooledConn parameter is expected to be non null and sqlConn parameter
* is expected to be null in the case where the datasource object is a
* connection pool datasource or an xa datasource.
*
- * @param pooledConn <code>PooledConnection</code> object in case the
- * physical connection is to be obtained from a pooled
- * <code>DataSource</code>; null otherwise
- * @param sqlConn <code>java.sql.Connection</code> object in case the physical
- * connection is to be obtained from a non pooled <code>DataSource</code>;
- * null otherwise
- * @param passwdCred object conatining the
- * user and password for allocating the connection
- * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
- * that created this <code>ManagedConnection</code> object
- * is not the same as returned by <code>PasswordCredential</code>
- * object passed
+ * @param pooledConn <code>PooledConnection</code> object in case the
+ * physical connection is to be obtained from a pooled
+ * <code>DataSource</code>; null otherwise
+ * @param sqlConn <code>java.sql.Connection</code> object in case the physical
+ * connection is to be obtained from a non pooled <code>DataSource</code>;
+ * null otherwise
+ * @param passwdCred object conatining the
+ * user and password for allocating the connection
+ * @throws ResourceException if the <code>ManagedConnectionFactory</code> object
+ * that created this <code>ManagedConnection</code> object
+ * is not the same as returned by <code>PasswordCredential</code>
+ * object passed
*/
- public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
+ public ManagedConnection(PooledConnection pooledConn, java.sql.Connection sqlConn,
PasswordCredential passwdCred, jakarta.resource.spi.ManagedConnectionFactory mcf) throws ResourceException {
if(pooledConn == null && sqlConn == null) {
throw new ResourceException("Connection object cannot be null");
}
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
- actualConnection = sqlConn;
- }
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ actualConnection = sqlConn;
+ }
pc = pooledConn;
connectionHandles = new Hashtable();
passwdCredential = passwdCred;
this.mcf = mcf;
- if(passwdCredential != null &&
+ if(passwdCredential != null &&
this.mcf.equals(passwdCredential.getManagedConnectionFactory()) == false) {
- throw new ResourceException("The ManagedConnectionFactory that has created this " +
+ throw new ResourceException("The ManagedConnectionFactory that has created this " +
"ManagedConnection is not the same as the ManagedConnectionFactory returned by" +
" the PasswordCredential for this ManagedConnection");
}
logWriter = mcf.getLogWriter();
activeConnectionHandle = null;
- ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
+ ce = new ConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED);
}
/**
* Adds a connection event listener to the ManagedConnection instance.
*
- * @param listener <code>ConnectionEventListener</code>
+ * @param listener <code>ConnectionEventListener</code>
* @see <code>removeConnectionEventListener</code>
*/
public void addConnectionEventListener(ConnectionEventListener listener) {
- this.listener = listener;
+ this.listener = listener;
}
-
+
/**
- * Used by the container to change the association of an application-level
+ * Used by the container to change the association of an application-level
* connection handle with a <code>ManagedConnection</code> instance.
*
- * @param connection <code>ConnectionHolder</code> to be associated with
- * this <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is no more
- * valid or the connection handle passed is null
+ * @param connection <code>ConnectionHolder</code> to be associated with
+ * this <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is no more
+ * valid or the connection handle passed is null
*/
public void associateConnection(Object connection) throws ResourceException {
if(logWriter != null) {
@@ -152,11 +152,11 @@
throw new ResourceException("Connection handle cannot be null");
}
ConnectionHolder ch = (ConnectionHolder) connection;
-
+
com.sun.jdbcra.spi.ManagedConnection mc = (com.sun.jdbcra.spi.ManagedConnection)ch.getManagedConnection();
- mc.activeConnectionHandle = null;
- isClean = false;
-
+ mc.activeConnectionHandle = null;
+ isClean = false;
+
ch.associateConnection(actualConnection, this);
/**
* The expectation from the above method is that the connection holder
@@ -165,34 +165,34 @@
* to the ManagedConnection instance with this ManagedConnection instance.
* Any previous statements and result sets also need to be removed.
*/
-
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
ch.setActive(true);
- activeConnectionHandle = ch;
+ activeConnectionHandle = ch;
}
-
+
/**
- * Application server calls this method to force any cleanup on the
+ * Application server calls this method to force any cleanup on the
* <code>ManagedConnection</code> instance. This method calls the invalidate
* method on all ConnectionHandles associated with this <code>ManagedConnection</code>.
- *
- * @throws ResourceException if the physical connection is no more valid
+ *
+ * @throws ResourceException if the physical connection is no more valid
*/
public void cleanup() throws ResourceException {
if(logWriter != null) {
logWriter.println("In cleanup");
}
checkIfValid();
-
+
/**
* may need to set the autocommit to true for the non-pooled case.
*/
//GJCINT
- //if (actualConnection != null) {
- if (connectionType == ISNOTAPOOLEDCONNECTION ) {
+ //if (actualConnection != null) {
+ if (connectionType == ISNOTAPOOLEDCONNECTION ) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
@@ -201,17 +201,17 @@
}
}
isClean = true;
-
+
activeConnectionHandle = null;
}
-
+
/**
* This method removes all the connection handles from the table
* of connection handles and invalidates all of them so that any
* operation on those connection handles throws an exception.
*
- * @throws ResourceException if there is a problem in retrieving
- * the connection handles
+ * @throws ResourceException if there is a problem in retrieving
+ * the connection handles
*/
private void invalidateAllConnectionHandles() throws ResourceException {
Set handles = connectionHandles.keySet();
@@ -226,22 +226,22 @@
}
connectionHandles.clear();
}
-
+
/**
* Destroys the physical connection to the underlying resource manager.
- *
- * @throws ResourceException if there is an error in closing the physical connection
+ *
+ * @throws ResourceException if there is an error in closing the physical connection
*/
public void destroy() throws ResourceException{
if(logWriter != null) {
logWriter.println("In destroy");
}
- //GJCINT
- if(isDestroyed == true) {
- return;
- }
+ //GJCINT
+ if(isDestroyed == true) {
+ return;
+ }
- activeConnectionHandle = null;
+ activeConnectionHandle = null;
try {
if(connectionType == ISXACONNECTION || connectionType == ISPOOLEDCONNECTION) {
pc.close();
@@ -255,28 +255,28 @@
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
- throw new ResourceException("The following exception has occured during destroy: "
+ throw new ResourceException("The following exception has occured during destroy: "
+ sqle.getMessage());
}
isDestroyed = true;
passwdCredential = null;
connectionHandles = null;
}
-
+
/**
- * Creates a new connection handle for the underlying physical
+ * Creates a new connection handle for the underlying physical
* connection represented by the <code>ManagedConnection</code> instance.
*
- * @param subject <code>Subject</code> parameter needed for authentication
- * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
- * and password required for getting this connection.
- * @return Connection the connection handle <code>Object</code>
- * @throws ResourceException if there is an error in allocating the
- * physical connection from the pooled connection
- * @throws SecurityException if there is a mismatch between the
- * password credentials or reauthentication is requested
+ * @param subject <code>Subject</code> parameter needed for authentication
+ * @param cxReqInfo <code>ConnectionRequestInfo</code> carries the user
+ * and password required for getting this connection.
+ * @return Connection the connection handle <code>Object</code>
+ * @throws ResourceException if there is an error in allocating the
+ * physical connection from the pooled connection
+ * @throws SecurityException if there is a mismatch between the
+ * password credentials or reauthentication is requested
*/
- public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
+ public Object getConnection(Subject sub, jakarta.resource.spi.ConnectionRequestInfo cxReqInfo)
throws ResourceException {
if(logWriter != null) {
logWriter.println("In getConnection");
@@ -284,14 +284,14 @@
checkIfValid();
com.sun.jdbcra.spi.ConnectionRequestInfo cxRequestInfo = (com.sun.jdbcra.spi.ConnectionRequestInfo) cxReqInfo;
PasswordCredential passwdCred = SecurityUtils.getPasswordCredential(this.mcf, sub, cxRequestInfo);
-
+
if(SecurityUtils.isPasswordCredentialEqual(this.passwdCredential, passwdCred) == false) {
throw new jakarta.resource.spi.SecurityException("Re-authentication not supported");
}
-
+
//GJCINT
getActualConnection();
-
+
/**
* The following code in the if statement first checks if this ManagedConnection
* is clean or not. If it is, it resets the transaction isolation level to what
@@ -301,28 +301,28 @@
if(isClean) {
((com.sun.jdbcra.spi.ManagedConnectionFactory)mcf).resetIsolation(this, isolationLevelWhenCleaned);
}
-
-
+
+
ConnectionHolder connHolderObject = new ConnectionHolder(actualConnection, this);
- isClean=false;
-
+ isClean=false;
+
if(activeConnectionHandle != null) {
activeConnectionHandle.setActive(false);
}
-
+
connHolderObject.setActive(true);
activeConnectionHandle = connHolderObject;
-
+
return connHolderObject;
-
+
}
-
+
/**
* Returns an <code>LocalTransaction</code> instance. The <code>LocalTransaction</code> interface
- * is used by the container to manage local transactions for a RM instance.
+ * is used by the container to manage local transactions for a RM instance.
*
- * @return <code>LocalTransaction</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>LocalTransaction</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.LocalTransaction getLocalTransaction() throws ResourceException {
if(logWriter != null) {
@@ -331,13 +331,13 @@
checkIfValid();
return new com.sun.jdbcra.spi.LocalTransaction(this);
}
-
+
/**
- * Gets the log writer for this <code>ManagedConnection</code> instance.
+ * Gets the log writer for this <code>ManagedConnection</code> instance.
*
- * @return <code>PrintWriter</code> instance associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>PrintWriter</code> instance associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>setLogWriter</code>
*/
public PrintWriter getLogWriter() throws ResourceException {
@@ -345,46 +345,46 @@
logWriter.println("In getLogWriter");
}
checkIfValid();
-
+
return logWriter;
}
-
+
/**
- * Gets the metadata information for this connection's underlying EIS
- * resource manager instance.
+ * Gets the metadata information for this connection's underlying EIS
+ * resource manager instance.
*
- * @return <code>ManagedConnectionMetaData</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @return <code>ManagedConnectionMetaData</code> instance
+ * @throws ResourceException if the physical connection is not valid
*/
public jakarta.resource.spi.ManagedConnectionMetaData getMetaData() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getMetaData");
}
checkIfValid();
-
+
return new com.sun.jdbcra.spi.ManagedConnectionMetaData(this);
}
-
+
/**
- * Returns an <code>XAResource</code> instance.
+ * Returns an <code>XAResource</code> instance.
*
- * @return <code>XAResource</code> instance
- * @throws ResourceException if the physical connection is not valid or
- * there is an error in allocating the
- * <code>XAResource</code> instance
- * @throws NotSupportedException if underlying datasource is not an
- * <code>XADataSource</code>
+ * @return <code>XAResource</code> instance
+ * @throws ResourceException if the physical connection is not valid or
+ * there is an error in allocating the
+ * <code>XAResource</code> instance
+ * @throws NotSupportedException if underlying datasource is not an
+ * <code>XADataSource</code>
*/
public XAResource getXAResource() throws ResourceException {
if(logWriter != null) {
logWriter.println("In getXAResource");
}
checkIfValid();
-
+
if(connectionType == ISXACONNECTION) {
try {
if(xar == null) {
- /**
+ /**
* Using the wrapper XAResource.
*/
xar = new com.sun.jdbcra.spi.XAResourceImpl(((XAConnection)pc).getXAResource(), this);
@@ -397,16 +397,16 @@
throw new NotSupportedException("Cannot get an XAResource from a non XA connection");
}
}
-
+
/**
* Removes an already registered connection event listener from the
* <code>ManagedConnection</code> instance.
*
- * @param listener <code>ConnectionEventListener</code> to be removed
+ * @param listener <code>ConnectionEventListener</code> to be removed
* @see <code>addConnectionEventListener</code>
*/
public void removeConnectionEventListener(ConnectionEventListener listener) {
- listener = null;
+ listener = null;
}
/**
@@ -415,7 +415,7 @@
* LocalTransaction object when its begin() method is called.
*/
void transactionStarted() {
- transactionInProgress = true;
+ transactionInProgress = true;
}
/**
@@ -424,16 +424,16 @@
* LocalTransaction object when its end() method is called.
*/
void transactionCompleted() {
- transactionInProgress = false;
- if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
+ transactionInProgress = false;
+ if(connectionType == ISPOOLEDCONNECTION || connectionType == ISXACONNECTION) {
try {
isolationLevelWhenCleaned = actualConnection.getTransactionIsolation();
} catch(SQLException sqle) {
- //check what to do in this case!!
- _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
+ //check what to do in this case!!
+ _logger.log(Level.WARNING, "jdbc.notgot_tx_isolvl");
}
-
- try {
+
+ try {
actualConnection.close();
actualConnection = null;
} catch(SQLException sqle) {
@@ -441,7 +441,7 @@
}
}
-
+
isClean = true;
activeConnectionHandle = null;
@@ -453,28 +453,28 @@
* or not.
*/
public boolean isTransactionInProgress() {
- return transactionInProgress;
+ return transactionInProgress;
}
-
+
/**
* Sets the log writer for this <code>ManagedConnection</code> instance.
*
- * @param out <code>PrintWriter</code> to be associated with this
- * <code>ManagedConnection</code> instance
- * @throws ResourceException if the physical connection is not valid
+ * @param out <code>PrintWriter</code> to be associated with this
+ * <code>ManagedConnection</code> instance
+ * @throws ResourceException if the physical connection is not valid
* @see <code>getLogWriter</code>
*/
public void setLogWriter(PrintWriter out) throws ResourceException {
checkIfValid();
logWriter = out;
}
-
+
/**
- * This method determines the type of the connection being held
+ * This method determines the type of the connection being held
* in this <code>ManagedConnection</code>.
- *
- * @param pooledConn <code>PooledConnection</code>
- * @return connection type
+ *
+ * @param pooledConn <code>PooledConnection</code>
+ * @return connection type
*/
private int getConnectionType(PooledConnection pooledConn) {
if(pooledConn == null) {
@@ -485,22 +485,22 @@
return ISPOOLEDCONNECTION;
}
}
-
+
/**
- * Returns the <code>ManagedConnectionFactory</code> instance that
+ * Returns the <code>ManagedConnectionFactory</code> instance that
* created this <code>ManagedConnection</code> instance.
*
- * @return <code>ManagedConnectionFactory</code> instance that created this
- * <code>ManagedConnection</code> instance
+ * @return <code>ManagedConnectionFactory</code> instance that created this
+ * <code>ManagedConnection</code> instance
*/
ManagedConnectionFactory getManagedConnectionFactory() {
return (com.sun.jdbcra.spi.ManagedConnectionFactory)mcf;
}
-
+
/**
- * Returns the actual sql connection for this <code>ManagedConnection</code>.
+ * Returns the actual sql connection for this <code>ManagedConnection</code>.
*
- * @return the physical <code>java.sql.Connection</code>
+ * @return the physical <code>java.sql.Connection</code>
*/
//GJCINT
java.sql.Connection getActualConnection() throws ResourceException {
@@ -509,8 +509,8 @@
try {
if(actualConnection == null) {
actualConnection = pc.getConnection();
- }
-
+ }
+
} catch(SQLException sqle) {
sqle.printStackTrace();
throw new ResourceException(sqle.getMessage());
@@ -518,81 +518,81 @@
}
return actualConnection;
}
-
+
/**
* Returns the <code>PasswordCredential</code> object associated with this <code>ManagedConnection</code>.
*
- * @return <code>PasswordCredential</code> associated with this
- * <code>ManagedConnection</code> instance
+ * @return <code>PasswordCredential</code> associated with this
+ * <code>ManagedConnection</code> instance
*/
PasswordCredential getPasswordCredential() {
return passwdCredential;
}
-
+
/**
* Checks if this <code>ManagedConnection</code> is valid or not and throws an
* exception if it is not valid. A <code>ManagedConnection</code> is not valid if
* destroy has not been called and no physical connection error has
* occurred rendering the physical connection unusable.
*
- * @throws ResourceException if <code>destroy</code> has been called on this
- * <code>ManagedConnection</code> instance or if a
- * physical connection error occurred rendering it unusable
+ * @throws ResourceException if <code>destroy</code> has been called on this
+ * <code>ManagedConnection</code> instance or if a
+ * physical connection error occurred rendering it unusable
*/
//GJCINT
void checkIfValid() throws ResourceException {
if(isDestroyed == true || isUsable == false) {
- throw new ResourceException("This ManagedConnection is not valid as the physical " +
+ throw new ResourceException("This ManagedConnection is not valid as the physical " +
"connection is not usable.");
}
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when its close method is
* called. This <code>ManagedConnection</code> instance invalidates the connection handle
* and sends a CONNECTION_CLOSED event to all the registered event listeners.
*
- * @param e Exception that may have occured while closing the connection handle
- * @param connHolderObject <code>ConnectionHolder</code> that has been closed
- * @throws SQLException in case closing the sql connection got out of
- * <code>getConnection</code> on the underlying
- * <code>PooledConnection</code> throws an exception
+ * @param e Exception that may have occured while closing the connection handle
+ * @param connHolderObject <code>ConnectionHolder</code> that has been closed
+ * @throws SQLException in case closing the sql connection got out of
+ * <code>getConnection</code> on the underlying
+ * <code>PooledConnection</code> throws an exception
*/
void connectionClosed(Exception e, ConnectionHolder connHolderObject) throws SQLException {
connHolderObject.invalidate();
-
+
activeConnectionHandle = null;
-
+
ce.setConnectionHandle(connHolderObject);
listener.connectionClosed(ce);
-
+
}
-
+
/**
* This method is called by the <code>ConnectionHolder</code> when it detects a connecion
* related error.
*
- * @param e Exception that has occurred during an operation on the physical connection
- * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
- * connection error
+ * @param e Exception that has occurred during an operation on the physical connection
+ * @param connHolderObject <code>ConnectionHolder</code> that detected the physical
+ * connection error
*/
- void connectionErrorOccurred(Exception e,
+ void connectionErrorOccurred(Exception e,
com.sun.jdbcra.spi.ConnectionHolder connHolderObject) {
-
+
ConnectionEventListener cel = this.listener;
ConnectionEvent ce = null;
ce = e == null ? new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED)
: new ConnectionEvent(this, ConnectionEvent.CONNECTION_ERROR_OCCURRED, e);
if (connHolderObject != null) {
ce.setConnectionHandle(connHolderObject);
- }
+ }
cel.connectionErrorOccurred(ce);
isUsable = false;
}
-
-
-
+
+
+
/**
* This method is called by the <code>XAResource</code> object when its start method
* has been invoked.
@@ -606,7 +606,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by the <code>XAResource</code> object when its end method
* has been invoked.
@@ -620,7 +620,7 @@
connectionErrorOccurred(e, null);
}
}
-
+
/**
* This method is called by a Connection Handle to check if it is
* the active Connection Handle. If it is not the active Connection
@@ -629,24 +629,24 @@
* Connection Handle object to this object if the active Connection
* Handle is null.
*
- * @param ch <code>ConnectionHolder</code> that requests this
- * <code>ManagedConnection</code> instance whether
- * it can be active or not
- * @throws SQLException in case the physical is not valid or
- * there is already an active connection handle
+ * @param ch <code>ConnectionHolder</code> that requests this
+ * <code>ManagedConnection</code> instance whether
+ * it can be active or not
+ * @throws SQLException in case the physical is not valid or
+ * there is already an active connection handle
*/
-
+
void checkIfActive(ConnectionHolder ch) throws SQLException {
if(isDestroyed == true || isUsable == false) {
throw new SQLException("The physical connection is not usable");
}
-
+
if(activeConnectionHandle == null) {
activeConnectionHandle = ch;
ch.setActive(true);
return;
}
-
+
if(activeConnectionHandle != ch) {
throw new SQLException("The connection handle cannot be used as another connection is currently active");
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
index 20f03aa..f650d41 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/ManagedConnectionMetaData.java
@@ -25,8 +25,8 @@
/**
* <code>ManagedConnectionMetaData</code> implementation for Generic JDBC Connector.
*
- * @version 1.0, 02/08/03
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/03
+ * @author Evani Sai Surya Kiran
*/
public class ManagedConnectionMetaData implements jakarta.resource.spi.ManagedConnectionMetaData {
@@ -41,81 +41,81 @@
/**
* Constructor for <code>ManagedConnectionMetaData</code>
*
- * @param mc <code>ManagedConnection</code>
- * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
+ * @param mc <code>ManagedConnection</code>
+ * @throws <code>ResourceException</code> if getting the DatabaseMetaData object fails
*/
public ManagedConnectionMetaData(ManagedConnection mc) throws ResourceException {
try {
this.mc = mc;
dmd = mc.getActualConnection().getMetaData();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_md");
+ _logger.log(Level.SEVERE, "jdbc.exc_md");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product name of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product name of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product name of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductName() throws ResourceException {
try {
return dmd.getDatabaseProductName();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodname", sqle);
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns product version of the underlying EIS instance connected
* through the ManagedConnection.
*
- * @return Product version of the EIS instance
- * @throws <code>ResourceException</code>
+ * @return Product version of the EIS instance
+ * @throws <code>ResourceException</code>
*/
public String getEISProductVersion() throws ResourceException {
try {
return dmd.getDatabaseProductVersion();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_prodvers", sqle);
throw new ResourceException(sqle.getMessage(), sqle.getMessage());
}
}
-
+
/**
* Returns maximum limit on number of active concurrent connections
* that an EIS instance can support across client processes.
*
- * @return Maximum limit for number of active concurrent connections
- * @throws <code>ResourceException</code>
+ * @return Maximum limit for number of active concurrent connections
+ * @throws <code>ResourceException</code>
*/
public int getMaxConnections() throws ResourceException {
try {
return dmd.getMaxConnections();
} catch(SQLException sqle) {
- _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
+ _logger.log(Level.SEVERE, "jdbc.exc_eis_maxconn");
throw new ResourceException(sqle.getMessage());
}
}
-
+
/**
* Returns name of the user associated with the ManagedConnection instance. The name
* corresponds to the resource principal under whose whose security context, a connection
* to the EIS instance has been established.
*
- * @return name of the user
- * @throws <code>ResourceException</code>
+ * @return name of the user
+ * @throws <code>ResourceException</code>
*/
public String getUserName() throws ResourceException {
jakarta.resource.spi.security.PasswordCredential pc = mc.getPasswordCredential();
if(pc != null) {
return pc.getUserName();
}
-
+
return mc.getManagedConnectionFactory().getUser();
}
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
index dad1d77..482f332 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/spi/XAResourceImpl.java
@@ -24,148 +24,148 @@
/**
* <code>XAResource</code> wrapper for Generic JDBC Connector.
*
- * @version 1.0, 02/08/23
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/08/23
+ * @author Evani Sai Surya Kiran
*/
public class XAResourceImpl implements XAResource {
XAResource xar;
ManagedConnection mc;
-
+
/**
* Constructor for XAResourceImpl
*
- * @param xar <code>XAResource</code>
- * @param mc <code>ManagedConnection</code>
+ * @param xar <code>XAResource</code>
+ * @param mc <code>ManagedConnection</code>
*/
public XAResourceImpl(XAResource xar, ManagedConnection mc) {
this.xar = xar;
this.mc = mc;
}
-
+
/**
* Commit the global transaction specified by xid.
*
- * @param xid A global transaction identifier
- * @param onePhase If true, the resource manager should use a one-phase commit
- * protocol to commit the work done on behalf of xid.
+ * @param xid A global transaction identifier
+ * @param onePhase If true, the resource manager should use a one-phase commit
+ * protocol to commit the work done on behalf of xid.
*/
public void commit(Xid xid, boolean onePhase) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
- mc.transactionCompleted();
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
+ mc.transactionCompleted();
xar.commit(xid, onePhase);
}
-
+
/**
* Ends the work performed on behalf of a transaction branch.
*
- * @param xid A global transaction identifier that is the same as what
- * was used previously in the start method.
- * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
+ * @param xid A global transaction identifier that is the same as what
+ * was used previously in the start method.
+ * @param flags One of TMSUCCESS, TMFAIL, or TMSUSPEND
*/
public void end(Xid xid, int flags) throws XAException {
xar.end(xid, flags);
//GJCINT
- //mc.transactionCompleted();
+ //mc.transactionCompleted();
}
-
+
/**
* Tell the resource manager to forget about a heuristically completed transaction branch.
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void forget(Xid xid) throws XAException {
xar.forget(xid);
}
-
+
/**
- * Obtain the current transaction timeout value set for this
+ * Obtain the current transaction timeout value set for this
* <code>XAResource</code> instance.
*
- * @return the transaction timeout value in seconds
+ * @return the transaction timeout value in seconds
*/
public int getTransactionTimeout() throws XAException {
return xar.getTransactionTimeout();
}
-
+
/**
- * This method is called to determine if the resource manager instance
- * represented by the target object is the same as the resouce manager
+ * This method is called to determine if the resource manager instance
+ * represented by the target object is the same as the resouce manager
* instance represented by the parameter xares.
*
- * @param xares An <code>XAResource</code> object whose resource manager
- * instance is to be compared with the resource
- * @return true if it's the same RM instance; otherwise false.
+ * @param xares An <code>XAResource</code> object whose resource manager
+ * instance is to be compared with the resource
+ * @return true if it's the same RM instance; otherwise false.
*/
public boolean isSameRM(XAResource xares) throws XAException {
return xar.isSameRM(xares);
}
-
+
/**
- * Ask the resource manager to prepare for a transaction commit
+ * Ask the resource manager to prepare for a transaction commit
* of the transaction specified in xid.
*
- * @param xid A global transaction identifier
- * @return A value indicating the resource manager's vote on the
- * outcome of the transaction. The possible values
- * are: XA_RDONLY or XA_OK. If the resource manager wants
- * to roll back the transaction, it should do so
- * by raising an appropriate <code>XAException</code> in the prepare method.
+ * @param xid A global transaction identifier
+ * @return A value indicating the resource manager's vote on the
+ * outcome of the transaction. The possible values
+ * are: XA_RDONLY or XA_OK. If the resource manager wants
+ * to roll back the transaction, it should do so
+ * by raising an appropriate <code>XAException</code> in the prepare method.
*/
public int prepare(Xid xid) throws XAException {
return xar.prepare(xid);
}
-
+
/**
* Obtain a list of prepared transaction branches from a resource manager.
*
- * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
- * must be used when no other flags are set in flags.
- * @return The resource manager returns zero or more XIDs for the transaction
- * branches that are currently in a prepared or heuristically
- * completed state. If an error occurs during the operation, the resource
- * manager should throw the appropriate <code>XAException</code>.
+ * @param flag One of TMSTARTRSCAN, TMENDRSCAN, TMNOFLAGS. TMNOFLAGS
+ * must be used when no other flags are set in flags.
+ * @return The resource manager returns zero or more XIDs for the transaction
+ * branches that are currently in a prepared or heuristically
+ * completed state. If an error occurs during the operation, the resource
+ * manager should throw the appropriate <code>XAException</code>.
*/
public Xid[] recover(int flag) throws XAException {
return xar.recover(flag);
}
-
+
/**
* Inform the resource manager to roll back work done on behalf of a transaction branch
*
- * @param xid A global transaction identifier
+ * @param xid A global transaction identifier
*/
public void rollback(Xid xid) throws XAException {
//the mc.transactionCompleted call has come here becasue
- //the transaction *actually* completes after the flow
- //reaches here. the end() method might not really signal
- //completion of transaction in case the transaction is
- //suspended. In case of transaction suspension, the end
- //method is still called by the transaction manager
+ //the transaction *actually* completes after the flow
+ //reaches here. the end() method might not really signal
+ //completion of transaction in case the transaction is
+ //suspended. In case of transaction suspension, the end
+ //method is still called by the transaction manager
mc.transactionCompleted();
xar.rollback(xid);
}
-
+
/**
* Set the current transaction timeout value for this <code>XAResource</code> instance.
*
- * @param seconds the transaction timeout value in seconds.
- * @return true if transaction timeout value is set successfully; otherwise false.
+ * @param seconds the transaction timeout value in seconds.
+ * @return true if transaction timeout value is set successfully; otherwise false.
*/
public boolean setTransactionTimeout(int seconds) throws XAException {
return xar.setTransactionTimeout(seconds);
}
-
+
/**
* Start work on behalf of a transaction branch specified in xid.
*
- * @param xid A global transaction identifier to be associated with the resource
- * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
+ * @param xid A global transaction identifier to be associated with the resource
+ * @return flags One of TMNOFLAGS, TMJOIN, or TMRESUME
*/
public void start(Xid xid, int flags) throws XAException {
//GJCINT
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/MethodExecutor.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/MethodExecutor.java
index ce321af..9e7f253 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/MethodExecutor.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/MethodExecutor.java
@@ -26,8 +26,8 @@
/**
* Execute the methods based on the parameters.
*
- * @version 1.0, 02/07/23
- * @author Binod P.G
+ * @version 1.0, 02/07/23
+ * @author Binod P.G
*/
public class MethodExecutor implements java.io.Serializable{
@@ -39,130 +39,130 @@
/**
* Exceute a simple set Method.
*
- * @param value Value to be set.
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
+ * @param value Value to be set.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runJavaBeanMethod(String value, Method method, Object obj) throws ResourceException{
- if (value==null || value.trim().equals("")) {
- return;
- }
- try {
- Class[] parameters = method.getParameterTypes();
- if ( parameters.length == 1) {
- Object[] values = new Object[1];
- values[0] = convertType(parameters[0], value);
- method.invoke(obj, values);
- }
- } catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ if (value==null || value.trim().equals("")) {
+ return;
+ }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if ( parameters.length == 1) {
+ Object[] values = new Object[1];
+ values[0] = convertType(parameters[0], value);
+ method.invoke(obj, values);
+ }
+ } catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
- * Executes the method.
+ * Executes the method.
*
- * @param method <code>Method</code> object.
- * @param obj Object on which the method to be executed.
- * @param values Parameter values for executing the method.
+ * @param method <code>Method</code> object.
+ * @param obj Object on which the method to be executed.
+ * @param values Parameter values for executing the method.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
public void runMethod(Method method, Object obj, Vector values) throws ResourceException{
- try {
- Class[] parameters = method.getParameterTypes();
- if (values.size() != parameters.length) {
- return;
- }
- Object[] actualValues = new Object[parameters.length];
- for (int i =0; i<parameters.length ; i++) {
- String val = (String) values.get(i);
- if (val.trim().equals("NULL")) {
- actualValues[i] = null;
- } else {
- actualValues[i] = convertType(parameters[i], val);
- }
- }
- method.invoke(obj, actualValues);
- }catch (IllegalAccessException iae) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- } catch (IllegalArgumentException ie) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
- throw new ResourceException("Arguments are wrong for the method :" + method.getName());
- } catch (InvocationTargetException ite) {
- _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
- throw new ResourceException("Access denied to execute the method :" + method.getName());
- }
+ try {
+ Class[] parameters = method.getParameterTypes();
+ if (values.size() != parameters.length) {
+ return;
+ }
+ Object[] actualValues = new Object[parameters.length];
+ for (int i =0; i<parameters.length ; i++) {
+ String val = (String) values.get(i);
+ if (val.trim().equals("NULL")) {
+ actualValues[i] = null;
+ } else {
+ actualValues[i] = convertType(parameters[i], val);
+ }
+ }
+ method.invoke(obj, actualValues);
+ }catch (IllegalAccessException iae) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", iae);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ } catch (IllegalArgumentException ie) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ie);
+ throw new ResourceException("Arguments are wrong for the method :" + method.getName());
+ } catch (InvocationTargetException ite) {
+ _logger.log(Level.SEVERE, "jdbc.exc_jb_val", ite);
+ throw new ResourceException("Access denied to execute the method :" + method.getName());
+ }
}
-
+
/**
* Converts the type from String to the Class type.
*
- * @param type Class name to which the conversion is required.
- * @param parameter String value to be converted.
- * @return Converted value.
+ * @param type Class name to which the conversion is required.
+ * @param parameter String value to be converted.
+ * @return Converted value.
* @throws <code>ResourceException</code>, in case of the mismatch of parameter values or
- * a security violation.
+ * a security violation.
*/
private Object convertType(Class type, String parameter) throws ResourceException{
- try {
- String typeName = type.getName();
- if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
- return parameter;
- }
-
- if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
- return new Integer(parameter);
- }
-
- if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
- return new Short(parameter);
- }
-
- if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
- return new Byte(parameter);
- }
-
- if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
- return new Long(parameter);
- }
-
- if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
- return new Float(parameter);
- }
-
- if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
- return new Double(parameter);
- }
-
- if (typeName.equals("java.math.BigDecimal")) {
- return new java.math.BigDecimal(parameter);
- }
-
- if (typeName.equals("java.math.BigInteger")) {
- return new java.math.BigInteger(parameter);
- }
-
- if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
- return new Boolean(parameter);
- }
+ try {
+ String typeName = type.getName();
+ if ( typeName.equals("java.lang.String") || typeName.equals("java.lang.Object")) {
+ return parameter;
+ }
- return parameter;
- } catch (NumberFormatException nfe) {
- _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
- throw new ResourceException(parameter+": Not a valid value for this method ");
- }
+ if (typeName.equals("int") || typeName.equals("java.lang.Integer")) {
+ return new Integer(parameter);
+ }
+
+ if (typeName.equals("short") || typeName.equals("java.lang.Short")) {
+ return new Short(parameter);
+ }
+
+ if (typeName.equals("byte") || typeName.equals("java.lang.Byte")) {
+ return new Byte(parameter);
+ }
+
+ if (typeName.equals("long") || typeName.equals("java.lang.Long")) {
+ return new Long(parameter);
+ }
+
+ if (typeName.equals("float") || typeName.equals("java.lang.Float")) {
+ return new Float(parameter);
+ }
+
+ if (typeName.equals("double") || typeName.equals("java.lang.Double")) {
+ return new Double(parameter);
+ }
+
+ if (typeName.equals("java.math.BigDecimal")) {
+ return new java.math.BigDecimal(parameter);
+ }
+
+ if (typeName.equals("java.math.BigInteger")) {
+ return new java.math.BigInteger(parameter);
+ }
+
+ if (typeName.equals("boolean") || typeName.equals("java.lang.Boolean")) {
+ return new Boolean(parameter);
+ }
+
+ return parameter;
+ } catch (NumberFormatException nfe) {
+ _logger.log(Level.SEVERE, "jdbc.exc_nfe", parameter);
+ throw new ResourceException(parameter+": Not a valid value for this method ");
+ }
}
-
+
}
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/SecurityUtils.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/SecurityUtils.java
index fc149bf..f008e7f 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/SecurityUtils.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/SecurityUtils.java
@@ -29,36 +29,36 @@
/**
* SecurityUtils for Generic JDBC Connector.
*
- * @version 1.0, 02/07/22
- * @author Evani Sai Surya Kiran
+ * @version 1.0, 02/07/22
+ * @author Evani Sai Surya Kiran
*/
public class SecurityUtils {
/**
- * This method returns the <code>PasswordCredential</code> object, given
- * the <code>ManagedConnectionFactory</code>, subject and the
- * <code>ConnectionRequestInfo</code>. It first checks if the
- * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
+ * This method returns the <code>PasswordCredential</code> object, given
+ * the <code>ManagedConnectionFactory</code>, subject and the
+ * <code>ConnectionRequestInfo</code>. It first checks if the
+ * <code>ConnectionRequestInfo</code> is null or not. If it is not null,
* it constructs a <code>PasswordCredential</code> object with
* the user and password fields from the <code>ConnectionRequestInfo</code> and returns this
- * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
- * is null, it retrieves the <code>PasswordCredential</code> objects from
+ * <code>PasswordCredential</code> object. If the <code>ConnectionRequestInfo</code>
+ * is null, it retrieves the <code>PasswordCredential</code> objects from
* the <code>Subject</code> parameter and returns the first
- * <code>PasswordCredential</code> object which contains a
+ * <code>PasswordCredential</code> object which contains a
* <code>ManagedConnectionFactory</code>, instance equivalent
* to the <code>ManagedConnectionFactory</code>, parameter.
*
- * @param mcf <code>ManagedConnectionFactory</code>
- * @param subject <code>Subject</code>
- * @param info <code>ConnectionRequestInfo</code>
- * @return <code>PasswordCredential</code>
- * @throws <code>ResourceException</code> generic exception if operation fails
- * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
+ * @param mcf <code>ManagedConnectionFactory</code>
+ * @param subject <code>Subject</code>
+ * @param info <code>ConnectionRequestInfo</code>
+ * @return <code>PasswordCredential</code>
+ * @throws <code>ResourceException</code> generic exception if operation fails
+ * @throws <code>SecurityException</code> if access to the <code>Subject</code> instance is denied
*/
public static PasswordCredential getPasswordCredential(final ManagedConnectionFactory mcf,
final Subject subject, jakarta.resource.spi.ConnectionRequestInfo info) throws ResourceException {
- if (info == null) {
+ if (info == null) {
if (subject == null) {
return null;
} else {
@@ -89,14 +89,14 @@
return pc;
}
}
-
+
/**
* Returns true if two strings are equal; false otherwise
- *
- * @param str1 <code>String</code>
- * @param str2 <code>String</code>
- * @return true if the two strings are equal
- * false otherwise
+ *
+ * @param str1 <code>String</code>
+ * @param str2 <code>String</code>
+ * @return true if the two strings are equal
+ * false otherwise
*/
static private boolean isEqual(String str1, String str2) {
if (str1 == null) {
@@ -109,10 +109,10 @@
/**
* Returns true if two <code>PasswordCredential</code> objects are equal; false otherwise
*
- * @param pC1 <code>PasswordCredential</code>
- * @param pC2 <code>PasswordCredential</code>
- * @return true if the two PasswordCredentials are equal
- * false otherwise
+ * @param pC1 <code>PasswordCredential</code>
+ * @param pC2 <code>PasswordCredential</code>
+ * @return true if the two PasswordCredentials are equal
+ * false otherwise
*/
static public boolean isPasswordCredentialEqual(PasswordCredential pC1, PasswordCredential pC2) {
if (pC1 == pC2)
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/build.xml b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/build.xml
index a55bbf0..f060e7d 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/build.xml
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/ra/src/com/sun/jdbcra/util/build.xml
@@ -19,7 +19,7 @@
<project name="jdbc_connector" basedir="." default="build">
<property name="pkg.dir" value="com/sun/gjc/util"/>
-
+
<target name="clean">
<ant antfile="build.xml" dir="${gjc.home}/bin" target="clean"/>
</target>
@@ -33,7 +33,7 @@
<jar jarfile="${dist.dir}/${pkg.dir}/util.jar" basedir="${class.dir}"
includes="${pkg.dir}/**/*"/>
</target>
-
+
<target name="compile13" depends="compile"/>
<target name="compile14" depends="compile"/>
@@ -44,5 +44,5 @@
<target name="build14" depends="compile14, package14"/>
<target name="build" depends="build13, build14"/>
-
+
</project>
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/servlet/SimpleBankServlet.java b/appserver/tests/appserv-tests/devtests/connector/web2connector/servlet/SimpleBankServlet.java
index 96e83a5..e14006e 100644
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/servlet/SimpleBankServlet.java
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/servlet/SimpleBankServlet.java
@@ -17,17 +17,17 @@
package samples.ejb.subclassing.servlet;
import java.io.*;
-import java.util.*;
-import jakarta.servlet.*;
-import javax.naming.*;
-import jakarta.servlet.http.*;
+import java.util.*;
+import jakarta.servlet.*;
+import javax.naming.*;
+import jakarta.servlet.http.*;
import javax.rmi.PortableRemoteObject;
-import jakarta.ejb.*;
+import jakarta.ejb.*;
-import samples.ejb.subclassing.ejb.*;
+import samples.ejb.subclassing.ejb.*;
import com.sun.jdbcra.spi.JdbcSetupAdmin;
-public class SimpleBankServlet extends HttpServlet {
+public class SimpleBankServlet extends HttpServlet {
InitialContext initContext = null;
@@ -44,14 +44,14 @@
doLookup();
}
- public void doGet (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ public void doGet (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
doPost(request, response);
- }
+ }
- /** handles the HTTP POST operation **/
- public void doPost (HttpServletRequest request,HttpServletResponse response)
- throws ServletException, IOException {
+ /** handles the HTTP POST operation **/
+ public void doPost (HttpServletRequest request,HttpServletResponse response)
+ throws ServletException, IOException {
System.out.println("SimpleBankServlet is executing");
String SSN = request.getParameter("SSN");
@@ -66,14 +66,14 @@
String zipCode = "";
long currentSavingsBalance = 0;
long currentCheckingBalance = 0;
-
+
String action = request.getParameter("action");
if (action.equals("Create"))
{
message = "Add Customer";
jsp = "/SimpleBankAdd.jsp";
}
- else if (action.equals("Add Customer"))
+ else if (action.equals("Add Customer"))
{
System.out.println("Add Customer button pressed");
SSN = request.getParameter("SSN");
@@ -90,7 +90,7 @@
customerSavings = customerSavingsHome.create(SSN, lastName, firstName, address1, address2, city, state, zipCode);
} catch (Exception e) {
System.out.println("Could not create the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Added.";
@@ -103,7 +103,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
jsp = "/SimpleBankEdit.jsp";
@@ -115,7 +115,7 @@
customerSavings = customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Delete Customer";
@@ -127,12 +127,12 @@
customerSavingsHome.findByPrimaryKey(SSN).remove();
} catch (Exception e) {
System.out.println("Could not delete the customer savings bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
message = "Customer Deleted.";
jsp = "/SimpleBankMessage.jsp";
- }
+ }
else if (action.equals("Update"))
@@ -142,7 +142,7 @@
customerSavings = (CustomerSavings)customerSavingsHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer savings remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -151,7 +151,7 @@
customerChecking = (CustomerChecking)customerCheckingHome.findByPrimaryKey(SSN);
} catch (Exception e) {
System.out.println("Could not find the customer checking remote bean : " + e.toString());
- throw new ServletException(e.getMessage());
+ throw new ServletException(e.getMessage());
//return;
}
@@ -211,9 +211,9 @@
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(jsp);
dispatcher.include(request, response);
return;
- }
+ }
- public void doLookup()
+ public void doLookup()
{
try {
initContext = new javax.naming.InitialContext();
diff --git a/appserver/tests/appserv-tests/devtests/connector/web2connector/sql/dropBankTables.sql b/appserver/tests/appserv-tests/devtests/connector/web2connector/sql/dropBankTables.sql
index df9df34..33a7069 100755
--- a/appserver/tests/appserv-tests/devtests/connector/web2connector/sql/dropBankTables.sql
+++ b/appserver/tests/appserv-tests/devtests/connector/web2connector/sql/dropBankTables.sql
@@ -1 +1 @@
-drop table customer2;
+drop table customer2;