[jboss-svn-commits] JBL Code SVN: r29693 - in labs/jbosstm/trunk: ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc and 10 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Tue Oct 20 10:08:56 EDT 2009
Author: jhalliday
Date: 2009-10-20 10:08:55 -0400 (Tue, 20 Oct 2009)
New Revision: 29693
Removed:
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/Info.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Configuration.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Environment.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Configuration.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Environment.java
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java
labs/jbosstm/trunk/qa/tests/src/org/jboss/jbossts/qa/Misc/
Modified:
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/txojPropertyManager.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBean.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBeanMBean.java
labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/jdbcPropertyManager.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java
labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBeanMBean.java
labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java
labs/jbosstm/trunk/ArjunaJTS/trailmap/src/com/arjuna/demo/jta/jdbcbank/BankClient.java
Log:
Moved transaction driver JNDI handling to bean based. Removed obsolete config classes. JBTM-628
Modified: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/txojPropertyManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/txojPropertyManager.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/txojPropertyManager.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -44,18 +44,8 @@
*/
public class txojPropertyManager
{
- /**
- * @deprecated use TxojEnvironmentBean instead
- * @return
- */
- @Deprecated
- public static PropertyManager getPropertyManager()
- {
- return PropertyManagerFactory.getPropertyManagerForModule("txoj", Environment.PROPERTIES_FILE);
- }
-
public static TxojEnvironmentBean getTxojEnvironmentBean()
{
- return BeanPopulator.getSingletonInstance(TxojEnvironmentBean.class, getPropertyManager());
+ return BeanPopulator.getSingletonInstance(TxojEnvironmentBean.class);
}
}
\ No newline at end of file
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/IndirectRecoverableConnection.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -377,31 +377,12 @@
{
if (_theDataSource == null)
{
- Hashtable env = new Hashtable();
- Enumeration e = jdbcPropertyManager.getPropertyManager().propertyNames();
-
- /*
- * Look through the properties for any Context related
- * stuff.
- */
-
- while (e.hasMoreElements())
- {
- String name = (String) e.nextElement();
-
- if (name.startsWith("Context."))
- env.put(translate(name), jdbcPropertyManager.getPropertyManager().getProperty(name));
+ Hashtable env = jdbcPropertyManager.getJDBCEnvironmentBean().getJndiProperties();
+ Context ctx = new InitialContext(env);
+ _theDataSource = (XADataSource) ctx.lookup(_dbName);
}
- if (env.size() > 0)
- {
- Context ctx = new InitialContext(env);
- _theDataSource = (XADataSource) ctx.lookup(_dbName);
- }
- else
- _theDataSource = null;
-
- if (_theDataSource == null)
+ if (_theDataSource == null) {
throw new SQLException(jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.jndierror"));
}
}
@@ -411,7 +392,7 @@
}
catch (Exception e)
{
- e.printStackTrace();
+ jdbcLogger.logger.error(e);
SQLException sqlException = new SQLException(e.toString());
sqlException.initCause(e);
Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/Info.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/Info.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/Info.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,66 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2002,
- *
- * Hewlett-Packard Arjuna Labs,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.jdbc;
-
-import com.arjuna.ats.jdbc.common.Configuration;
-
-/**
- * Module specific implementation of the information object.
- *
- * @author Mark Little (mark_little at hp.com)
- * @version $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since JTS 2.0.
- */
-
-public class Info
-{
-
- public String toString()
- {
- StringBuffer moduleInfo = new StringBuffer();
-
- moduleInfo.append("<module-info name=\"" + Configuration.getBuildTimeProperty("MODULE") + "\">");
- moduleInfo.append("<source-identifier>" + Configuration.getBuildTimeProperty("SOURCEID") + "</source-identifier>");
- moduleInfo.append("<build-information>" + Configuration.getBuildTimeProperty("BUILDINFO") + "</build-information>");
- moduleInfo.append("<version>" + Configuration.getBuildTimeProperty("VERSION") + "</version>");
- moduleInfo.append("<date>" + Configuration.getBuildTimeProperty("DATE") + "</date>");
- moduleInfo.append("<notes>" + Configuration.getBuildTimeProperty("NOTES") + "</notes>");
- moduleInfo.append("<configuration>");
- moduleInfo.append("<supported-versions>" + Configuration.getBuildTimeProperty("SUPPORTED_VERSIONS") + "</supported-versions>");
- moduleInfo.append("</configuration>");
- moduleInfo.append("</module-info>");
-
- return(moduleInfo.toString());
- }
-
-}
-
Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Configuration.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Configuration.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Configuration.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 1998, 1999, 2000, 2001,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.jdbc.common;
-
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
-import java.io.File;
-import java.io.InputStream;
-
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Runtime configuration class for this module.
- *
- * @author Mark Little (mark at arjuna.com)
- * @version $Id: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since JTS 1.0.
- */
-
-public class Configuration
-{
-
- /**
- * @return the name of the module properties file to use.
- */
-
-public static synchronized final String propertiesFile ()
- {
- return _propFile;
- }
-
- /**
- * Set the name of the properties file.
- */
-
-public static synchronized final void setPropertiesFile (String file)
- {
- _propFile = file;
- }
-
- /**
- * Get a build time property.
- * @param name The name of the build time property.
- * @return The build time property value.
- */
- public static String getBuildTimeProperty(final String name)
- {
- if (PROPS == null)
- {
- return "" ;
- }
- else
- {
- return PROPS.getProperty(name, "") ;
- }
- }
-
- private static final Properties PROPS ;
-
- static
- {
- final InputStream is = Configuration.class.getResourceAsStream("/jdbc.properties") ;
- if (is != null)
- {
- Properties props = new Properties() ;
- try
- {
- props.load(is) ;
- }
- catch (final IOException ioe)
- {
- props = null ;
- }
- PROPS = props ;
- }
- else
- {
- PROPS = null ;
- }
- }
-
-private static String _propFile = getBuildTimeProperty("PROPERTIES_FILE") ;
-
-}
-
Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Environment.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/Environment.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,49 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2001, 2002,
- *
- * Hewlett-Packard Arjuna Labs,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Environment.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.jdbc.common;
-
-/**
- * The module specific properties which may be set to configure the
- * system at runtime.
- *
- * @author Mark Little (mark_little at hp.com)
- * @version $Id: Environment.java 2342 2006-03-30 13:06:17Z $
- * @since JTS 2.0.
- * @deprecated user JDBCEnvironmentBean instead
- */
- at Deprecated
-public class Environment
-{
- public static final String PROPERTIES_FILE = "com.arjuna.ats.jdbc.common.propertiesFile";
- public static final String ISOLATION_LEVEL = "com.arjuna.ats.jdbc.isolationLevel";
-}
-
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBean.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBean.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -21,9 +21,9 @@
package com.arjuna.ats.jdbc.common;
import com.arjuna.common.internal.util.propertyservice.PropertyPrefix;
-import com.arjuna.common.internal.util.propertyservice.FullPropertyName;
import java.sql.Connection;
+import java.util.Hashtable;
/**
* A JavaBean containing configuration properties for the JDBC subsystem.
@@ -33,35 +33,11 @@
@PropertyPrefix(prefix = "com.arjuna.ats.jdbc.")
public class JDBCEnvironmentBean implements JDBCEnvironmentBeanMBean
{
- @FullPropertyName(name = "com.arjuna.ats.jdbc.common.propertiesFile")
- private volatile String propertiesFile = "";
-
private volatile int isolationLevel = Connection.TRANSACTION_SERIALIZABLE;
- /**
- * Returns the name of the properties file.
- *
- * Default: ""
- * Equivalent deprecated property: com.arjuna.ats.jdbc.common.propertiesFile
- *
- * @return the name of the properties file
- */
- public String getPropertiesFile()
- {
- return propertiesFile;
- }
+ private volatile Hashtable jndiProperties = new Hashtable();
/**
- * Sets the name of the properties file.
- *
- * @param propertiesFile the name of the properties file.
- */
- public void setPropertiesFile(String propertiesFile)
- {
- this.propertiesFile = propertiesFile;
- }
-
- /**
* Returns the default isolation level for tansactional database operations.
*
* Default: Connection.TRANSACTION_SERIALIZABLE
@@ -90,4 +66,35 @@
this.isolationLevel = isolationLevel;
}
+
+ /**
+ * Returns the Hashtable used for the JNDI environment in transactional driver code.
+ * The returned object is a clone. May return an empty Hashtable , will not return null.
+ *
+ * Default: empty Hashtable.
+ *
+ * Note: unlike previous versions, the contents is passed to InitialContext verbatim.
+ * Hence String keys should be of the form e.g. "java.naming.factory.initial", not "Context.INITIAL_CONTEXT_FACTORY"
+ *
+ * @return a Hashtable object containing JNDI context information.
+ */
+ public Hashtable getJndiProperties()
+ {
+ return (Hashtable)jndiProperties.clone();
+ }
+
+ /**
+ * Sets the JNDI properties used by transactional driver code.
+ * The provided Hashtable will be cloned, not retained.
+ *
+ * @param jndiProperties a Hashtable object containing JNDI context information.
+ */
+ public void setJndiProperties(Hashtable jndiProperties)
+ {
+ if(jndiProperties == null) {
+ this.jndiProperties = new Hashtable();
+ } else {
+ this.jndiProperties = (Hashtable)jndiProperties.clone();
+ }
+ }
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBeanMBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBeanMBean.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/JDBCEnvironmentBeanMBean.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -20,6 +20,8 @@
*/
package com.arjuna.ats.jdbc.common;
+import java.util.Hashtable;
+
/**
* A JMX MBean interface containing configuration for the JDBC subsystem.
*
@@ -27,11 +29,11 @@
*/
public interface JDBCEnvironmentBeanMBean
{
- String getPropertiesFile();
+ int getIsolationLevel();
- void setPropertiesFile(String propertiesFile);
+ void setIsolationLevel(int isolationLevel);
- int getIsolationLevel();
+ public Hashtable getJndiProperties();
- void setIsolationLevel(int isolationLevel);
+ public void setJndiProperties(Hashtable jndiProperties);
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/jdbcPropertyManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/jdbcPropertyManager.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/jdbc/common/jdbcPropertyManager.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -41,16 +41,6 @@
*/
public class jdbcPropertyManager
{
- /**
- * @deprecated use JDBCEnvironmentBean instead
- * @return
- */
- @Deprecated
- public static PropertyManager getPropertyManager()
- {
- return PropertyManagerFactory.getPropertyManagerForModule("jdbc", Environment.PROPERTIES_FILE);
- }
-
public static JDBCEnvironmentBean getJDBCEnvironmentBean()
{
return BeanPopulator.getSingletonInstance(JDBCEnvironmentBean.class);
Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/tests/classes/com/hp/mwtests/ts/jdbc/basic/BeanPopulatorTest.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009,
- * @author JBoss, a division of Red Hat.
- */
-package com.hp.mwtests.ts.jdbc.basic;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-import com.arjuna.common.tests.simple.DummyProperties;
-import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
-import com.arjuna.ats.jdbc.common.Environment;
-import com.arjuna.ats.jdbc.common.JDBCEnvironmentBean;
-
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * Check behaviour of the BeanPopulator util which copies old PropertyManager values into new EnvironmentBeans.
- *
- * @author Jonathan Halliday (jonathan.halliday at redhat.com)
- */
-public class BeanPopulatorTest
-{
- @Test
- public void testJDBCPropertiesPopulation() throws Exception {
-
- // check that all the Environment properties are looked for
- // by the set of beans which wrap them and conversely that no undefined
- // properties are looked for. i.e. that the Environment and Beans are in sync
-
- DummyProperties testProperties = new DummyProperties();
-
- BeanPopulator.configureFromProperties(new JDBCEnvironmentBean(), testProperties);
-
- Set<String> expectedKeys = new HashSet<String>();
- expectedKeys.addAll( DummyProperties.extractKeys(Environment.class));
-
- assertTrue( testProperties.usedKeys.containsAll(expectedKeys) );
- }
-}
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/recovery/arjunacore/XARecoveryModule.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1349,18 +1349,8 @@
// Reference to the Object Store.
private static ObjectStore _transactionStore = null;
- private static int _backoffPeriod = 0;
-
- private static final int XA_BACKOFF_PERIOD = 20000; // backoff in
-
// milliseconds
private static final char BREAKCHARACTER = ';'; // delimiter for xaconnrecov
// property
-
- static
- {
- _backoffPeriod = jtaPropertyManager.getJTAEnvironmentBean().getXaBackoffPeriod();
- }
-
}
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/transaction/arjunacore/TransactionImple.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -38,7 +38,6 @@
import com.arjuna.ats.internal.jta.resources.arjunacore.XAOnePhaseResource;
import com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord;
-import com.arjuna.ats.jta.common.Configuration;
import com.arjuna.ats.jta.common.jtaPropertyManager;
import com.arjuna.ats.jta.exceptions.InactiveTransactionException;
import com.arjuna.ats.jta.exceptions.InvalidTerminationStateException;
@@ -1822,12 +1821,6 @@
private static boolean getXATransactionTimeoutEnabled()
{
- final Boolean xaTransactionTimeoutEnabled = Configuration
- .getXATransactionTimeoutEnabled();
- if (xaTransactionTimeoutEnabled != null)
- {
- return xaTransactionTimeoutEnabled.booleanValue();
- }
return XA_TRANSACTION_TIMEOUT_ENABLED;
}
Deleted: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Configuration.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Configuration.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Configuration.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,127 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 1998, 1999, 2000, 2001,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.jta.common;
-
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
-import java.io.File;
-import java.io.InputStream;
-
-import java.io.IOException;
-import java.util.Properties;
-
-/**
- * Runtime configuration class for this module.
- *
- * @author Mark Little (mark at arjuna.com)
- * @version $Id: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since JTS 1.0.
- */
-
-public class Configuration
-{
-
- /**
- * @return the name of the module properties file to use.
- */
-
-public static synchronized final String propertiesFile ()
- {
- return _propFile;
- }
-
- /**
- * Set the name of the properties file.
- */
-
-public static synchronized final void setPropertiesFile (String file)
- {
- _propFile = file;
- }
-
- public static synchronized final Boolean getXATransactionTimeoutEnabled()
- {
- return _xaTransactionTimeoutEnabled ;
- }
-
- public static synchronized final void setXATransactionTimeoutEnabled(final Boolean xaTransactionTimeoutEnabled)
- {
- _xaTransactionTimeoutEnabled = xaTransactionTimeoutEnabled ;
- }
-
- /**
- * Get a build time property.
- * @param name The name of the build time property.
- * @return The build time property value.
- */
- public static String getBuildTimeProperty(final String name)
- {
- if (PROPS == null)
- {
- return "" ;
- }
- else
- {
- return PROPS.getProperty(name, "") ;
- }
- }
-
- private static final Properties PROPS ;
-
- static
- {
- final InputStream is = Configuration.class.getResourceAsStream("/jta.properties") ;
- if (is != null)
- {
- Properties props = new Properties() ;
- try
- {
- props.load(is) ;
- }
- catch (final IOException ioe)
- {
- props = null ;
- }
- PROPS = props ;
- }
- else
- {
- PROPS = null ;
- }
- }
-
-private static String _lockStore = null;
-private static String _propFile = getBuildTimeProperty("PROPERTIES_FILE") ;
-private static Boolean _xaTransactionTimeoutEnabled ;
-
-}
-
Deleted: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Environment.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/Environment.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2001, 2002,
- *
- * Hewlett-Packard Arjuna Labs,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Environment.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.jta.common;
-
-/**
- * The module specific properties which may be set to configure the
- * system at runtime.
- *
- * @author Mark Little (mark_little at hp.com)
- * @version $Id: Environment.java 2342 2006-03-30 13:06:17Z $
- * @since JTS 2.0.
- */
-
-public class Environment
-{
- public static final String PROPERTIES_FILE = "com.arjuna.ats.jta.common.propertiesFile";
- public static final String SUPPORT_SUBTRANSACTIONS = "com.arjuna.ats.jta.supportSubtransactions";
-
- public static final String JTA_TM_IMPLEMENTATION = "com.arjuna.ats.jta.jtaTMImplementation";
- public static final String JTA_UT_IMPLEMENTATION = "com.arjuna.ats.jta.jtaUTImplementation";
- public static final String JTA_TSR_IMPLEMENTATION = "com.arjuna.ats.jta.jtaTSRImplementation";
-
- public static final String XA_BACKOFF_PERIOD = "com.arjuna.ats.jta.xaBackoffPeriod";
- public static final String XA_RECOVERY_NODE = "com.arjuna.ats.jta.xaRecoveryNode";
- public static final String XA_ROLLBACK_OPTIMIZATION = "com.arjuna.ats.jta.xaRollbackOptimization";
- public static final String XA_ASSUME_RECOVERY_COMPLETE = "com.arjuna.ats.jta.xaAssumeRecoveryComplete";
-
- public static final String UT_JNDI_CONTEXT = "com.arjuna.ats.jta.utils.UTJNDIContext";
- public static final String TM_JNDI_CONTEXT = "com.arjuna.ats.jta.utils.TMJNDIContext";
- public static final String TSR_JNDI_CONTEXT = "com.arjuna.ats.jta.utils.TSRJNDIContext";
-
- public static final String XA_ERROR_HANDLER = "com.arjuna.ats.jta.xaErrorHandler";
- public static final String XA_TRANSACTION_TIMEOUT_ENABLED = "com.arjuna.ats.jta.xaTransactionTimeoutEnabled";
- public static final String LAST_RESOURCE_OPTIMISATION_INTERFACE = "com.arjuna.ats.jta.lastResourceOptimisationInterface";
-}
-
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBean.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -35,17 +35,12 @@
@PropertyPrefix(prefix = "com.arjuna.ats.jta.")
public class JTAEnvironmentBean implements JTAEnvironmentBeanMBean
{
- @FullPropertyName(name = "com.arjuna.ats.jta.common.propertiesFile")
- private volatile String propertiesFile = "";
-
private volatile boolean supportSubtransactions = false;
private volatile String jtaTMImplementation = "com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple";
private volatile String jtaUTImplementation = "com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple";
private volatile String jtaTSRImplementation = "com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionSynchronizationRegistryImple";
- private volatile int xaBackoffPeriod = 20000;
-
@ConcatenationPrefix(prefix = "com.arjuna.ats.jta.xaRecoveryNode")
private volatile List<String> xaRecoveryNodes = new ArrayList<String>();
@@ -70,29 +65,6 @@
private volatile String lastResourceOptimisationInterface = null;
/**
- * Returns the name of the properties file.
- *
- * Default: ""
- * Equivalent deprecated property: com.arjuna.ats.jta.common.propertiesFile
- *
- * @return the name of the properties file
- */
- public String getPropertiesFile()
- {
- return propertiesFile;
- }
-
- /**
- * Sets the name of the properties file.
- *
- * @param propertiesFile the name of the properties file.
- */
- public void setPropertiesFile(String propertiesFile)
- {
- this.propertiesFile = propertiesFile;
- }
-
- /**
* Returns true if subtransactions are allowed.
* Warning: subtransactions are not JTA spec compliant and most XA resource managers don't understand them.
*
@@ -186,30 +158,6 @@
}
/**
- * Returns the XA backoff period, in milliseconds.
- *
- * Default: 20000 milliseconds
- * Equivalent deprecated property: com.arjuna.ats.jta.xaBackoffPeriod
- *
- * @deprecated I'm not unsed, remove me.
- * @return the XA backoff period, in milliseconds.
- */
- public int getXaBackoffPeriod()
- {
- return xaBackoffPeriod;
- }
-
- /**
- * Sets the XA backoff period, in milliseconds.
- *
- * @param xaBackoffPeriod the XA backoff period, in milliseconds.
- */
- public void setXaBackoffPeriod(int xaBackoffPeriod)
- {
- this.xaBackoffPeriod = xaBackoffPeriod;
- }
-
- /**
* Returns the set of node identifiers for which recovery will be performed.
* The returned list is a copy. May return an empty list, will not return null.
*
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBeanMBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBeanMBean.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/jta/common/JTAEnvironmentBeanMBean.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -29,10 +29,6 @@
*/
public interface JTAEnvironmentBeanMBean
{
- String getPropertiesFile();
-
- void setPropertiesFile(String propertiesFile);
-
boolean isSupportSubtransactions();
void setSupportSubtransactions(boolean supportSubtransactions);
@@ -49,10 +45,6 @@
void setJtaTSRImplementation(String jtaTSRImplementation);
- int getXaBackoffPeriod();
-
- void setXaBackoffPeriod(int xaBackoffPeriod);
-
List<String> getXaRecoveryNodes();
void setXaRecoveryNodes(List<String> xaRecoveryNodes);
Deleted: labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/basic/BeanPopulatorTest.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2009,
- * @author JBoss, a division of Red Hat.
- */
-package com.hp.mwtests.ts.jta.basic;
-
-import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
-import com.arjuna.common.tests.simple.DummyProperties;
-import com.arjuna.ats.jta.common.JTAEnvironmentBean;
-import com.arjuna.ats.jta.common.Environment;
-
-import java.util.Set;
-import java.util.HashSet;
-
-import org.junit.Test;
-import static org.junit.Assert.*;
-
-/**
- * Check behaviour of the BeanPopulator util which copies old PropertyManager values into new EnvironmentBeans.
- *
- * @author Jonathan Halliday (jonathan.halliday at redhat.com)
- */
-public class BeanPopulatorTest
-{
- @Test
- public void testJTAPropertiesPopulation() throws Exception {
-
- // check that all the Environment properties are looked for
- // by the set of beans which wrap them and conversely that no undefined
- // properties are looked for. i.e. that the Environment and Beans are in sync
-
- DummyProperties testProperties = new DummyProperties();
- testProperties.addConcatenationKeys(JTAEnvironmentBean.class);
-
- BeanPopulator.configureFromProperties(new JTAEnvironmentBean(), testProperties);
-
- Set<String> expectedKeys = new HashSet<String>();
- expectedKeys.addAll( DummyProperties.extractKeys(Environment.class));
-
- System.out.println("expectedKeys: "+expectedKeys);
- System.out.println("usedKeys: "+testProperties.usedKeys);
-
- assertTrue( testProperties.usedKeys.containsAll(expectedKeys) );
- }
-}
Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/transaction/jts/TransactionImple.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -50,7 +50,6 @@
import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
import com.arjuna.ats.jta.xa.*;
-import com.arjuna.ats.jta.common.Configuration;
import com.arjuna.ats.jta.common.jtaPropertyManager;
import com.arjuna.ats.jta.exceptions.InactiveTransactionException;
import com.arjuna.ats.jta.exceptions.InvalidTerminationStateException;
@@ -1833,11 +1832,6 @@
private static boolean getXATransactionTimeoutEnabled()
{
- final Boolean xaTransactionTimeoutEnabled = Configuration.getXATransactionTimeoutEnabled() ;
- if (xaTransactionTimeoutEnabled != null)
- {
- return xaTransactionTimeoutEnabled.booleanValue() ;
- }
return XA_TRANSACTION_TIMEOUT_ENABLED ;
}
Modified: labs/jbosstm/trunk/ArjunaJTS/trailmap/src/com/arjuna/demo/jta/jdbcbank/BankClient.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/trailmap/src/com/arjuna/demo/jta/jdbcbank/BankClient.java 2009-10-20 13:40:08 UTC (rev 29692)
+++ labs/jbosstm/trunk/ArjunaJTS/trailmap/src/com/arjuna/demo/jta/jdbcbank/BankClient.java 2009-10-20 14:08:55 UTC (rev 29693)
@@ -35,6 +35,7 @@
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.Hashtable;
+import java.util.Properties;
/**
* The <CODE>BankClient</CODE> application is an interactive CLI that allows the user of the JBoss Transactions product
@@ -576,8 +577,10 @@
System.exit(0);
}
// Initialize the property manager with the correct JNDI credentials to use to log in to JNDI
- jdbcPropertyManager.getPropertyManager().setProperty("Context.INITIAL_CONTEXT_FACTORY", "com.sun.jndi.fscontext.RefFSContextFactory");
- jdbcPropertyManager.getPropertyManager().setProperty("Context.PROVIDER_URL", "file:/tmp/JNDI");
+ Hashtable<String, String> properties = new Hashtable<String, String>();
+ properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.fscontext.RefFSContextFactory");
+ properties.put(Context.PROVIDER_URL, "file:/tmp/JNDI");
+ jdbcPropertyManager.getJDBCEnvironmentBean().setJndiProperties(properties);
// Create a local representation of a bank and then create a bank client to interact with it
Bank bank = new Bank();
More information about the jboss-svn-commits
mailing list