[jboss-cvs] JBossAS SVN: r108687 - in projects/jboss-jca/trunk: common/src/main/java/org/jboss/jca/common/metadata/ds and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Oct 20 10:38:07 EDT 2010
Author: jesper.pedersen
Date: 2010-10-20 10:38:06 -0400 (Wed, 20 Oct 2010)
New Revision: 108687
Modified:
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java
projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java
projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd
projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd
projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd
projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractDsDeployer.java
projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
Log:
Set UseJavaContext to true as default
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/common/CommonIronJacamarParser.java 2010-10-20 14:38:06 UTC (rev 108687)
@@ -68,7 +68,7 @@
CommonPool pool = null;
//attributes reading
- boolean useJavaContext = false;
+ boolean useJavaContext = true;
String className = null;
boolean enabled = true;
String jndiName = null;
@@ -99,7 +99,7 @@
break;
}
case USEJAVACONTEXT : {
- useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), false);
+ useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), true);
break;
}
default :
@@ -304,7 +304,7 @@
HashMap<String, String> configProperties = new HashMap<String, String>();
//attributes reading
- boolean useJavaContext = false;
+ boolean useJavaContext = true;
String className = null;
boolean enabled = true;
String jndiName = null;
@@ -331,7 +331,7 @@
break;
}
case USEJAVACONTEXT : {
- useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), false);
+ useJavaContext = attributeAsBoolean(reader, attribute.getLocalName(), true);
break;
}
case POOL_NAME : {
Modified: projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java
===================================================================
--- projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/common/src/main/java/org/jboss/jca/common/metadata/ds/DsParser.java 2010-10-20 14:38:06 UTC (rev 108687)
@@ -185,7 +185,7 @@
//attributes reading
- boolean useJavaContext = false;
+ boolean useJavaContext = true;
String poolName = null;
boolean enabled = true;
String jndiName = null;
@@ -315,7 +315,7 @@
CommonPool pool = null;
//attributes reading
- boolean useJavaContext = false;
+ boolean useJavaContext = true;
String poolName = null;
boolean enabled = true;
String jndiName = null;
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/datasources_1_0.xsd 2010-10-20 14:38:06 UTC (rev 108687)
@@ -336,11 +336,11 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute default="false" name="use-java-context" type="xs:boolean">
+ <xs:attribute default="true" name="use-java-context" type="xs:boolean">
<xs:annotation>
<xs:documentation>
<![CDATA[[
- Setting this to false will bind the DataSource into global jndi
+ Setting this to false will bind the DataSource into global JNDI
Ex: use-java-context="true"
]]>
</xs:documentation>
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/ironjacamar_1_0.xsd 2010-10-20 14:38:06 UTC (rev 108687)
@@ -133,11 +133,11 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute default="false" name="use-java-context" type="xs:boolean">
+ <xs:attribute default="true" name="use-java-context" type="xs:boolean">
<xs:annotation>
<xs:documentation>
<![CDATA[[
- Specifies if a global JNDI context should be used
+ Specifies if a java:/ JNDI context should be used
]]>
</xs:documentation>
</xs:annotation>
Modified: projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd
===================================================================
--- projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/common/src/main/resources/schema/resource-adapters_1_0.xsd 2010-10-20 14:38:06 UTC (rev 108687)
@@ -143,11 +143,11 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
- <xs:attribute default="false" name="use-java-context" type="xs:boolean">
+ <xs:attribute default="true" name="use-java-context" type="xs:boolean">
<xs:annotation>
<xs:documentation>
<![CDATA[[
- Specifies if a global JNDI context should be used
+ Specifies if a java:/ JNDI context should be used
]]>
</xs:documentation>
</xs:annotation>
Modified: projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java
===================================================================
--- projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/common/src/test/java/org/jboss/jca/common/metadata/ironjacamar/IronJacamarParserTestCase.java 2010-10-20 14:38:06 UTC (rev 108687)
@@ -404,7 +404,7 @@
assertThat(connDef.getPoolName(), new IsNull<String>());
assertThat(connDef.getClassName(), new IsNull<String>());
assertThat(connDef.isEnabled(), is(true));
- assertThat(connDef.isUseJavaContext(), is(false));
+ assertThat(connDef.isUseJavaContext(), is(true));
//pool default
assertThat(connDef.isXa(), is(false));
@@ -466,7 +466,7 @@
assertThat(connDef.getPoolName(), new IsNull<String>());
assertThat(connDef.getClassName(), new IsNull<String>());
assertThat(connDef.isEnabled(), is(true));
- assertThat(connDef.isUseJavaContext(), is(false));
+ assertThat(connDef.isUseJavaContext(), is(true));
//pool default
assertThat(connDef.isXa(), is(true));
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractDsDeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractDsDeployer.java 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractDsDeployer.java 2010-10-20 14:38:06 UTC (rev 108687)
@@ -207,8 +207,12 @@
{
String jndiName = dataSource.getJndiName();
- if (!jndiName.startsWith("java:/"))
+ if (dataSource.isUseJavaContext() != null &&
+ dataSource.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
jndiName = "java:/" + jndiName;
+ }
Object cf = deployDataSource(dataSource, jndiName, urlJdbcLocal, jdbcLocalDeploymentCl);
@@ -243,8 +247,12 @@
{
String jndiName = xaDataSource.getJndiName();
- if (!jndiName.startsWith("java:/"))
+ if (xaDataSource.isUseJavaContext() != null &&
+ xaDataSource.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
jndiName = "java:/" + jndiName;
+ }
Object cf = deployXADataSource(xaDataSource, jndiName, urlJdbcXA, jdbcXADeploymentCl);
@@ -327,6 +335,17 @@
cm.setJndiName(jndiName);
+ String poolName = null;
+ if (ds.getPoolName() != null)
+ {
+ poolName = ds.getPoolName();
+ }
+
+ if (poolName == null)
+ poolName = jndiName;
+
+ pool.setName(poolName);
+
// ConnectionFactory
return mcf.createConnectionFactory(cm);
}
@@ -400,6 +419,17 @@
cm.setJndiName(jndiName);
+ String poolName = null;
+ if (ds.getPoolName() != null)
+ {
+ poolName = ds.getPoolName();
+ }
+
+ if (poolName == null)
+ poolName = jndiName;
+
+ pool.setName(poolName);
+
// ConnectionFactory
return mcf.createConnectionFactory(cm);
}
Modified: projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java
===================================================================
--- projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java 2010-10-20 14:28:56 UTC (rev 108686)
+++ projects/jboss-jca/trunk/deployers/src/main/java/org/jboss/jca/deployers/common/AbstractResourceAdapterDeployer.java 2010-10-20 14:38:06 UTC (rev 108687)
@@ -643,10 +643,24 @@
if (aoRaXml != null)
{
jndiName = aoRaXml.getJndiName();
+
+ if (aoRaXml.isUseJavaContext() != null &&
+ aoRaXml.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
+ jndiName = "java:/" + jndiName;
+ }
}
else
{
jndiName = ijAO.getJndiName();
+
+ if (ijAO.isUseJavaContext() != null &&
+ ijAO.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
+ jndiName = "java:/" + jndiName;
+ }
}
bindAdminObject(url, deploymentName, ao, jndiName);
@@ -1001,10 +1015,28 @@
{
String jndiName;
if (cdRaXml != null)
+ {
jndiName = cdRaXml.getJndiName();
+
+ if (cdRaXml.isUseJavaContext() != null &&
+ cdRaXml.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
+ jndiName = "java:/" + jndiName;
+ }
+ }
else
+ {
jndiName = ijCD.getJndiName();
+ if (ijCD.isUseJavaContext() != null &&
+ ijCD.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
+ jndiName = "java:/" + jndiName;
+ }
+ }
+
bindConnectionFactory(url, deploymentName, cf, jndiName);
cfs = new Object[]{cf};
cfJndiNames = new String[]{jndiName};
@@ -1013,9 +1045,13 @@
String poolName = null;
if (cdRaXml != null)
+ {
poolName = cdRaXml.getPoolName();
+ }
else if (ijCD != null)
+ {
poolName = ijCD.getPoolName();
+ }
if (poolName == null)
poolName = jndiName;
@@ -1031,9 +1067,13 @@
String poolName = null;
if (cdRaXml != null)
+ {
poolName = cdRaXml.getPoolName();
+ }
else if (ijCD != null)
+ {
poolName = ijCD.getPoolName();
+ }
if (poolName == null)
poolName = cfJndiNames[0];
@@ -1279,10 +1319,28 @@
{
String jndiName;
if (cdRaXml != null)
+ {
jndiName = cdRaXml.getJndiName();
+
+ if (cdRaXml.isUseJavaContext() != null &&
+ cdRaXml.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
+ jndiName = "java:/" + jndiName;
+ }
+ }
else
+ {
jndiName = ijCD.getJndiName();
+ if (ijCD.isUseJavaContext() != null &&
+ ijCD.isUseJavaContext().booleanValue() &&
+ !jndiName.startsWith("java:/"))
+ {
+ jndiName = "java:/" + jndiName;
+ }
+ }
+
bindConnectionFactory(url, deploymentName, cf, jndiName);
cfs[cdIndex] = cf;
cfJndiNames[cdIndex] = jndiName;
@@ -1291,9 +1349,13 @@
String poolName = null;
if (cdRaXml != null)
+ {
poolName = cdRaXml.getPoolName();
+ }
else if (ijCD != null)
+ {
poolName = ijCD.getPoolName();
+ }
if (poolName == null)
poolName = jndiName;
@@ -1309,9 +1371,13 @@
String poolName = null;
if (cdRaXml != null)
+ {
poolName = cdRaXml.getPoolName();
+ }
else if (ijCD != null)
+ {
poolName = ijCD.getPoolName();
+ }
if (poolName == null)
poolName = cfJndiNames[0];
More information about the jboss-cvs-commits
mailing list