[jboss-svn-commits] JBL Code SVN: r29714 - in labs/jbosstm/trunk: ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common and 15 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 21 07:57:57 EDT 2009
Author: jhalliday
Date: 2009-10-21 07:57:56 -0400 (Wed, 21 Oct 2009)
New Revision: 29714
Added:
labs/jbosstm/trunk/common/classes/com/arjuna/common/util/ConfigurationInfo.java
Removed:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/Info.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Configuration.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryConfiguration.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryEnvironment.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/report.java
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/Info.java
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/Configuration.java
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/tools/
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Configuration.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/bin/com/arjuna/orbportability/internal/
labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/Info.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/Info.java
labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Configuration.java
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryManager.java
labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/lockstore/BasicPersistentLockStore.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/TransactionServer.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java
labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBeanMBean.java
labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/RecoveryManagerService.java
labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java
Log:
Further beanification of properties management. JBTM-628
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/Info.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/Info.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/Info.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,70 +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,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.arjuna;
-
-import java.util.Hashtable;
-
-import com.arjuna.ats.arjuna.common.Configuration;
-
-/**
- * Module specific implementation of the interface object.
- *
- * @author Richard Begg (richard_begg at hp.com)
- * @version $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since HPTS 3.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("<properties-file dir=\""+Configuration.propertiesDir()+"\">"+Configuration.propertiesFile()+"</properties-file>");
- moduleInfo.append("<object-store-root>"+Configuration.objectStoreRoot()+"</object-store-root>");
- moduleInfo.append("</configuration>");
- moduleInfo.append("</module-info>");
-
- return(moduleInfo.toString());
- }
-
-}
-
-
-
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Configuration.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Configuration.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Configuration.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,217 +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.arjuna.common;
-
-import com.arjuna.common.Info;
-import com.arjuna.common.util.propertyservice.PropertyManager;
-import com.arjuna.common.util.FileLocator;
-
-import java.io.File;
-import java.io.InputStream;
-
-import com.arjuna.ats.arjuna.logging.tsLogger;
-
-import java.io.IOException;
-import java.util.Properties;
-
-/*
- * When we have an installation utility (e.g., InstallShield) we can have
- * that compile the property file location in a separate file which this
- * class then uses. So we ship a small source file in the distribution which
- * then gets built on a per-installation basis. Could do that for other
- * things too.
- */
-
-/**
- * This class contains various run-time configuration options. Default
- * values are provided at compile-time, and may be operating system
- * specific.
- *
- * @author Mark Little (mark at arjuna.com)
- * @version $Id: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since 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;
- }
-
- /**
- * @return the location of the module properties file to use.
- *
- * @message com.arjuna.ats.arjuna.common.Configuration_1 [com.arjuna.ats.arjuna.common.Configuration_1] Configuration.propertiesDir() - Cannot find properties file {0}
- */
-
-public static synchronized final String propertiesDir ()
- {
- String propDir = ".";
-
- try
- {
- propDir = FileLocator.locateFile( propertiesFile() );
- }
- catch (java.io.FileNotFoundException e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled()) {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.common.Configuration_1",
- new Object[]{propertiesFile()});
- }
- }
-
- return propDir;
- }
-
- /**
- * @return the version of arjuna.
- */
-
-public static final String version ()
- {
- return getBuildTimeProperty("ARJUNA_VERSION");
- }
-
- /**
- * Used to obtain the root of the object store.
- *
- * @return <code>path</code> to object store.
- */
-
-public static synchronized final String objectStoreRoot ()
- {
- if (_objectStore == null)
- {
- /* Set default location under current directory */
- _objectStore = System.getProperty("user.dir") + File.separator + "ObjectStore";
-
- }
-
- return _objectStore;
- }
-
- /**
- * Used to set the root of the object store. Changes will
- * take effect the next time the root is queried. Existing
- * object store instances will not be effected.
- */
-
-public static synchronized final void setObjectStoreRoot (String s)
- {
- _objectStore = s;
- }
-
- /**
- * Whether to use the alternative abstract record ordering.
- * At present this is not fully documented, so stay away!
- *
- * @return <code>true</code> if order abstract records on type first, or
- * <code>false</code> if order on Uid first.
- */
-
-public static synchronized final boolean useAlternativeOrdering ()
- {
- return _useAltOrder;
- }
-
- /**
- * Set whether or not to use the alternative abstract record
- * ordering. Takes effect the next time ordering is required.
- */
-
-public static synchronized final void setAlternativeOrdering (boolean b)
- {
- _useAltOrder = b;
- }
-
- /**
- * 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("/arjuna.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 _objectStore = null;
-private static boolean _useAltOrder = false;
-private static String _propFile = getBuildTimeProperty("PROPERTIES_FILE");
-
-
-}
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryConfiguration.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryConfiguration.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryConfiguration.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,73 +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
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: RecoveryConfiguration.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.arjuna.recovery;
-
-import com.arjuna.ats.arjuna.common.Configuration;
-
-/**
- * This class contains various run-time configuration options. Default
- * values are provided at compile-time, and may be operating system
- * specific.
- *
- */
-public class RecoveryConfiguration
-{
-
- /**
- * @return the name of the RecoveryManager properties file to use.
- * @since JTS 2.1.
- */
- public static synchronized final String recoveryManagerPropertiesFile()
- {
- return _rmPropertyFile;
- }
-
- /**
- * Set the name of the RecoveryManager properties file.
- * @since JTS 2.1.
- */
-
- public static synchronized final void setRecoveryManagerPropertiesFile (String file)
- {
- _rmPropertyFile = file;
- }
-
- private static String _rmPropertyFile = Configuration.getBuildTimeProperty("RECOVERY_PROPERTIES_FILE") ;
-
- private RecoveryConfiguration()
- {
- // zero-ton class
- }
-}
-
-
-
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryEnvironment.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryEnvironment.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryEnvironment.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,55 +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) 1999-2001 by HP Bluestone Software, Inc. All rights Reserved.
- *
- * HP Arjuna Labs,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: RecoveryEnvironment.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.arjuna.recovery ;
-
-/**
- * Container for property names used by recovery
- * @deprecated use RecoveryEnvironmentBean instead.
- */
- at Deprecated
-public class RecoveryEnvironment
-{
- public static final String MODULE_PROPERTY_PREFIX = "com.arjuna.ats.arjuna.recovery.recoveryExtension" ;
- public static final String SCANNER_PROPERTY_PREFIX = "com.arjuna.ats.arjuna.recovery.expiryScanner" ;
- public static final String EXPIRY_SCAN_INTERVAL = "com.arjuna.ats.arjuna.recovery.expiryScanInterval" ;
- public static final String TRANSACTION_STATUS_MANAGER_EXPIRY_TIME =
- "com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime";
- public static final String TRANSACTION_EXPIRY_TIME =
- "com.arjuna.ats.arjuna.recovery.transactionExpiryTime";
- public static final String ACTIVATOR_PROPERTY_PREFIX = "com.arjuna.ats.arjuna.recovery.recoveryActivator" ;
-
- /** Not used */
-
- private RecoveryEnvironment()
- {
- }
-}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryManager.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryManager.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -40,9 +40,8 @@
import com.arjuna.ats.internal.arjuna.recovery.RecoveryManagerImple;
import com.arjuna.ats.arjuna.utils.Utility;
import com.arjuna.ats.arjuna.logging.tsLogger;
-import com.arjuna.ats.arjuna.exceptions.FatalError;
import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
-import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.ConfigurationInfo;
/**
* @message com.arjuna.ats.arjuna.recovery.RecoveryManager_1 [com.arjuna.ats.arjuna.recovery.RecoveryManager_1] - Invalid recovery manager port specified {0}
@@ -456,7 +455,7 @@
}
if (args[i].compareTo("-version") == 0)
{
- System.out.println("Version " + com.arjuna.ats.arjuna.common.Configuration.version());
+ System.out.println("Version " + ConfigurationInfo.getVersion());
System.exit(0);
}
if (args[i].compareTo("-test") == 0)
Deleted: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/report.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/report.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/report.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,47 +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,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: report.java 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.arjuna.tools;
-
-import com.arjuna.ats.arjuna.Info;
-import java.io.*;
-
-public class report
-{
-
-public static void main (String[] args)
- {
- Info i = new Info();
-
- System.out.println(i);
- }
-
-};
Modified: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/lockstore/BasicPersistentLockStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/lockstore/BasicPersistentLockStore.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/internal/txoj/lockstore/BasicPersistentLockStore.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -74,11 +74,8 @@
FacilityCode.FAC_LOCK_STORE, "BasicPersistentLockStore.BasicPersistentLockStore("+key+")");
}
- lockStoreLocation = txojPropertyManager.getTxojEnvironmentBean().getLockStoreDir();
- com.arjuna.ats.txoj.common.Configuration.setLockStoreRoot(lockStoreLocation);
+ _key = txojPropertyManager.getTxojEnvironmentBean().getLockStoreDir();
- _key = lockStoreLocation;
-
/*
* Use the ShadowingStore since it has file-level locking which
* we require. The default object store assumes locking is provided
Deleted: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/Info.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/Info.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/Info.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,64 +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: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.txoj;
-
-import java.util.Hashtable;
-
-import com.arjuna.ats.txoj.common.Configuration;
-
-/**
- * Module specific implementation of the interface object.
- *
- * @author Richard Begg (richard_begg at hp.com)
- * @version $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since HPTS 3.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("<lock-store-root>"+com.arjuna.ats.txoj.common.Configuration.lockStoreRoot()+"</lock-store-root>");
- moduleInfo.append("</configuration>");
- moduleInfo.append("</module-info>");
-
- return(moduleInfo.toString());
- }
-}
Deleted: labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/Configuration.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/Configuration.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaCore/txoj/classes/com/arjuna/ats/txoj/common/Configuration.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,147 +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.txoj.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;
- }
-
- /**
- * Used to get the root of the object store.
- *
- * @return <code>path</code> to lock store.
- */
-
-public static synchronized final String lockStoreRoot ()
- {
- if (_lockStore == null)
- /* Set default location under current directory */
- _lockStore = System.getProperty("user.dir") + File.separator + "LockStore";
-
-System.err.println("Returning lockstore location of: " + _lockStore);
- return _lockStore;
- }
-
- /**
- * Used to set the root of the lock store. Changes will
- * take effect the next time the root is queried. Existing
- * lock store instances will not be effected.
- */
-
-public static synchronized final void setLockStoreRoot (String s)
- {
- _lockStore = s;
- }
-
-public static final String version ()
- {
- return getBuildTimeProperty("TXOJ_VERSION") ;
- }
-
- /**
- * 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("/txoj.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") ;
-
-}
-
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/TransactionServer.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/TransactionServer.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/TransactionServer.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -31,15 +31,12 @@
package com.arjuna.ats.jts;
-import com.arjuna.ats.jts.common.jtsPropertyManager;
-
import com.arjuna.ats.internal.jts.ORBManager;
import com.arjuna.orbportability.*;
import com.arjuna.orbportability.common.opPropertyManager;
+import com.arjuna.common.util.ConfigurationInfo;
-import org.omg.CosTransactions.*;
-
public class TransactionServer
{
// TODO consider as a util class addition?
@@ -114,7 +111,7 @@
}
if (args[i].compareTo("-version") == 0)
{
- System.out.println("TransactionServer version "+com.arjuna.ats.jts.common.Configuration.version());
+ System.out.println("TransactionServer version "+ ConfigurationInfo.getVersion());
System.exit(0);
}
}
Deleted: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Configuration.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Configuration.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/jts/common/Configuration.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,107 +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: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.ats.jts.common;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * Build-time configuration information for the module.
- *
- * @author Mark Little (mark_little at hp.com)
- * @version $Id: Configuration.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since JTS 1.0.
- */
-
-public class Configuration
-{
-
- /**
- * @return the version of the module.
- */
-
-public static final String version ()
- {
- return getBuildTimeProperty("JTS_VERSION") ;
- }
-
- /**
- * @return the name of the module properties file to use.
- */
-
-
-
- /**
- * Get a build time property.
- * @param name The name of the build time property.
- * @return The build time property value.
- */
- private 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("/jts.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/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/Info.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/Info.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/Info.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,71 +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: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.orbportability;
-
-import com.arjuna.orbportability.common.Configuration;
-import com.arjuna.orbportability.Services;
-
-import java.io.*;
-import java.util.Hashtable;
-
-/**
- * Module specific implementation of the interface object.
- *
- * @author Richard Begg (richard_begg at hp.com)
- * @version $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since HPTS 3.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("<config-file>"+Configuration.configFile()+"</config-file>");
- moduleInfo.append("<config-file-root>"+Configuration.configFileRoot()+"</config-file-root>");
- moduleInfo.append("<properties-file dir=\""+Configuration.propertiesDir()+"\">"+Configuration.propertiesFile()+"</properties-file>");
- moduleInfo.append("<bind-default>"+Services.bindString(Configuration.bindDefault())+"</bind-default>");
- moduleInfo.append("<orb-info>"+com.arjuna.orbportability.ORBInfo.getInfo()+"</orb-info>");
- moduleInfo.append("</configuration>");
- moduleInfo.append("</module-info>");
-
- return(moduleInfo.toString());
- }
-}
Modified: labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBean.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -25,6 +25,8 @@
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
+import java.util.Properties;
/**
* A JavaBean containing assorted configuration properties for the Orb Portability layer.
@@ -34,8 +36,6 @@
@PropertyPrefix(prefix = "com.arjuna.orbportability.")
public class OrbPortabilityEnvironmentBean implements OrbPortabilityEnvironmentBeanMBean
{
- private volatile String propertiesFile = "";
-
private volatile String corbaDiagnostics = null; // key only
private volatile String initialReferencesRoot = com.arjuna.orbportability.common.Configuration.configFileRoot();
private volatile String initialReferencesFile = com.arjuna.orbportability.common.Configuration.configFile();
@@ -48,30 +48,9 @@
private volatile String orbImplementation = null;
private volatile String oaImplementation = null;
private volatile String bindMechanism = "CONFIGURATION_FILE";
- private volatile String defaultConfigurationFilename = null;
- /**
- * Returns the name of the properties file.
- *
- * Default: ""
- * Equivalent deprecated property: com.arjuna.orbportability.propertiesFile
- *
- * @return the name of the properties file
- */
- public String getPropertiesFile()
- {
- return propertiesFile;
- }
+ private volatile Properties orbInitializationProperties = new Properties();
- /**
- * Sets the name of the properties file.
- *
- * @param propertiesFile the name of the properties file.
- */
- public void setPropertiesFile(String propertiesFile)
- {
- this.propertiesFile = propertiesFile;
- }
/**
* Unused.
@@ -289,26 +268,32 @@
}
/**
- * Returns the default name for the configuration file.
+ * Returns the Properties used for the orb initialization parameters. As there are potentially
+ * an arbitrary number of ORBs, each with an arbitrary set of initialization classes, it's not
+ * well suited to bean based properties :-(
+ * The returned object is a clone. May return an empty Properties, will not return null.
*
- * Default: null
- * Equivalent deprecated property: com.arjuna.orbportability.defaultConfigurationFilename
+ * Default: empty Properties.
*
- * @deprecated I'm unused, remove me.
- * @return the default name of the configuration file.
+ * @return a Properties object containing ORB initialization information.
*/
- public String getDefaultConfigurationFilename()
+ public Properties getOrbInitializationProperties()
{
- return defaultConfigurationFilename;
+ return (Properties)orbInitializationProperties.clone();
}
/**
- * Sets the default name for the configuration file.
+ * Sets the Properties used for ORB initialization.
+ * The provided Properties will be cloned, not retained.
*
- * @param defaultConfigurationFilename the default name for the configuration file.
+ * @param orbInitializationProperties a Properties object containing ORB initialization information.
*/
- public void setDefaultConfigurationFilename(String defaultConfigurationFilename)
+ public void setOrbInitializationProperties(Properties orbInitializationProperties)
{
- this.defaultConfigurationFilename = defaultConfigurationFilename;
+ if(orbInitializationProperties == null) {
+ this.orbInitializationProperties = new Properties();
+ } else {
+ this.orbInitializationProperties = (Properties)orbInitializationProperties.clone();
+ }
}
}
Modified: labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBeanMBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBeanMBean.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/classes/com/arjuna/orbportability/common/OrbPortabilityEnvironmentBeanMBean.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -21,6 +21,7 @@
package com.arjuna.orbportability.common;
import java.util.List;
+import java.util.Properties;
/**
* A JMX MBean interface containing assorted configuration for the Orb Portability layer.
@@ -29,10 +30,6 @@
*/
public interface OrbPortabilityEnvironmentBeanMBean
{
- String getPropertiesFile();
-
- void setPropertiesFile(String propertiesFile);
-
String getCorbaDiagnostics();
void setCorbaDiagnostics(String corbaDiagnostics);
@@ -69,7 +66,7 @@
void setBindMechanism(String bindMechanism);
- String getDefaultConfigurationFilename();
+ public Properties getOrbInitializationProperties();
- void setDefaultConfigurationFilename(String defaultConfigurationFilename);
+ public void setOrbInitializationProperties(Properties orbInitializationProperties);
}
Deleted: labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/ArjunaJTS/orbportability/tests/classes/com/hp/mwtests/orbportability/initialisation/BeanPopulatorTest.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,59 +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.orbportability.initialisation;
-
-import com.arjuna.common.tests.simple.DummyProperties;
-import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
-import com.arjuna.orbportability.common.OrbPortabilityEnvironmentBean;
-import com.arjuna.orbportability.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 testOrbPortabilityPropertiesPopulation() 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(OrbPortabilityEnvironmentBean.class);
-
- BeanPopulator.configureFromProperties(new OrbPortabilityEnvironmentBean(), testProperties);
-
- Set<String> expectedKeys = new HashSet<String>();
- expectedKeys.addAll( DummyProperties.extractKeys(Environment.class));
-
- assertTrue( testProperties.usedKeys.containsAll(expectedKeys) );
- }
-}
Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/RecoveryManagerService.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/RecoveryManagerService.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/RecoveryManagerService.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -24,7 +24,7 @@
import com.arjuna.ats.arjuna.recovery.RecoveryModule;
import com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule;
import com.arjuna.ats.internal.jbossatx.jta.XAResourceRecoveryHelperWrapper;
-import com.arjuna.ats.arjuna.common.Configuration;
+import com.arjuna.common.util.ConfigurationInfo;
import org.jboss.logging.Logger;
import org.jboss.tm.XAResourceRecovery;
@@ -46,7 +46,7 @@
public void create() throws Exception
{
- String tag = Configuration.getBuildTimeProperty("SOURCEID");
+ String tag = ConfigurationInfo.getSourceId();
log.info("JBossTS Recovery Service (tag:"+tag+") - JBoss Inc.");
Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -34,7 +34,7 @@
import org.jboss.logging.Logger;
import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
-import com.arjuna.ats.arjuna.common.Configuration;
+import com.arjuna.common.util.ConfigurationInfo;
import javax.transaction.TransactionManager;
import javax.transaction.UserTransaction;
@@ -60,9 +60,7 @@
public void create() throws Exception
{
- // Note that we use the arjunacore version of Configuration, as the jta one does not have
- // build properties set when we are running from the jts version of the build.
- String tag = Configuration.getBuildTimeProperty("SOURCEID");
+ String tag = ConfigurationInfo.getSourceId();
log.info("JBossTS Transaction Service ("+mode+" version - tag:"+tag+") - JBoss Inc.");
Deleted: labs/jbosstm/trunk/common/classes/com/arjuna/common/Info.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/Info.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/Info.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,98 +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,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- */
-
-package com.arjuna.common;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Hashtable;
-import java.util.Properties;
-
-/**
- * Module specific implementation of the interface object.
- *
- * @author Richard Begg (richard_begg at hp.com)
- * @version $Id: Info.javatmpl 2342 2006-03-30 13:06:17Z $
- * @since HPTS 3.0
- */
-public class Info
-{
- public String toString()
- {
- StringBuffer moduleInfo = new StringBuffer();
-
- moduleInfo.append("<module-info name=\"" + getBuildTimeProperty("MODULE") + "\">");
- moduleInfo.append("<source-identifier>" + getBuildTimeProperty("SOURCEID") + "</source-identifier>");
- moduleInfo.append("<build-information>" + getBuildTimeProperty("BUILDINFO") + "</build-information>");
- moduleInfo.append("<version>" + getBuildTimeProperty("VERSION") + "</version>");
- moduleInfo.append("<date>" + getBuildTimeProperty("DATE") + "</date>");
- moduleInfo.append("<notes>" + getBuildTimeProperty("NOTES") + "</notes>");
- moduleInfo.append("</module-info>");
-
- return(moduleInfo.toString());
- }
-
- private static String getBuildTimeProperty(final String name)
- {
- if (PROPS == null)
- {
- return "" ;
- }
- else
- {
- return PROPS.getProperty(name, "") ;
- }
- }
-
- private static final Properties PROPS ;
-
- static
- {
- final InputStream is = Info.class.getResourceAsStream("/common.properties") ;
- if (is != null)
- {
- Properties props = new Properties() ;
- try
- {
- props.load(is) ;
- }
- catch (final IOException ioe)
- {
- props = null ;
- }
- PROPS = props ;
- }
- else
- {
- PROPS = null ;
- }
- }
-}
Deleted: labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Configuration.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Configuration.java 2009-10-21 11:40:06 UTC (rev 29713)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/internal/util/logging/Configuration.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -1,83 +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.
- */
-package com.arjuna.common.internal.util.logging;
-
-
-/**
- * This class contains various run-time configuration options. Default
- * values are provided at compile-time, and may be operating system
- * specific.
- *
- * @author Malik SAHEB - malik.saheb at arjuna.com
- */
-
-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;
- }
-
- /**
- * @return the location of the module properties file to use.
- */
-
- public static synchronized final String propertiesDir()
- {
- return _propDir;
- }
-
- /**
- * Set the location of the properties file.
- */
-
- public static synchronized final void setPropertiesDir(String file)
- {
- _propDir = file;
- }
-
- /**
- * @return the version of arjuna.
- */
-
- public static final String version()
- {
- return "1.0.0";
- }
-
- private static String _propFile = "CommonLogging-properties.xml";
- private static String _propDir = ".";
-}
-
Added: labs/jbosstm/trunk/common/classes/com/arjuna/common/util/ConfigurationInfo.java
===================================================================
--- labs/jbosstm/trunk/common/classes/com/arjuna/common/util/ConfigurationInfo.java (rev 0)
+++ labs/jbosstm/trunk/common/classes/com/arjuna/common/util/ConfigurationInfo.java 2009-10-21 11:57:56 UTC (rev 29714)
@@ -0,0 +1,51 @@
+/*
+ * 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.arjuna.common.util;
+
+import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
+
+/**
+ * Utility class providing access to build time and runtime configuration reporting functions.
+ *
+ * Replaces the old per-module Info (and in some cases Configuration and report) classes.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com) 2009-10
+ */
+public class ConfigurationInfo
+{
+ public static String getVersion() {
+ return "unknown";
+ }
+
+ public static String getSourceId() {
+ return "unknown"; // .getBuildTimeProperty("SOURCEID");
+ }
+
+ public static void main (String[] args)
+ {
+ // build time info:
+ System.out.println("Version: "+getVersion());
+ System.out.println("SourceId: "+getSourceId());
+ // run time info (probably empty as beans only load on demand):
+ String beans = BeanPopulator.printState();
+ System.out.print(beans);
+ }
+}
More information about the jboss-svn-commits
mailing list