[jboss-svn-commits] JBL Code SVN: r28571 - in labs/jbosstm/trunk: ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna and 29 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jul 29 10:02:34 EDT 2009
Author: jhalliday
Date: 2009-07-29 10:02:33 -0400 (Wed, 29 Jul 2009)
New Revision: 28571
Added:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoordinatorEnvironmentBean.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/ObjectStoreEnvironmentBean.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/build.xml
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/PersistenceRecord.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/arjPropertyManager.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/recoveryPropertyManager.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStoreImple.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryManager.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/TransactionStatusManager.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/OTM.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/ActionStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/CacheStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/FileSystemStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedActionStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCActionStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCImple.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/LogStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/NullActionStore.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/jdbc/accessors/accessor.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredEntryMonitor.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredTransactionStatusManagerScanner.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/Listener.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecoveryManagerImple.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/FileProcessId.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/ManualProcessId.java
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/SocketProcessId.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/CheckedActionTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/JDBCInventory.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest2.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest2.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest2.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest2.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/ObjectStoreTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/performance/Performance2.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/CallbackRecoveryTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/EmbeddedRecoveryTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/LogMoveTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryLifecycleTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java
labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/TestBase.java
labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/perfgraph/PerformanceGraph.java
labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java
labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/mbeans/PerformanceStatistics.java
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/lastresource/LastResourceAllowedTestCase.java
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/CrashRecovery.java
labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/RecoveryManagerTest.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java
labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/transactions/ExpiredAssumedCompleteScanner.java
labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java
labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java
labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java
labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java
labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java
Log:
Convert config property handling in ArjunaCore from property manager to the new bean style. JBTM-596
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/build.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/build.xml 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/build.xml 2009-07-29 14:02:33 UTC (rev 28571)
@@ -27,6 +27,7 @@
<target name="init" depends="sharedbuild.init">
<import-module.macro module="common"/>
+ <import-module.macro module="common_tests"/>
</target>
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/LastResourceRecord.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -301,10 +301,7 @@
static
{
- final String allowMultipleLastResources = arjPropertyManager
- .getPropertyManager().getProperty(Environment.ALLOW_MULTIPLE_LAST_RESOURCES);
- ALLOW_MULTIPLE_LAST_RESOURCES = (allowMultipleLastResources == null ? false
- : Boolean.valueOf(allowMultipleLastResources).booleanValue());
+ ALLOW_MULTIPLE_LAST_RESOURCES = arjPropertyManager.getCoreEnvironmentBean().isAllowMultipleLastResources();
if (ALLOW_MULTIPLE_LAST_RESOURCES
&& tsLogger.arjLoggerI18N.isWarnEnabled())
@@ -312,9 +309,9 @@
tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.lastResource.startupWarning");
}
- String disableMLRW = arjPropertyManager.getPropertyManager().getProperty(Environment.DISABLE_MULTIPLE_LAST_RESOURCES_WARNING, "false");
+ _disableMLRWarning = arjPropertyManager.getCoreEnvironmentBean().isDisableMultipleLastResourcesWarning();
- if ("true".equalsIgnoreCase(disableMLRW))
+ if(arjPropertyManager.getCoreEnvironmentBean().isDisableMultipleLastResourcesWarning())
{
tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.lastResource.disableWarning");
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/PersistenceRecord.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/PersistenceRecord.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/PersistenceRecord.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -628,22 +628,8 @@
static
{
- String cp = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CLASSIC_PREPARE);
+ classicPrepare = arjPropertyManager.getCoordinatorEnvironmentBean().isClassicPrepare();
- if (cp != null)
- {
- if (cp.equals("YES"))
- classicPrepare = true;
- }
-
- String wo = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_LOG_WRITE_OPTIMISATION);
-
- if (wo != null)
- {
- if (wo.equals("YES"))
- {
- writeOptimisation = true;
- }
- }
+ writeOptimisation = arjPropertyManager.getCoordinatorEnvironmentBean().isWriteOptimisation();
}
}
Added: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoordinatorEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoordinatorEnvironmentBean.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoordinatorEnvironmentBean.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -0,0 +1,314 @@
+/*
+ * 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.ats.arjuna.common;
+
+import com.arjuna.common.internal.util.propertyservice.PropertyPrefix;
+import com.arjuna.common.internal.util.propertyservice.FullPropertyName;
+import com.arjuna.ats.arjuna.ArjunaNames;
+import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
+
+/**
+ * A JavaBean containing configuration properties for the core transaction coordinator.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+ at PropertyPrefix(prefix = "com.arjuna.ats.arjuna.coordinator.")
+public class CoordinatorEnvironmentBean
+{
+ private String actionStore = ArjunaNames.Implementation_ObjectStore_defaultActionStore().stringForm();
+ private boolean asyncCommit = false;
+ private boolean asyncPrepare = false;
+ private boolean asyncRollback = false;
+ private boolean commitOnePhase = true;
+ private boolean maintainHeuristics = true;
+ private boolean transactionLog = false; // rename to useTransactionLog ?
+
+ // public static final String TRANSACTION_LOG_REMOVAL_MARKER = "com.arjuna.ats.arjuna.coordinator.transactionLog.removalMarker";
+ //private String removalMarker;
+
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation")
+ private boolean writeOptimisation = false;
+
+ private boolean readonlyOptimisation = true;
+ private boolean classicPrepare = false;
+ private boolean enableStatistics = false;
+ private boolean sharedTransactionLog = false;
+ private boolean startDisabled = false; // rename/repurpose to 'enable'?
+ private String txReaperMode = "DYNAMIC"; // rename bool txReaperModeDynamic?
+
+ private long txReaperTimeout = TransactionReaper.defaultCheckPeriod;
+ private long txReaperCancelWaitPeriod = TransactionReaper.defaultCancelWaitPeriod;
+ private long txReaperCancelFailWaitPeriod = TransactionReaper.defaultCancelFailWaitPeriod;
+ private int txReaperZombieMax = TransactionReaper.defaultZombieMax;
+
+ private int defaultTimeout = 60; // seconds
+ private boolean transactionStatusManagerEnable = true;
+
+ @FullPropertyName(name = "com.arjuna.ats.coordinator.beforeCompletionWhenRollbackOnly")
+ private boolean beforeCompletionWhenRollbackOnly = false;
+ @FullPropertyName(name = "com.arjuna.ats.coordinator.checkedActionFactory")
+ private String checkedActionFactory = null;
+
+
+ // public static final String ACTION_STORE= "com.arjuna.ats.arjuna.coordinator.actionStore";
+ public String getActionStore()
+ {
+ return actionStore;
+ }
+
+ public void setActionStore(String actionStore)
+ {
+ this.actionStore = actionStore;
+ }
+
+// public static final String ASYNC_COMMIT = "com.arjuna.ats.arjuna.coordinator.asyncCommit";
+ public boolean isAsyncCommit()
+ {
+ return asyncCommit;
+ }
+
+ public void setAsyncCommit(boolean asyncCommit)
+ {
+ this.asyncCommit = asyncCommit;
+ }
+
+// public static final String ASYNC_PREPARE = "com.arjuna.ats.arjuna.coordinator.asyncPrepare";
+ public boolean isAsyncPrepare()
+ {
+ return asyncPrepare;
+ }
+
+ public void setAsyncPrepare(boolean asyncPrepare)
+ {
+ this.asyncPrepare = asyncPrepare;
+ }
+
+// public static final String ASYNC_ROLLBACK = "com.arjuna.ats.arjuna.coordinator.asyncRollback";
+ public boolean isAsyncRollback()
+ {
+ return asyncRollback;
+ }
+
+ public void setAsyncRollback(boolean asyncRollback)
+ {
+ this.asyncRollback = asyncRollback;
+ }
+
+// public static final String COMMIT_ONE_PHASE = "com.arjuna.ats.arjuna.coordinator.commitOnePhase";
+ public boolean isCommitOnePhase()
+ {
+ return commitOnePhase;
+ }
+
+ public void setCommitOnePhase(boolean commitOnePhase)
+ {
+ this.commitOnePhase = commitOnePhase;
+ }
+
+// public static final String MAINTAIN_HEURISTICS = "com.arjuna.ats.arjuna.coordinator.maintainHeuristics";
+ public boolean isMaintainHeuristics()
+ {
+ return maintainHeuristics;
+ }
+
+ public void setMaintainHeuristics(boolean maintainHeuristics)
+ {
+ this.maintainHeuristics = maintainHeuristics;
+ }
+
+// public static final String TRANSACTION_LOG = "com.arjuna.ats.arjuna.coordinator.transactionLog";
+ public boolean isTransactionLog()
+ {
+ return transactionLog;
+ }
+
+ public void setTransactionLog(boolean transactionLog)
+ {
+ this.transactionLog = transactionLog;
+ }
+
+
+
+// public static final String TRANSACTION_LOG_WRITE_OPTIMISATION = "com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation";
+ public boolean isWriteOptimisation()
+ {
+ return writeOptimisation;
+ }
+
+ public void setWriteOptimisation(boolean writeOptimisation)
+ {
+ this.writeOptimisation = writeOptimisation;
+ }
+
+// public static final String READONLY_OPTIMISATION = "com.arjuna.ats.arjuna.coordinator.readonlyOptimisation";
+ public boolean isReadonlyOptimisation()
+ {
+ return readonlyOptimisation;
+ }
+
+ public void setReadonlyOptimisation(boolean readonlyOptimisation)
+ {
+ this.readonlyOptimisation = readonlyOptimisation;
+ }
+
+// public static final String CLASSIC_PREPARE = "com.arjuna.ats.arjuna.coordinator.classicPrepare";
+ public boolean isClassicPrepare()
+ {
+ return classicPrepare;
+ }
+
+ public void setClassicPrepare(boolean classicPrepare)
+ {
+ this.classicPrepare = classicPrepare;
+ }
+
+// public static final String ENABLE_STATISTICS = "com.arjuna.ats.arjuna.coordinator.enableStatistics";
+ public boolean isEnableStatistics()
+ {
+ return enableStatistics;
+ }
+
+ public void setEnableStatistics(boolean enableStatistics)
+ {
+ this.enableStatistics = enableStatistics;
+ }
+
+// public static final String SHARED_TRANSACTION_LOG = "com.arjuna.ats.arjuna.coordinator.sharedTransactionLog";
+ public boolean isSharedTransactionLog()
+ {
+ return sharedTransactionLog;
+ }
+
+ public void setSharedTransactionLog(boolean sharedTransactionLog)
+ {
+ this.sharedTransactionLog = sharedTransactionLog;
+ }
+
+// public static final String START_DISABLED = "com.arjuna.ats.arjuna.coordinator.startDisabled";
+ public boolean isStartDisabled()
+ {
+ return startDisabled;
+ }
+
+ public void setStartDisabled(boolean startDisabled)
+ {
+ this.startDisabled = startDisabled;
+ }
+
+// public static final String TX_REAPER_MODE = "com.arjuna.ats.arjuna.coordinator.txReaperMode";
+ public String getTxReaperMode()
+ {
+ return txReaperMode;
+ }
+
+ public void setTxReaperMode(String txReaperMode)
+ {
+ this.txReaperMode = txReaperMode;
+ }
+
+// public static final String TX_REAPER_TIMEOUT = "com.arjuna.ats.arjuna.coordinator.txReaperTimeout";
+ public long getTxReaperTimeout()
+ {
+ return txReaperTimeout;
+ }
+
+ public void setTxReaperTimeout(long txReaperTimeout)
+ {
+ this.txReaperTimeout = txReaperTimeout;
+ }
+
+// public static final String TX_REAPER_CANCEL_WAIT_PERIOD = "com.arjuna.ats.arjuna.coordinator.txReaperCancelWaitPeriod";
+ public long getTxReaperCancelWaitPeriod()
+ {
+ return txReaperCancelWaitPeriod;
+ }
+
+ public void setTxReaperCancelWaitPeriod(long txReaperCancelWaitPeriod)
+ {
+ this.txReaperCancelWaitPeriod = txReaperCancelWaitPeriod;
+ }
+
+// public static final String TX_REAPER_CANCEL_FAIL_WAIT_PERIOD = "com.arjuna.ats.arjuna.coordinator.txReaperCancelFailWaitPeriod";
+ public long getTxReaperCancelFailWaitPeriod()
+ {
+ return txReaperCancelFailWaitPeriod;
+ }
+
+ public void setTxReaperCancelFailWaitPeriod(long txReaperCancelFailWaitPeriod)
+ {
+ this.txReaperCancelFailWaitPeriod = txReaperCancelFailWaitPeriod;
+ }
+
+// public static final String TX_REAPER_ZOMBIE_MAX = "com.arjuna.ats.arjuna.coordinator.txReaperZombieMax";
+ public int getTxReaperZombieMax()
+ {
+ return txReaperZombieMax;
+ }
+
+ public void setTxReaperZombieMax(int txReaperZombieMax)
+ {
+ this.txReaperZombieMax = txReaperZombieMax;
+ }
+
+// public static final String DEFAULT_TIMEOUT = "com.arjuna.ats.arjuna.coordinator.defaultTimeout";
+ public int getDefaultTimeout()
+ {
+ return defaultTimeout;
+ }
+
+ public void setDefaultTimeout(int defaultTimeout)
+ {
+ this.defaultTimeout = defaultTimeout;
+ }
+
+// public static final String TRANSACTION_STATUS_MANAGER_ENABLE = "com.arjuna.ats.arjuna.coordinator.transactionStatusManagerEnable";
+ public boolean isTransactionStatusManagerEnable()
+ {
+ return transactionStatusManagerEnable;
+ }
+
+ public void setTransactionStatusManagerEnable(boolean transactionStatusManagerEnable)
+ {
+ this.transactionStatusManagerEnable = transactionStatusManagerEnable;
+ }
+
+// public static final String BEFORECOMPLETION_WHEN_ROLLBACKONLY = "com.arjuna.ats.coordinator.beforeCompletionWhenRollbackOnly";
+ public boolean isBeforeCompletionWhenRollbackOnly()
+ {
+ return beforeCompletionWhenRollbackOnly;
+ }
+
+ public void setBeforeCompletionWhenRollbackOnly(boolean beforeCompletionWhenRollbackOnly)
+ {
+ this.beforeCompletionWhenRollbackOnly = beforeCompletionWhenRollbackOnly;
+ }
+
+// public static final String CHECKEDACTION_FACTORY = "com.arjuna.ats.coordinator.checkedActionFactory";
+ public String getCheckedActionFactory()
+ {
+ return checkedActionFactory;
+ }
+
+ public void setCheckedActionFactory(String checkedActionFactory)
+ {
+ this.checkedActionFactory = checkedActionFactory;
+ }
+}
Added: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/CoreEnvironmentBean.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -0,0 +1,153 @@
+/*
+ * 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.ats.arjuna.common;
+
+import com.arjuna.common.internal.util.propertyservice.PropertyPrefix;
+import com.arjuna.common.internal.util.propertyservice.FullPropertyName;
+import com.arjuna.ats.arjuna.utils.Utility;
+
+/**
+ * A JavaBean containing assorted configuration properties for the core transaction system.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+ at PropertyPrefix(prefix = "com.arjuna.ats.arjuna.")
+public class CoreEnvironmentBean
+{
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.common.propertiesFile")
+ private String propertiesFile = "";
+
+// @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.inventory.staticInventoryImple")
+// private String staticInventoryImple;
+
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.common.varDir")
+ private String varDir = null;
+
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.xa.nodeIdentifier")
+ private String nodeIdentifier = null;
+
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.utils.SocketProcessIdPort")
+ private int socketProcessIdPort = 0;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.utils.SocketProcessIdMaxPorts")
+ private int socketProcessIdMaxPorts = 1;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.utils.processImplementation")
+ private String processImplementation = Utility.defaultProcessId;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.utils.pid")
+ private int pid = -1;
+
+ private boolean allowMultipleLastResources = false;
+ private boolean disableMultipleLastResourcesWarning = false;
+
+// @FullPropertyName(name = "jbossts.bind.address")
+// private String bindAddress;
+
+
+ public String getPropertiesFile()
+ {
+ return propertiesFile;
+ }
+
+ public void setPropertiesFile(String propertiesFile)
+ {
+ this.propertiesFile = propertiesFile;
+ }
+
+ public String getVarDir()
+ {
+ return varDir;
+ }
+
+ public void setVarDir(String varDir)
+ {
+ this.varDir = varDir;
+ }
+
+ public String getNodeIdentifier()
+ {
+ return nodeIdentifier;
+ }
+
+ public void setNodeIdentifier(String nodeIdentifier)
+ {
+ this.nodeIdentifier = nodeIdentifier;
+ }
+
+ public int getSocketProcessIdPort()
+ {
+ return socketProcessIdPort;
+ }
+
+ public void setSocketProcessIdPort(int socketProcessIdPort)
+ {
+ Utility.validatePortRange(socketProcessIdPort);
+ this.socketProcessIdPort = socketProcessIdPort;
+ }
+
+ public int getSocketProcessIdMaxPorts()
+ {
+ return socketProcessIdMaxPorts;
+ }
+
+ public void setSocketProcessIdMaxPorts(int socketProcessIdMaxPorts)
+ {
+ this.socketProcessIdMaxPorts = socketProcessIdMaxPorts;
+ }
+
+ public String getProcessImplementation()
+ {
+ return processImplementation;
+ }
+
+ public void setProcessImplementation(String processImplementation)
+ {
+ this.processImplementation = processImplementation;
+ }
+
+ public int getPid()
+ {
+ return pid;
+ }
+
+ public void setPid(int pid)
+ {
+ this.pid = pid;
+ }
+
+ public boolean isAllowMultipleLastResources()
+ {
+ return allowMultipleLastResources;
+ }
+
+ public void setAllowMultipleLastResources(boolean allowMultipleLastResources)
+ {
+ this.allowMultipleLastResources = allowMultipleLastResources;
+ }
+
+ public boolean isDisableMultipleLastResourcesWarning()
+ {
+ return disableMultipleLastResourcesWarning;
+ }
+
+ public void setDisableMultipleLastResourcesWarning(boolean disableMultipleLastResourcesWarning)
+ {
+ this.disableMultipleLastResourcesWarning = disableMultipleLastResourcesWarning;
+ }
+}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/Environment.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -112,7 +112,7 @@
public static final String TRANSACTION_LOG_SYNC_REMOVAL = "com.arjuna.ats.arjuna.coordinator.transactionLog.synchronousRemoval";
public static final String TRANSACTION_LOG_SIZE = "com.arjuna.ats.arjuna.coordinator.transactionLog.size";
public static final String TRANSACTION_LOG_PURGE_TIME = "com.arjuna.ats.arjuna.coordinator.transactionLog.purgeTime";
- public static final String TRANSACTION_LOG_REMOVAL_MARKER = "com.arjuna.ats.arjuna.coordinator.transactionLog.removalMarker";
+ @Deprecated public static final String TRANSACTION_LOG_REMOVAL_MARKER = "com.arjuna.ats.arjuna.coordinator.transactionLog.removalMarker";
public static final String TRANSACTION_LOG_WRITE_OPTIMISATION = "com.arjuna.ats.arjuna.coordinator.transactionLog.writeOptimisation";
public static final String TRANSACTION_SYNC = "com.arjuna.ats.arjuna.objectstore.transactionSync";
public static final String READONLY_OPTIMISATION = "com.arjuna.ats.arjuna.coordinator.readonlyOptimisation";
@@ -125,7 +125,7 @@
public static final String JDBC_POOL_SIZE_INIT = "com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeInitial";
public static final String JDBC_POOL_SIZE_MAX = "com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeMaximum";
public static final String JDBC_POOL_PUT = "com.arjuna.ats.arjuna.objectstore.jdbcPoolPutConnections";
- public static final String LICENCE = "com.arjuna.ats.arjuna.licence";
+ @Deprecated public static final String LICENCE = "com.arjuna.ats.arjuna.licence";
public static final String CACHE_STORE_SIZE = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size";
public static final String CACHE_STORE_SYNC = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.sync";
public static final String CACHE_STORE_REMOVED_ITEMS = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.removedItems";
@@ -165,6 +165,11 @@
* for specifying the bind address for transaction services
*
*/
- public static final String SERVER_BIND_ADDRESS = "jbossts.bind.address";
+ @Deprecated public static final String SERVER_BIND_ADDRESS = "jbossts.bind.address";
+
+
+ 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 TIMEOUT_RECOVERY_SOCKET = "com.arjuna.ats.internal.arjuna.recovery.listener.timeoutsocket";
}
Added: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/ObjectStoreEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/ObjectStoreEnvironmentBean.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/ObjectStoreEnvironmentBean.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -0,0 +1,330 @@
+/*
+ * 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.ats.arjuna.common;
+
+import com.arjuna.ats.arjuna.objectstore.ObjectStore;
+import com.arjuna.ats.arjuna.ArjunaNames;
+import com.arjuna.ats.internal.arjuna.objectstore.HashedStore;
+import com.arjuna.common.internal.util.propertyservice.FullPropertyName;
+import com.arjuna.common.internal.util.propertyservice.PropertyPrefix;
+
+import java.io.File;
+
+/**
+ * A JavaBean containing configuration properties for the objectstore and various implementations thereof.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+ at PropertyPrefix(prefix = "com.arjuna.ats.arjuna.objectstore.")
+public class ObjectStoreEnvironmentBean
+{
+ private String localOSRoot = "defaultStore";
+ private String objectStoreDir = System.getProperty("user.dir") + File.separator + "ObjectStore";
+ private boolean objectStoreSync = true;
+ private String objectStoreType = ArjunaNames.Implementation_ObjectStore_defaultStore().stringForm();
+ private int hashedDirectories = HashedStore.DEFAULT_NUMBER_DIRECTORIES;
+ private boolean transactionSync = true;
+
+ private String jdbcUserDbAccess = null;
+ private String jdbcTxDbAccess = null;
+ private int jdbcPoolSizeInitial = 1;
+ private int jdbcPoolSizeMaximum = 1;
+ private boolean jdbcPoolPutConnections = false;
+
+ private int share = ObjectStore.OS_UNKNOWN;
+ private int hierarchyRetry = 100;
+ private int hierarchyTimeout = 100;
+
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size")
+ private int cacheStoreSize = 10240; // size in bytes
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.sync")
+ private boolean cacheStoreSync = false;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.removedItems")
+ private int cacheStoreRemovedItems = 256;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.scanPeriod")
+ private int cacheStoreScanPeriod = 120000;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.workItems")
+ private int cacheStoreWorkItems = 100;
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.hash")
+ private int cacheStoreHash = 128;
+
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.coordinator.transactionLog.synchronousRemoval")
+ private boolean synchronousRemoval = true;
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.coordinator.transactionLog.size")
+ private long txLogSize = 10 * 1024 * 1024; // default maximum log txLogSize in bytes;
+ @FullPropertyName(name = "com.arjuna.ats.arjuna.coordinator.transactionLog.purgeTime")
+ private long purgeTime = 100000; // in milliseconds
+
+
+// public static final String CACHE_STORE_SIZE = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.size";
+ public int getCacheStoreSize()
+ {
+ return cacheStoreSize;
+ }
+
+ public void setCacheStoreSize(int cacheStoreSize)
+ {
+ this.cacheStoreSize = cacheStoreSize;
+ }
+
+// public static final String CACHE_STORE_SYNC = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.sync";
+ public boolean isCacheStoreSync()
+ {
+ return cacheStoreSync;
+ }
+
+ public void setCacheStoreSync(boolean cacheStoreSync)
+ {
+ this.cacheStoreSync = cacheStoreSync;
+ }
+
+// public static final String CACHE_STORE_REMOVED_ITEMS = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.removedItems";
+ public int getCacheStoreRemovedItems()
+ {
+ return cacheStoreRemovedItems;
+ }
+
+ public void setCacheStoreRemovedItems(int cacheStoreRemovedItems)
+ {
+ this.cacheStoreRemovedItems = cacheStoreRemovedItems;
+ }
+
+// public static final String CACHE_STORE_SCAN_PERIOD = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.scanPeriod";
+ public int getCacheStoreScanPeriod()
+ {
+ return cacheStoreScanPeriod;
+ }
+
+ public void setCacheStoreScanPeriod(int cacheStoreScanPeriod)
+ {
+ this.cacheStoreScanPeriod = cacheStoreScanPeriod;
+ }
+
+// public static final String CACHE_STORE_WORK_ITEMS = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.workItems";
+ public int getCacheStoreWorkItems()
+ {
+ return cacheStoreWorkItems;
+ }
+
+ public void setCacheStoreWorkItems(int cacheStoreWorkItems)
+ {
+ this.cacheStoreWorkItems = cacheStoreWorkItems;
+ }
+
+// public static final String CACHE_STORE_HASH = "com.arjuna.ats.internal.arjuna.objectstore.cacheStore.hash";
+ public int getCacheStoreHash()
+ {
+ return cacheStoreHash;
+ }
+
+ public void setCacheStoreHash(int cacheStoreHash)
+ {
+ this.cacheStoreHash = cacheStoreHash;
+ }
+////////////////////////////////////
+
+// public static final String LOCALOSROOT = "com.arjuna.ats.arjuna.objectstore.localOSRoot";
+ public String getLocalOSRoot()
+ {
+ return localOSRoot;
+ }
+
+ public void setLocalOSRoot(String localOSRoot)
+ {
+ this.localOSRoot = localOSRoot;
+ }
+
+// public static final String OBJECTSTORE_DIR = "com.arjuna.ats.arjuna.objectstore.objectStoreDir";
+ public String getObjectStoreDir()
+ {
+ return objectStoreDir;
+ }
+
+ public void setObjectStoreDir(String objectStoreDir)
+ {
+ this.objectStoreDir = objectStoreDir;
+ }
+
+// public static final String OBJECTSTORE_SYNC = "com.arjuna.ats.arjuna.objectstore.objectStoreSync";
+ public boolean isObjectStoreSync()
+ {
+ return objectStoreSync;
+ }
+
+ public void setObjectStoreSync(boolean objectStoreSync)
+ {
+ this.objectStoreSync = objectStoreSync;
+ }
+
+// public static final String OBJECTSTORE_TYPE = "com.arjuna.ats.arjuna.objectstore.objectStoreType";
+ public String getObjectStoreType()
+ {
+ return objectStoreType;
+ }
+
+ public void setObjectStoreType(String objectStoreType)
+ {
+ this.objectStoreType = objectStoreType;
+ }
+
+// public static final String HASHED_DIRECTORIES = "com.arjuna.ats.arjuna.objectstore.hashedDirectories";
+ public int getHashedDirectories()
+ {
+ return hashedDirectories;
+ }
+
+ public void setHashedDirectories(int hashedDirectories)
+ {
+ this.hashedDirectories = hashedDirectories;
+ }
+
+// public static final String TRANSACTION_SYNC = "com.arjuna.ats.arjuna.objectstore.transactionSync";
+ public boolean isTransactionSync()
+ {
+ return transactionSync;
+ }
+
+ public void setTransactionSync(boolean transactionSync)
+ {
+ this.transactionSync = transactionSync;
+ }
+
+// public static final String JDBC_USER_DB_ACCESS = "com.arjuna.ats.arjuna.objectstore.jdbcUserDbAccess";
+ public String getJdbcUserDbAccess()
+ {
+ return jdbcUserDbAccess;
+ }
+
+ public void setJdbcUserDbAccess(String jdbcUserDbAccess)
+ {
+ this.jdbcUserDbAccess = jdbcUserDbAccess;
+ }
+
+// public static final String JDBC_TX_DB_ACCESS = "com.arjuna.ats.arjuna.objectstore.jdbcTxDbAccess";
+ public String getJdbcTxDbAccess()
+ {
+ return jdbcTxDbAccess;
+ }
+
+ public void setJdbcTxDbAccess(String jdbcTxDbAccess)
+ {
+ this.jdbcTxDbAccess = jdbcTxDbAccess;
+ }
+
+// public static final String JDBC_POOL_SIZE_INIT = "com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeInitial";
+ public int getJdbcPoolSizeInitial()
+ {
+ return jdbcPoolSizeInitial;
+ }
+
+ public void setJdbcPoolSizeInitial(int jdbcPoolSizeInitial)
+ {
+ this.jdbcPoolSizeInitial = jdbcPoolSizeInitial;
+ }
+
+// public static final String JDBC_POOL_SIZE_MAX = "com.arjuna.ats.arjuna.objectstore.jdbcPoolSizeMaximum";
+ public int getJdbcPoolSizeMaximum()
+ {
+ return jdbcPoolSizeMaximum;
+ }
+
+ public void setJdbcPoolSizeMaximum(int jdbcPoolSizeMaximum)
+ {
+ this.jdbcPoolSizeMaximum = jdbcPoolSizeMaximum;
+ }
+
+// public static final String JDBC_POOL_PUT = "com.arjuna.ats.arjuna.objectstore.jdbcPoolPutConnections";
+ public boolean isJdbcPoolPutConnections()
+ {
+ return jdbcPoolPutConnections;
+ }
+
+ public void setJdbcPoolPutConnections(boolean jdbcPoolPutConnections)
+ {
+ this.jdbcPoolPutConnections = jdbcPoolPutConnections;
+ }
+
+// public static final String OBJECTSTORE_SHARE = "com.arjuna.ats.arjuna.objectstore.share";
+ public int getShare()
+ {
+ return share;
+ }
+
+ public void setShare(int share)
+ {
+ this.share = share;
+ }
+
+// public static final String OBJECTSTORE_HIERARCHY_RETRY = "com.arjuna.ats.arjuna.objectstore.hierarchyRetry";
+ public int getHierarchyRetry()
+ {
+ return hierarchyRetry;
+ }
+
+ public void setHierarchyRetry(int hierarchyRetry)
+ {
+ this.hierarchyRetry = hierarchyRetry;
+ }
+
+// public static final String OBJECTSTORE_HIERARCHY_TIMEOUT = "com.arjuna.ats.arjuna.objectstore.hierarchyTimeout";
+ public int getHierarchyTimeout()
+ {
+ return hierarchyTimeout;
+ }
+
+ public void setHierarchyTimeout(int hierarchyTimeout)
+ {
+ this.hierarchyTimeout = hierarchyTimeout;
+ }
+
+ // public static final String TRANSACTION_LOG_SYNC_REMOVAL = "com.arjuna.ats.arjuna.coordinator.transactionLog.synchronousRemoval";
+ public boolean isSynchronousRemoval()
+ {
+ return synchronousRemoval;
+ }
+
+ public void setSynchronousRemoval(boolean synchronousRemoval)
+ {
+ this.synchronousRemoval = synchronousRemoval;
+ }
+
+// public static final String TRANSACTION_LOG_SIZE = "com.arjuna.ats.arjuna.coordinator.transactionLog.txLogSize";
+ public long getTxLogSize()
+ {
+ return txLogSize;
+ }
+
+ public void setTxLogSize(long txLogSize)
+ {
+ this.txLogSize = txLogSize;
+ }
+
+// public static final String TRANSACTION_LOG_PURGE_TIME = "com.arjuna.ats.arjuna.coordinator.transactionLog.purgeTime";
+ public long getPurgeTime()
+ {
+ return purgeTime;
+ }
+
+ public void setPurgeTime(long purgeTime)
+ {
+ this.purgeTime = purgeTime;
+ }
+}
Added: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/RecoveryEnvironmentBean.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -0,0 +1,160 @@
+/*
+ * 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.ats.arjuna.common;
+
+import com.arjuna.common.internal.util.propertyservice.PropertyPrefix;
+import com.arjuna.common.internal.util.propertyservice.FullPropertyName;
+import com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery;
+import com.arjuna.ats.arjuna.utils.Utility;
+
+/**
+ * A JavaBean containing configuration properties for the recovery system.
+ *
+ * @author Jonathan Halliday (jonathan.halliday at redhat.com)
+ */
+ at PropertyPrefix(prefix = "com.arjuna.ats.arjuna.recovery.")
+public class RecoveryEnvironmentBean
+{
+ private int periodicRecoveryPeriod = PeriodicRecovery._defaultRecoveryPeriod;
+ private int recoveryBackoffPeriod = PeriodicRecovery._defaultBackoffPeriod;
+ private boolean recoveryListener = true;
+ private int recoveryPort = 0;
+ private String recoveryAddress = "localhost";
+ private int transactionStatusManagerPort = 0;
+ private String transactionStatusManagerAddress = "localhost";
+
+ private int expiryScanInterval = 12; // hours
+ private int transactionStatusManagerExpiryTime = 12; // hours
+
+ @FullPropertyName(name = "com.arjuna.ats.internal.arjuna.recovery.listener.timeoutsocket")
+ private boolean timeoutSocket = false;
+
+// public static final String PERIODIC_RECOVERY_PERIOD = "com.arjuna.ats.arjuna.recovery.periodicRecoveryPeriod" ;
+ public int getPeriodicRecoveryPeriod()
+ {
+ return periodicRecoveryPeriod;
+ }
+
+ public void setPeriodicRecoveryPeriod(int periodicRecoveryPeriod)
+ {
+ this.periodicRecoveryPeriod = periodicRecoveryPeriod;
+ }
+
+// public static final String RECOVERY_BACKOFF_PERIOD = "com.arjuna.ats.arjuna.recovery.recoveryBackoffPeriod" ;
+ public int getRecoveryBackoffPeriod()
+ {
+ return recoveryBackoffPeriod;
+ }
+
+ public void setRecoveryBackoffPeriod(int recoveryBackoffPeriod)
+ {
+ this.recoveryBackoffPeriod = recoveryBackoffPeriod;
+ }
+
+// public static final String RECOVERY_MANAGER_LISTENER = "com.arjuna.ats.arjuna.recovery.recoveryListener";
+ public boolean isRecoveryListener()
+ {
+ return recoveryListener;
+ }
+
+ public void setRecoveryListener(boolean recoveryListener)
+ {
+ this.recoveryListener = recoveryListener;
+ }
+
+// public static final String RECOVERY_MANAGER_PORT = "com.arjuna.ats.arjuna.recovery.recoveryPort";
+ public int getRecoveryPort()
+ {
+ return recoveryPort;
+ }
+
+ public void setRecoveryPort(int recoveryPort)
+ {
+ Utility.validatePortRange(recoveryPort);
+ this.recoveryPort = recoveryPort;
+ }
+
+// public static final String RECOVERY_MANAGER_ADDRESS = "com.arjuna.ats.arjuna.recovery.recoveryAddress";
+ public String getRecoveryAddress()
+ {
+ return recoveryAddress;
+ }
+
+ public void setRecoveryAddress(String recoveryAddress)
+ {
+ this.recoveryAddress = recoveryAddress;
+ }
+
+// public static final String TRANSACTION_STATUS_MANAGER_PORT = "com.arjuna.ats.arjuna.recovery.transactionStatusManagerPort";
+ public int getTransactionStatusManagerPort()
+ {
+ return transactionStatusManagerPort;
+ }
+
+ public void setTransactionStatusManagerPort(int transactionStatusManagerPort)
+ {
+ Utility.validatePortRange(transactionStatusManagerPort);
+ this.transactionStatusManagerPort = transactionStatusManagerPort;
+ }
+
+// public static final String TRANSACTION_STATUS_MANAGER_ADDRESS = "com.arjuna.ats.arjuna.recovery.transactionStatusManagerAddress";
+ public String getTransactionStatusManagerAddress()
+ {
+ return transactionStatusManagerAddress;
+ }
+
+ public void setTransactionStatusManagerAddress(String transactionStatusManagerAddress)
+ {
+ this.transactionStatusManagerAddress = transactionStatusManagerAddress;
+ }
+
+// public static final String EXPIRY_SCAN_INTERVAL = "com.arjuna.ats.arjuna.recovery.expiryScanInterval";
+ public int getExpiryScanInterval()
+ {
+ return expiryScanInterval;
+ }
+
+ public void setExpiryScanInterval(int expiryScanInterval)
+ {
+ this.expiryScanInterval = expiryScanInterval;
+ }
+
+// public static final String TRANSACTION_STATUS_MANAGER_EXPIRY_TIME = "com.arjuna.ats.arjuna.recovery.transactionStatusManagerExpiryTime";
+ public int getTransactionStatusManagerExpiryTime()
+ {
+ return transactionStatusManagerExpiryTime;
+ }
+
+ public void setTransactionStatusManagerExpiryTime(int transactionStatusManagerExpiryTime)
+ {
+ this.transactionStatusManagerExpiryTime = transactionStatusManagerExpiryTime;
+ }
+
+ public boolean isTimeoutSocket()
+ {
+ return timeoutSocket;
+ }
+
+ public void setTimeoutSocket(boolean timeoutSocket)
+ {
+ this.timeoutSocket = timeoutSocket;
+ }
+}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/arjPropertyManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/arjPropertyManager.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/arjPropertyManager.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,7 +33,10 @@
import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
+import java.util.concurrent.atomic.AtomicBoolean;
+
/**
* Property manager wrapper for the Arjuna module.
*
@@ -41,9 +44,74 @@
*/
public class arjPropertyManager
{
+ // ensure properties are loaded
+ public static void init() {
+ getPropertyManager();
+ }
+
public static PropertyManager getPropertyManager()
{
- // this is not actually a separate module, it shares the arjuna config.
return PropertyManagerFactory.getPropertyManagerForModule("arjuna", Environment.PROPERTIES_FILE);
}
+
+ public static CoreEnvironmentBean getCoreEnvironmentBean()
+ {
+ synchronized (coreEnvironmentBeanInit) {
+ if(!coreEnvironmentBeanInit.get()) {
+ try {
+ BeanPopulator.configureFromPropertyManager(coreEnvironmentBean, getPropertyManager());
+ coreEnvironmentBeanInit.set(true);
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ return coreEnvironmentBean;
+ }
+
+ private static final AtomicBoolean coreEnvironmentBeanInit = new AtomicBoolean(false);
+ private static final CoreEnvironmentBean coreEnvironmentBean = new CoreEnvironmentBean();
+
+ public static CoordinatorEnvironmentBean getCoordinatorEnvironmentBean()
+ {
+ synchronized (coordinatorEnvironmentBeanInit) {
+ if(!coordinatorEnvironmentBeanInit.get()) {
+ try {
+ BeanPopulator.configureFromPropertyManager(coordinatorEnvironmentBean, getPropertyManager());
+ coordinatorEnvironmentBeanInit.set(true);
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ return coordinatorEnvironmentBean;
+ }
+
+ private static final AtomicBoolean coordinatorEnvironmentBeanInit = new AtomicBoolean(false);
+ private static final CoordinatorEnvironmentBean coordinatorEnvironmentBean = new CoordinatorEnvironmentBean();
+
+ public static ObjectStoreEnvironmentBean getObjectStoreEnvironmentBean()
+ {
+ synchronized (objectStoreEnvironmentBeanInit) {
+ if(!objectStoreEnvironmentBeanInit.get()) {
+ try {
+ Thread.dumpStack();
+ System.out.println(arjPropertyManager.getPropertyManager().getProperty(Environment.OBJECTSTORE_TYPE));
+
+ BeanPopulator.configureFromPropertyManager(objectStoreEnvironmentBean, getPropertyManager());
+ objectStoreEnvironmentBeanInit.set(true);
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ return objectStoreEnvironmentBean;
+ }
+
+ private static final AtomicBoolean objectStoreEnvironmentBeanInit = new AtomicBoolean(false);
+ private static final ObjectStoreEnvironmentBean objectStoreEnvironmentBean = new ObjectStoreEnvironmentBean();
+
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/recoveryPropertyManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/recoveryPropertyManager.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/common/recoveryPropertyManager.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -22,15 +22,37 @@
import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
+import java.util.concurrent.atomic.AtomicBoolean;
+
/**
* Property manager wrapper for the recovery system.
*
*/
public class recoveryPropertyManager
{
+ private static final AtomicBoolean recoveryEnvironmentBeanInit = new AtomicBoolean(false);
+ private static final RecoveryEnvironmentBean recoveryEnvironmentBean = new RecoveryEnvironmentBean();
+
public static PropertyManager getPropertyManager()
{
return PropertyManagerFactory.getPropertyManagerForModule("arjuna", Environment.PROPERTIES_FILE);
}
+
+ public static RecoveryEnvironmentBean getRecoveryEnvironmentBean()
+ {
+ synchronized (recoveryEnvironmentBeanInit) {
+ if(!recoveryEnvironmentBeanInit.get()) {
+ try {
+ BeanPopulator.configureFromPropertyManager(recoveryEnvironmentBean, arjPropertyManager.getPropertyManager());
+ recoveryEnvironmentBeanInit.set(true);
+ } catch(Exception e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ return recoveryEnvironmentBean;
+ }
}
\ No newline at end of file
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/BasicAction.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -4052,7 +4052,7 @@
* during execution.
*/
- String checkedActionFactory = arjPropertyManager.getPropertyManager().getProperty(Environment.CHECKEDACTION_FACTORY);
+ String checkedActionFactory = arjPropertyManager.getCoordinatorEnvironmentBean().getCheckedActionFactory();
if (checkedActionFactory != null)
{
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -31,10 +31,7 @@
package com.arjuna.ats.arjuna.coordinator;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.coordinator.Reapable;
-import com.arjuna.ats.arjuna.coordinator.ActionStatus;
import com.arjuna.ats.arjuna.coordinator.listener.ReaperMonitor;
import com.arjuna.ats.internal.arjuna.coordinator.*;
@@ -1106,11 +1103,8 @@
// default to dynamic mode
TransactionReaper._dynamic = true;
- String mode = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TX_REAPER_MODE);
+ String mode = arjPropertyManager.getCoordinatorEnvironmentBean().getTxReaperMode();
- if (mode != null)
- {
if (mode.compareTo(TransactionReaper.PERIODIC) == 0) {
TransactionReaper._dynamic = false;
}
@@ -1123,123 +1117,44 @@
tsLogger.arjLoggerI18N.warn("com.arjuna.ats.arjuna.coordinator.TransactionReaper_19");
}
}
- }
if (!TransactionReaper._dynamic)
{
- String timeoutEnv = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TX_REAPER_TIMEOUT);
-
- if (timeoutEnv != null)
- {
- Long l = null;
-
- try
- {
- l = new Long(timeoutEnv);
- checkPeriod = l.longValue();
-
- l = null;
- }
- catch (NumberFormatException e)
- {
- if (tsLogger.arjLogger.isWarnEnabled()) {
- tsLogger.arjLogger.warn("TransactionReaper::create - "
- + e);
- }
- }
- }
- else
- {
- checkPeriod = defaultCheckPeriod;
- }
+ checkPeriod = arjPropertyManager.getCoordinatorEnvironmentBean().getTxReaperTimeout();
}
else
checkPeriod = Long.MAX_VALUE;
TransactionReaper._theReaper = new TransactionReaper(checkPeriod);
- String cancelWait = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TX_REAPER_CANCEL_WAIT_PERIOD);
- if (cancelWait != null)
- {
- try
- {
- TransactionReaper._theReaper._cancelWaitPeriod = Long.valueOf(cancelWait).longValue();
- }
- catch (NumberFormatException e)
- {
- TransactionReaper._theReaper._cancelWaitPeriod = defaultCancelWaitPeriod;
- }
+ TransactionReaper._theReaper._cancelWaitPeriod = arjPropertyManager.getCoordinatorEnvironmentBean().getTxReaperCancelWaitPeriod();
- // must give TX at least 10 millisecs to
- // respond to cancel
+ // must give TX at least 10 millisecs to
+ // respond to cancel
- if (TransactionReaper._theReaper._cancelWaitPeriod < 10) {
- TransactionReaper._theReaper._cancelWaitPeriod = 10;
- }
- }
- else
- {
- TransactionReaper._theReaper._cancelWaitPeriod = defaultCancelWaitPeriod;
- }
+ if (TransactionReaper._theReaper._cancelWaitPeriod < 10) {
+ TransactionReaper._theReaper._cancelWaitPeriod = 10;
+ }
- String cancelFailWait = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TX_REAPER_CANCEL_FAIL_WAIT_PERIOD);
- if (cancelFailWait != null)
- {
- try
- {
- TransactionReaper._theReaper._cancelFailWaitPeriod = Long.valueOf(cancelFailWait).longValue();
- }
- catch (NumberFormatException e)
- {
- TransactionReaper._theReaper._cancelFailWaitPeriod = defaultCancelFailWaitPeriod;
- }
+ TransactionReaper._theReaper._cancelFailWaitPeriod = arjPropertyManager.getCoordinatorEnvironmentBean().getTxReaperCancelFailWaitPeriod();
- // must give TX at least 10 millisecs to
- // respond to cancel
+ // must give TX at least 10 millisecs to
+ // respond to cancel
- if (TransactionReaper._theReaper._cancelFailWaitPeriod < 10) {
- TransactionReaper._theReaper._cancelFailWaitPeriod = 10;
- }
- }
- else
- {
- TransactionReaper._theReaper._cancelFailWaitPeriod = defaultCancelFailWaitPeriod;
- }
+ if (TransactionReaper._theReaper._cancelFailWaitPeriod < 10) {
+ TransactionReaper._theReaper._cancelFailWaitPeriod = 10;
+ }
- String zombieMax = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TX_REAPER_ZOMBIE_MAX);
- if (zombieMax != null)
- {
- try
- {
- TransactionReaper._theReaper._zombieMax = Integer.valueOf(zombieMax).intValue();
- }
- catch (NumberFormatException e)
- {
- TransactionReaper._theReaper._zombieMax = defaultZombieMax;
- }
- // we start bleating if the zombie count
- // reaches zombieMax so it has to be at
- // least 1
+ TransactionReaper._theReaper._zombieMax = arjPropertyManager.getCoordinatorEnvironmentBean().getTxReaperZombieMax();
- if (TransactionReaper._theReaper._zombieMax <= 0) {
- TransactionReaper._theReaper._zombieMax = 1;
- }
- }
- else
- {
- TransactionReaper._theReaper._zombieMax = defaultZombieMax;
- }
+ // we start bleating if the zombie count
+ // reaches zombieMax so it has to be at
+ // least 1
- // use defaults for now
+ if (TransactionReaper._theReaper._zombieMax <= 0) {
+ TransactionReaper._theReaper._zombieMax = 1;
+ }
- TransactionReaper._theReaper._cancelWaitPeriod = defaultCancelWaitPeriod;
- TransactionReaper._theReaper._cancelFailWaitPeriod = defaultCancelFailWaitPeriod;
- TransactionReaper._theReaper._zombieMax = defaultZombieMax;
-
_reaperThread = new ReaperThread(TransactionReaper._theReaper);
// _reaperThread.setPriority(Thread.MIN_PRIORITY);
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TxControl.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -173,26 +173,13 @@
{
if (TxControl.actionStoreType == null)
{
- String useLog = arjPropertyManager.getPropertyManager().getProperty(
- Environment.TRANSACTION_LOG, "OFF");
-
- if (useLog.equals("ON"))
+ if (arjPropertyManager.getCoordinatorEnvironmentBean().isTransactionLog())
TxControl.actionStoreType = new ClassName(ArjunaNames
.Implementation_ObjectStore_ActionLogStore());
else
- TxControl.actionStoreType = new ClassName(
- arjPropertyManager.getPropertyManager()
- .getProperty(
- Environment.ACTION_STORE,
- ArjunaNames
- .Implementation_ObjectStore_defaultActionStore()
- .stringForm()));
+ TxControl.actionStoreType = new ClassName( arjPropertyManager.getCoordinatorEnvironmentBean().getActionStore() );
- String sharedLog = arjPropertyManager.getPropertyManager().getProperty(
- Environment.SHARED_TRANSACTION_LOG, "NO");
-
- if (sharedLog.equals("YES"))
- sharedTransactionLog = true;
+ sharedTransactionLog = arjPropertyManager.getCoordinatorEnvironmentBean().isSharedTransactionLog();
}
ClassName recoveryType = TxControl.actionStoreType;
@@ -225,26 +212,13 @@
if (TxControl.actionStoreType == null)
{
- String useLog = arjPropertyManager.getPropertyManager().getProperty(
- Environment.TRANSACTION_LOG, "OFF");
-
- if (useLog.equals("ON"))
+ if (arjPropertyManager.getCoordinatorEnvironmentBean().isTransactionLog())
TxControl.actionStoreType = new ClassName(ArjunaNames
.Implementation_ObjectStore_ActionLogStore());
else
- TxControl.actionStoreType = new ClassName(
- arjPropertyManager.getPropertyManager()
- .getProperty(
- Environment.ACTION_STORE,
- ArjunaNames
- .Implementation_ObjectStore_defaultActionStore()
- .stringForm()));
+ TxControl.actionStoreType = new ClassName( arjPropertyManager.getCoordinatorEnvironmentBean().getActionStore() );
- String sharedLog = arjPropertyManager.getPropertyManager().getProperty(
- Environment.SHARED_TRANSACTION_LOG, "NO");
-
- if (sharedLog.equals("YES"))
- sharedTransactionLog = true;
+ sharedTransactionLog = arjPropertyManager.getCoordinatorEnvironmentBean().isSharedTransactionLog();
}
/*
@@ -374,106 +348,20 @@
static
{
- String env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.DEFAULT_TIMEOUT);
+ _defaultTimeout = arjPropertyManager.getCoordinatorEnvironmentBean().getDefaultTimeout();
+ maintainHeuristics = arjPropertyManager.getCoordinatorEnvironmentBean().isMaintainHeuristics();
+ asyncCommit = arjPropertyManager.getCoordinatorEnvironmentBean().isAsyncCommit();
+ asyncPrepare = arjPropertyManager.getCoordinatorEnvironmentBean().isAsyncPrepare();
+ onePhase = arjPropertyManager.getCoordinatorEnvironmentBean().isCommitOnePhase();
+ asyncRollback = arjPropertyManager.getCoordinatorEnvironmentBean().isAsyncRollback();
+ readonlyOptimisation = arjPropertyManager.getCoordinatorEnvironmentBean().isReadonlyOptimisation();
+ enableStatistics = arjPropertyManager.getCoordinatorEnvironmentBean().isEnableStatistics();
+ enable = !arjPropertyManager.getCoordinatorEnvironmentBean().isStartDisabled();
+ beforeCompletionWhenRollbackOnly = arjPropertyManager.getCoordinatorEnvironmentBean().isBeforeCompletionWhenRollbackOnly();
- if (env != null)
- {
- try
- {
- Integer in = new Integer(env);
- _defaultTimeout = in.intValue();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.MAINTAIN_HEURISTICS);
-
- if (env != null)
- {
- if (env.compareTo("NO") == 0)
- TxControl.maintainHeuristics = false;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.ASYNC_COMMIT);
-
- if (env != null)
- {
- if (env.compareTo("YES") == 0)
- TxControl.asyncCommit = true;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.ASYNC_PREPARE);
-
- if (env != null)
- {
- if (env.compareTo("YES") == 0)
- TxControl.asyncPrepare = true;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.COMMIT_ONE_PHASE);
-
- if (env != null)
- {
- if (env.compareTo("NO") == 0)
- TxControl.onePhase = false;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.ASYNC_ROLLBACK);
-
- if (env != null)
- {
- if (env.compareTo("YES") == 0)
- TxControl.asyncRollback = true;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.READONLY_OPTIMISATION);
-
- if (env != null)
- {
- if (env.compareTo("NO") == 0)
- TxControl.readonlyOptimisation = false;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.ENABLE_STATISTICS);
-
- if (env != null)
- {
- if (env.compareTo("YES") == 0)
- TxControl.enableStatistics = true;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.START_DISABLED);
-
- if (env != null)
- {
- if (env.compareTo("YES") == 0)
- TxControl.enable = false;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.BEFORECOMPLETION_WHEN_ROLLBACKONLY);
-
- if(env != null)
- {
- if(env.compareTo("YES") == 0)
- TxControl.beforeCompletionWhenRollbackOnly = true;
- }
-
- env = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.XA_NODE_IDENTIFIER);
+ String env = arjPropertyManager.getCoreEnvironmentBean().getNodeIdentifier();
boolean writeNodeName = false;
if (env != null)
@@ -537,12 +425,8 @@
Environment.XA_NODE_IDENTIFIER, new String(xaNodeName));
}
- String enableTSM = arjPropertyManager.getPropertyManager().getProperty(Environment.TRANSACTION_STATUS_MANAGER_ENABLE);
- // run the TSM by default, unless it's turned off explicitly.
+ _enableTSM = arjPropertyManager.getCoordinatorEnvironmentBean().isTransactionStatusManagerEnable();
- if ("NO".equalsIgnoreCase(enableTSM))
- _enableTSM = false;
-
// TODO -- add this check to respect the environment setting for Environment.START_DISABLED?
// TODO -- is this feature actually needed (it appears not to be used internally)
// if (enable) {
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/logging/tsLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -53,7 +53,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger * */
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
arjLogger = LogFactory.getLogNoi18n("com.arjuna.ats.arjuna.logging.arjLogger");
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -412,7 +412,7 @@
*/
if (objectStoreType == null)
- objectStoreType = new ClassName(arjPropertyManager.getPropertyManager().getProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_defaultStore().stringForm()));
+ objectStoreType = new ClassName(arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreType());
return objectStoreType;
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStoreImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStoreImple.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/objectstore/ObjectStoreImple.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -31,9 +31,7 @@
package com.arjuna.ats.arjuna.objectstore;
-import com.arjuna.ats.arjuna.ArjunaNames;
import com.arjuna.ats.arjuna.common.Environment;
-import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.ats.arjuna.gandiva.ClassName;
import com.arjuna.ats.arjuna.gandiva.ObjectName;
import com.arjuna.ats.arjuna.state.*;
@@ -240,15 +238,12 @@
public String locateStore (String localOSRoot) throws ObjectStoreException
{
if (_objectStoreRoot == null)
- _objectStoreRoot = arjPropertyManager.getPropertyManager().getProperty(Environment.LOCALOSROOT);
+ _objectStoreRoot = arjPropertyManager.getObjectStoreEnvironmentBean().getLocalOSRoot();
if (_objectStoreDir == null)
{
- _objectStoreDir = arjPropertyManager.getPropertyManager().getProperty(Environment.OBJECTSTORE_DIR);
+ _objectStoreDir = arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreDir();
if (_objectStoreDir == null || _objectStoreDir.length() == 0)
- _objectStoreDir = com.arjuna.ats.arjuna.common.Configuration.objectStoreRoot();
-
- if (_objectStoreDir == null || _objectStoreDir.length() == 0)
throw new ObjectStoreException(Environment.OBJECTSTORE_DIR+" not set.");
if (!_objectStoreDir.endsWith(File.separator))
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-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/RecoveryManager.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -410,44 +410,14 @@
public static InetAddress getRecoveryManagerHost() throws UnknownHostException
{
- PropertyManager pm = recoveryPropertyManager.getPropertyManager();
+ String host = recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryAddress();
- if ( pm == null )
- return InetAddress.getLocalHost();
-
- String hostPropName = com.arjuna.ats.arjuna.common.Environment.RECOVERY_MANAGER_ADDRESS;
- String host = pm.getProperty(hostPropName);
-
return Utility.hostNameToInetAddress(host, "com.arjuna.ats.arjuna.recovery.RecoveryManager_2");
}
public static int getRecoveryManagerPort()
{
- PropertyManager pm = recoveryPropertyManager.getPropertyManager();
-
- if (pm == null)
- return 0;
-
- String portPropName = com.arjuna.ats.arjuna.common.Environment.RECOVERY_MANAGER_PORT;
- Integer port = Utility.lookupBoundedIntegerProperty(pm, portPropName, null,
- "com.arjuna.ats.arjuna.recovery.RecoveryManager_1",
- 0, Utility.MAX_PORT);
-
- if (port == null)
- {
- String portStr = pm.getProperty(portPropName);
-
- /*
- * if the property files specified a value for the port which is invalid throw a fatal error. An empty value or no value
- * corresponds to any port
- */
- if (portStr == null || portStr.length() == 0)
- port = 0;
- else
- throw new com.arjuna.ats.arjuna.exceptions.FatalError(tsLogger.log_mesg.getString("com.arjuna.ats.arjuna.recovery.RecoveryManager_5"));
- }
-
- return port;
+ return recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryPort();
}
/**
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/TransactionStatusManager.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/TransactionStatusManager.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/recovery/TransactionStatusManager.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -213,33 +213,12 @@
if (_port > 0)
return _port;
- PropertyManager pm = recoveryPropertyManager.getPropertyManager();
-
- String portStr = pm.getProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_STATUS_MANAGER_PORT);
-
- if ( portStr == null || portStr.length() == 0)
- {
- return DEFAULT_TMS_PORT;
- }
- else
- {
- Integer port = Utility.lookupBoundedIntegerProperty(pm, com.arjuna.ats.arjuna.common.Environment.TRANSACTION_STATUS_MANAGER_PORT, defValue,
- "com.arjuna.ats.arjuna.recovery.TransactionStatusManager_8",
- 0, Utility.MAX_PORT);
-
- if (port == null)
- throw new com.arjuna.ats.arjuna.exceptions.FatalError(tsLogger.log_mesg.getString("com.arjuna.ats.arjuna.recovery.TransactionStatusManager_11"));
-
- return port;
- }
-
+ return recoveryPropertyManager.getRecoveryEnvironmentBean().getTransactionStatusManagerPort();
}
private String getListenerHostName()
{
- PropertyManager pm = recoveryPropertyManager.getPropertyManager();
-
- return pm.getProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_STATUS_MANAGER_ADDRESS);
+ return recoveryPropertyManager.getRecoveryEnvironmentBean().getTransactionStatusManagerAddress();
}
/**
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/OTM.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/OTM.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/tools/OTM.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -215,8 +215,7 @@
try
{
- ClassName actionStoreType = new ClassName(arjPropertyManager.getPropertyManager().getProperty(Environment.ACTION_STORE,
- ArjunaNames.Implementation_ObjectStore_defaultActionStore().stringForm()));
+ ClassName actionStoreType = new ClassName(arjPropertyManager.getCoordinatorEnvironmentBean().getActionStore());
ObjectStore imple = new ObjectStore(actionStoreType, root);
InputObjectState types = new InputObjectState();
@@ -443,8 +442,7 @@
try
{
- ClassName actionStoreType = new ClassName(arjPropertyManager.getPropertyManager().getProperty(Environment.ACTION_STORE,
- ArjunaNames.Implementation_ObjectStore_defaultActionStore().stringForm()));
+ ClassName actionStoreType = new ClassName(arjPropertyManager.getCoordinatorEnvironmentBean().getActionStore());
ObjectStore imple = new ObjectStore(actionStoreType, root);
InputObjectState types = new InputObjectState();
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/utils/Utility.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -314,7 +314,7 @@
public static final boolean isWindows ()
{
- String os = arjPropertyManager.getPropertyManager().getProperty("os.name");
+ String os = System.getProperty("os.name");
if (("WIN32".equals(os)) || (os.indexOf("Windows") != -1))
return true;
@@ -336,8 +336,7 @@
{
try
{
- Class c = Thread.currentThread().getContextClassLoader().loadClass(
- arjPropertyManager.getPropertyManager().getProperty(Environment.PROCESS_IMPLEMENTATION, defaultProcessId));
+ Class c = Thread.currentThread().getContextClassLoader().loadClass( arjPropertyManager.getCoreEnvironmentBean().getProcessImplementation());
return (Process) c.newInstance();
}
@@ -359,6 +358,12 @@
return processHandle;
}
+ public static void validatePortRange(int port) {
+ if(port < 0 || port > MAX_PORT) {
+ throw new IllegalArgumentException("port value out of range "+port);
+ }
+ }
+
private static int myAddr = 0;
private static Uid processUid = null;
@@ -367,7 +372,7 @@
private static final String hexStart = "0x";
- private static final String defaultProcessId = "com.arjuna.ats.internal.arjuna.utils.SocketProcessId";
+ public static final String defaultProcessId = "com.arjuna.ats.internal.arjuna.utils.SocketProcessId";
/**
* The maximum queue length for incoming connection indications (a request
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/ActionStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/ActionStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/ActionStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -32,23 +32,16 @@
package com.arjuna.ats.internal.arjuna.objectstore;
import com.arjuna.ats.arjuna.ArjunaNames;
-import com.arjuna.ats.arjuna.common.Environment;
-import com.arjuna.ats.arjuna.coordinator.*;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
import com.arjuna.ats.arjuna.objectstore.ObjectStoreType;
import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.ats.arjuna.state.*;
import com.arjuna.ats.arjuna.gandiva.ClassName;
import com.arjuna.ats.arjuna.gandiva.ObjectName;
-import com.arjuna.ats.arjuna.utils.FileLock;
-import com.arjuna.ats.arjuna.utils.Utility;
-import java.io.File;
import com.arjuna.common.util.logging.*;
import com.arjuna.ats.arjuna.exceptions.ObjectStoreException;
-import java.io.IOException;
import com.arjuna.ats.arjuna.logging.tsLogger;
import com.arjuna.ats.arjuna.logging.FacilityCode;
@@ -323,24 +316,18 @@
protected synchronized boolean setupStore (String location) throws ObjectStoreException
{
- if (!checkSync)
- {
- String syncOpt = arjPropertyManager.getPropertyManager().getProperty(Environment.TRANSACTION_SYNC);
+ if (!checkSync)
+ {
+ if(arjPropertyManager.getObjectStoreEnvironmentBean().isTransactionSync()) {
+ syncOn();
+ } else {
+ syncOff();
+ }
+ }
- if (syncOpt != null)
- {
- if (syncOpt.compareTo("OFF") == 0)
- syncOff();
- else
- syncOn();
- }
- else
- syncOn();
+ checkSync = true;
- checkSync = true;
- }
-
- return super.setupStore(location);
+ return super.setupStore(location);
}
private static boolean checkSync = false;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/CacheStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/CacheStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/CacheStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -285,13 +285,7 @@
static
{
- String cacheSync = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CACHE_STORE_SYNC);
-
- if (cacheSync != null)
- {
- if (cacheSync.equals("ON"))
- _cacheSync = true;
- }
+ _cacheSync = arjPropertyManager.getObjectStoreEnvironmentBean().isCacheStoreSync();
}
}
@@ -922,90 +916,30 @@
private static int _defaultRemovedItems = 2 * HASH_SIZE;
private static int _defaultWorkItems = 100;
private static int _defaultScanPeriod = 120000;
-
+
static
{
- String hashSize = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CACHE_STORE_HASH);
+ HASH_SIZE = arjPropertyManager.getObjectStoreEnvironmentBean().getCacheStoreHash();
- if (hashSize != null)
- {
- try
- {
- HASH_SIZE = Integer.parseInt(hashSize);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
+ if (HASH_SIZE <= 0)
+ HASH_SIZE = 128;
- if (HASH_SIZE <= 0)
- HASH_SIZE = 128;
-
- String cacheSize = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CACHE_STORE_SIZE);
+ _defaultCacheSize = arjPropertyManager.getObjectStoreEnvironmentBean().getCacheStoreSize();
- if (cacheSize != null)
- {
- try
- {
- _defaultCacheSize = Integer.parseInt(cacheSize);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
+ if (_defaultCacheSize < 0)
+ _defaultCacheSize = 0;
- if (_defaultCacheSize < 0)
- _defaultCacheSize = 0;
+ _defaultRemovedItems = arjPropertyManager.getObjectStoreEnvironmentBean().getCacheStoreRemovedItems();
- String removedItems = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CACHE_STORE_REMOVED_ITEMS);
+ if (_defaultRemovedItems < 0)
+ _defaultRemovedItems = 0;
- if (removedItems != null)
- {
- try
- {
- _defaultRemovedItems = Integer.parseInt(removedItems);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
+ _defaultWorkItems = arjPropertyManager.getObjectStoreEnvironmentBean().getCacheStoreWorkItems();
- if (_defaultRemovedItems < 0)
- _defaultRemovedItems = 0;
+ if (_defaultWorkItems < 0)
+ _defaultWorkItems = 0;
- String workItems = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CACHE_STORE_WORK_ITEMS);
-
- if (workItems != null)
- {
- try
- {
- _defaultWorkItems = Integer.parseInt(workItems);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- if (_defaultWorkItems < 0)
- _defaultWorkItems = 0;
-
- String scanPeriod = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.CACHE_STORE_SCAN_PERIOD);
-
- if (scanPeriod != null)
- {
- try
- {
- _defaultScanPeriod = Integer.parseInt(scanPeriod);
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
+ _defaultScanPeriod = arjPropertyManager.getObjectStoreEnvironmentBean().getCacheStoreScanPeriod();
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/FileSystemStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/FileSystemStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/FileSystemStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -977,64 +977,20 @@
static
{
- String syncOpt = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.OBJECTSTORE_SYNC);
+ FileSystemStore.doSync = arjPropertyManager.getObjectStoreEnvironmentBean().isObjectStoreSync();
- if (syncOpt != null)
- {
- if (syncOpt.compareTo("OFF") == 0)
- FileSystemStore.doSync = false;
- }
- else
- FileSystemStore.doSync = true;
+ if (File.separatorChar != FileSystemStore.unixSeparator)
+ rewriteSeparator = true;
- if (File.separatorChar != FileSystemStore.unixSeparator)
- rewriteSeparator = true;
+ createRetry = arjPropertyManager.getObjectStoreEnvironmentBean().getHierarchyRetry();
- String retry = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.OBJECTSTORE_HIERARCHY_RETRY);
+ if (createRetry < 0)
+ createRetry = 100;
- if (retry != null)
- {
- try
- {
- Integer i = new Integer(retry);
+ createTimeout = arjPropertyManager.getObjectStoreEnvironmentBean().getHierarchyTimeout();
- createRetry = i.intValue();
-
- if (createRetry < 0)
- createRetry = 100;
- }
- catch (NumberFormatException e)
- {
- throw new com.arjuna.ats.arjuna.exceptions.FatalError("Invalid retry for hierarchy creation: "+createRetry, e);
- }
- catch (Exception e)
- {
- throw new com.arjuna.ats.arjuna.exceptions.FatalError(e.toString(), e);
- }
- }
-
- String timeout = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.OBJECTSTORE_HIERARCHY_TIMEOUT);
-
- if (timeout != null)
- {
- try
- {
- Integer i = new Integer(timeout);
-
- createTimeout = i.intValue();
-
- if (createTimeout < 0)
- createTimeout = 100;
- }
- catch (NumberFormatException e)
- {
- throw new com.arjuna.ats.arjuna.exceptions.FatalError("Invalid timeout for hierarchy creation: "+createTimeout, e);
- }
- catch (Exception e)
- {
- throw new com.arjuna.ats.arjuna.exceptions.FatalError(e.toString(), e);
- }
- }
+ if (createTimeout < 0)
+ createTimeout = 100;
}
private static boolean isWindows = Utility.isWindows();
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedActionStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedActionStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedActionStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,8 +33,6 @@
import com.arjuna.ats.arjuna.common.*;
import com.arjuna.ats.arjuna.ArjunaNames;
-import com.arjuna.ats.arjuna.common.Environment;
-import com.arjuna.ats.arjuna.coordinator.*;
import com.arjuna.ats.arjuna.gandiva.ClassName;
import com.arjuna.ats.arjuna.gandiva.ObjectName;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
@@ -45,13 +43,7 @@
import com.arjuna.common.util.logging.*;
-import java.io.*;
-import java.io.File;
-
import com.arjuna.ats.arjuna.exceptions.ObjectStoreException;
-import java.io.IOException;
-import java.io.FileNotFoundException;
-import java.lang.NumberFormatException;
/**
* The basic action store implementations store the object states in
@@ -214,24 +206,18 @@
protected synchronized boolean setupStore (String location) throws ObjectStoreException
{
- if (!checkSync)
- {
- String syncOpt = arjPropertyManager.getPropertyManager().getProperty(Environment.TRANSACTION_SYNC);
+ if (!checkSync)
+ {
+ if(arjPropertyManager.getObjectStoreEnvironmentBean().isTransactionSync()) {
+ syncOn();
+ } else {
+ syncOff();
+ }
+ }
- if (syncOpt != null)
- {
- if (syncOpt.equals("OFF"))
- syncOff();
- else
- syncOn();
- }
- else
- syncOn();
+ checkSync = true;
- checkSync = true;
- }
-
- return super.setupStore(location);
+ return super.setupStore(location);
}
private static boolean checkSync = false;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/HashedStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -75,8 +75,6 @@
*
* @message com.arjuna.ats.internal.arjuna.objectstore.HashedStore_1 [com.arjuna.ats.internal.arjuna.objectstore.HashedStore_1] - HashedStore.create caught: {0}
* @message com.arjuna.ats.internal.arjuna.objectstore.HashedStore_2 [com.arjuna.ats.internal.arjuna.objectstore.HashedStore_2] - invalid number of hash directories: {0}. Will use default.
- * @message com.arjuna.ats.internal.arjuna.objectstore.HashedStore_3 [com.arjuna.ats.internal.arjuna.objectstore.HashedStore_3] - invalid number of hash directories: {0}
- * @message com.arjuna.ats.internal.arjuna.objectstore.HashedStore_4 [com.arjuna.ats.internal.arjuna.objectstore.HashedStore_4] - caught exception: {0}
* @message com.arjuna.ats.internal.arjuna.objectstore.HashedStore_5 [com.arjuna.ats.internal.arjuna.objectstore.HashedStore_5] - HashedStore.allObjUids - could not pack Uid.
* @message com.arjuna.ats.internal.arjuna.objectstore.HashedStore_6 [com.arjuna.ats.internal.arjuna.objectstore.HashedStore_6] - HashedStore.allObjUids - could not pack end of list Uid.
*/
@@ -432,56 +430,25 @@
return false;
}
- private static final int DEFAULT_NUMBER_DIRECTORIES = 255;
+ public static final int DEFAULT_NUMBER_DIRECTORIES = 255;
private static final String HASH_SEPARATOR = "#";
private static int NUMBEROFDIRECTORIES = DEFAULT_NUMBER_DIRECTORIES;
static
{
- String numberOfDirs = arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.HASHED_DIRECTORIES);
+ NUMBEROFDIRECTORIES = arjPropertyManager.getObjectStoreEnvironmentBean().getHashedDirectories();
- if (numberOfDirs != null)
- {
- try
- {
- Integer i = new Integer(numberOfDirs);
+ if (NUMBEROFDIRECTORIES <= 0)
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ {
+ tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.HashedStore_2",
+ new Object[]{NUMBEROFDIRECTORIES});
+ }
- NUMBEROFDIRECTORIES = i.intValue();
-
- if (NUMBEROFDIRECTORIES <= 0)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.HashedStore_2",
- new Object[]{numberOfDirs});
- }
-
- NUMBEROFDIRECTORIES = DEFAULT_NUMBER_DIRECTORIES;
- }
- }
- catch (NumberFormatException e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.HashedStore_3",
- new Object[]{numberOfDirs});
- }
-
- throw new com.arjuna.ats.arjuna.exceptions.FatalError("Invalid hash directory number: "+numberOfDirs, e);
- }
- catch (Exception e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.objectstore.HashedStore_4",
- new Object[]{e});
- }
-
- throw new com.arjuna.ats.arjuna.exceptions.FatalError(e.toString(), e);
- }
- }
+ NUMBEROFDIRECTORIES = DEFAULT_NUMBER_DIRECTORIES;
+ }
}
-
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCActionStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCActionStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCActionStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -236,9 +236,9 @@
protected String getAccessClassName()
{
- if (_txClassName == null)
- _txClassName = arjPropertyManager.getPropertyManager().getProperty(Environment.JDBC_TX_DB_ACCESS);
- return _txClassName;
+ if (_txClassName == null)
+ _txClassName = arjPropertyManager.getObjectStoreEnvironmentBean().getJdbcTxDbAccess();
+ return _txClassName;
}
protected void setAccessClassName(String txClassName)
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCImple.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCImple.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -1023,76 +1023,36 @@
public boolean initialise(Connection conn, JDBCAccess jdbcAccess,
String tableName) throws SQLException
{
- String poolSizeInitStr = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.JDBC_POOL_SIZE_INIT);
- String poolSizeMaxStr = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.JDBC_POOL_SIZE_MAX);
+ _poolSizeInit = arjPropertyManager.getObjectStoreEnvironmentBean().getJdbcPoolSizeInitial();
+ if (_poolSizeInit < 1)
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ {
+ tsLogger.arjLoggerI18N
+ .warn(
+ "com.arjuna.ats.internal.arjuna.objectstore.JDBCImple_11",
+ new Object[]
+ { _poolSizeInit });
+ }
+ _poolSizeInit = 1;
+ }
- if (poolSizeInitStr != null)
- {
- try
- {
- _poolSizeInit = Integer.parseInt(poolSizeInitStr);
- if (_poolSizeInit < 1)
- {
- _poolSizeInit = 1;
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N
- .warn(
- "com.arjuna.ats.internal.arjuna.objectstore.JDBCImple_11",
- new Object[]
- { poolSizeInitStr });
- }
- }
- }
- catch (Exception e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N
- .warn(
- "com.arjuna.ats.internal.arjuna.objectstore.JDBCImple_11",
- new Object[]
- { poolSizeInitStr });
- }
+ _poolSizeMax = arjPropertyManager.getObjectStoreEnvironmentBean().getJdbcPoolSizeMaximum();
+ if (_poolSizeMax < _poolSizeInit)
+ {
+ if (tsLogger.arjLoggerI18N.isWarnEnabled())
+ {
+ tsLogger.arjLoggerI18N
+ .warn(
+ "com.arjuna.ats.internal.arjuna.objectstore.JDBCImple_12",
+ new Object[]
+ { _poolSizeMax });
+ }
+ _poolSizeMax = _poolSizeInit;
+ }
- }
- }
- if (poolSizeMaxStr != null)
- {
- try
- {
- _poolSizeMax = Integer.parseInt(poolSizeMaxStr);
- if (_poolSizeMax < _poolSizeInit)
- {
- _poolSizeMax = _poolSizeInit;
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N
- .warn(
- "com.arjuna.ats.internal.arjuna.objectstore.JDBCImple_12",
- new Object[]
- { poolSizeMaxStr });
- }
- }
- }
- catch (Exception e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N
- .warn(
- "com.arjuna.ats.internal.arjuna.objectstore.JDBCImple_12",
- new Object[]
- { poolSizeMaxStr });
- }
-
- }
- }
- _poolPutConn = "yes"
- .equalsIgnoreCase(arjPropertyManager.getPropertyManager()
- .getProperty(Environment.JDBC_POOL_PUT));
+ _poolPutConn = arjPropertyManager.getObjectStoreEnvironmentBean().isJdbcPoolPutConnections();
+
_jdbcAccess = jdbcAccess;
_theConnection = new Connection[_poolSizeMax];
_theConnection[0] = conn;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/JDBCStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -451,8 +451,7 @@
protected String getAccessClassName()
{
if (_jdbcAccessClassName == null)
- _jdbcAccessClassName = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.JDBC_USER_DB_ACCESS);
+ _jdbcAccessClassName = arjPropertyManager.getObjectStoreEnvironmentBean().getJdbcUserDbAccess();
return _jdbcAccessClassName;
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/LogStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/LogStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/LogStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -25,7 +25,6 @@
import java.util.Stack;
import com.arjuna.ats.arjuna.ArjunaNames;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.Uid;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
@@ -801,24 +800,17 @@
protected synchronized boolean setupStore(String location)
throws ObjectStoreException
{
- if (!checkSync)
- {
- String syncOpt = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TRANSACTION_SYNC);
+ if (!checkSync)
+ {
+ if(arjPropertyManager.getObjectStoreEnvironmentBean().isTransactionSync()) {
+ syncOn();
+ } else {
+ syncOff();
+ }
+ }
- if (syncOpt != null)
- {
- if (syncOpt.compareTo("OFF") == 0)
- syncOff();
- else
- syncOn();
- }
- else
- syncOn();
+ checkSync = true;
- checkSync = true;
- }
-
if (_purger == null)
{
_purger = new LogPurger(this, _purgeTime);
@@ -1683,53 +1675,10 @@
static
{
- try
- {
- String removeMarkers = arjPropertyManager.getPropertyManager()
- .getProperty(Environment.TRANSACTION_LOG_SYNC_REMOVAL,
- "TRUE");
+ _synchronousRemoval = arjPropertyManager.getObjectStoreEnvironmentBean().isSynchronousRemoval();
- if (removeMarkers.equalsIgnoreCase("true"))
- _synchronousRemoval = true;
+ _purgeTime = arjPropertyManager.getObjectStoreEnvironmentBean().getPurgeTime();
- String purgeTime = arjPropertyManager.getPropertyManager().getProperty(Environment.TRANSACTION_LOG_PURGE_TIME);
-
- if (purgeTime != null)
- {
- try
- {
- _purgeTime = Long.parseLong(purgeTime);
- }
- catch (final Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- String logSize = arjPropertyManager.getPropertyManager().getProperty(Environment.TRANSACTION_LOG_SIZE);
-
- if (logSize != null)
- {
- try
- {
- _maxFileSize = Long.parseLong(logSize);
- }
- catch (final Exception ex)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N
- .warn(
- "com.arjuna.ats.internal.arjuna.objectstore.LogStore_3",
- new Object[]
- { logSize });
- }
- }
- }
- }
- catch (final Exception ex)
- {
- throw new ExceptionInInitializerError(ex);
- }
+ _maxFileSize = arjPropertyManager.getObjectStoreEnvironmentBean().getTxLogSize();
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/NullActionStore.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/NullActionStore.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/NullActionStore.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -32,26 +32,16 @@
package com.arjuna.ats.internal.arjuna.objectstore;
import com.arjuna.ats.arjuna.ArjunaNames;
-import com.arjuna.ats.arjuna.common.Environment;
-import com.arjuna.ats.arjuna.coordinator.*;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
import com.arjuna.ats.arjuna.objectstore.ObjectStoreType;
import com.arjuna.ats.arjuna.common.*;
-import com.arjuna.common.util.propertyservice.PropertyManager;
import com.arjuna.ats.arjuna.state.*;
import com.arjuna.ats.arjuna.gandiva.ClassName;
import com.arjuna.ats.arjuna.gandiva.ObjectName;
-import com.arjuna.ats.arjuna.utils.FileLock;
-import com.arjuna.ats.arjuna.utils.Utility;
-import java.io.File;
-import com.arjuna.common.util.logging.*;
-
import com.arjuna.ats.arjuna.exceptions.ObjectStoreException;
-import java.io.IOException;
import com.arjuna.ats.arjuna.logging.tsLogger;
-import com.arjuna.ats.arjuna.logging.FacilityCode;
/**
* The basic transaction log implementation. Uses the no file-level
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/jdbc/accessors/accessor.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/jdbc/accessors/accessor.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/objectstore/jdbc/accessors/accessor.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -34,7 +34,6 @@
import com.arjuna.ats.arjuna.objectstore.jdbc.JDBCAccess;
import com.arjuna.ats.arjuna.ArjunaNames;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.gandiva.ObjectName;
import java.sql.*;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredEntryMonitor.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredEntryMonitor.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredEntryMonitor.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -40,6 +40,7 @@
import com.arjuna.ats.arjuna.recovery.ExpiryScanner;
import com.arjuna.ats.arjuna.recovery.RecoveryEnvironment;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.arjuna.logging.tsLogger;
import com.arjuna.ats.arjuna.logging.FacilityCode;
@@ -248,34 +249,14 @@
* Read the system properties to set the configurable options
*/
- String scanIntervalString =
- arjPropertyManager.getPropertyManager().getProperty( RecoveryEnvironment.EXPIRY_SCAN_INTERVAL );
+ _scanIntervalSeconds = recoveryPropertyManager.getRecoveryEnvironmentBean().getExpiryScanInterval() * 60 * 60;
- if ( scanIntervalString != null )
+ if (tsLogger.arjLoggerI18N.debugAllowed())
{
- try
- {
- Integer scanIntervalInteger = new Integer(scanIntervalString);
- // convert to seconds
- _scanIntervalSeconds = scanIntervalInteger.intValue() * 60 * 60;
-
- if (tsLogger.arjLoggerI18N.debugAllowed())
- {
- tsLogger.arjLoggerI18N.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_CRASH_RECOVERY,
- "com.arjuna.ats.internal.arjuna.recovery.ExpiredEntryMonitor_1",
- new Object[]{Integer.toString(_scanIntervalSeconds)});
- }
- }
- catch ( NumberFormatException e )
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.recovery.ExpiredEntryMonitor_11",
- new Object[]{RecoveryEnvironment.EXPIRY_SCAN_INTERVAL,
- scanIntervalString});
- }
- }
+ tsLogger.arjLoggerI18N.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
+ FacilityCode.FAC_CRASH_RECOVERY,
+ "com.arjuna.ats.internal.arjuna.recovery.ExpiredEntryMonitor_1",
+ new Object[]{Integer.toString(_scanIntervalSeconds)});
}
if (_scanIntervalSeconds != 0)
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredTransactionStatusManagerScanner.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredTransactionStatusManagerScanner.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/ExpiredTransactionStatusManagerScanner.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -36,6 +36,7 @@
import com.arjuna.ats.arjuna.common.Uid ;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.arjuna.objectstore.ObjectStore ;
import com.arjuna.ats.arjuna.recovery.ExpiryScanner ;
import com.arjuna.ats.arjuna.recovery.RecoveryEnvironment ;
@@ -193,36 +194,18 @@
private static int _expiryTime = 12 * 60 * 60 ; // default is 12 hours
private static SimpleDateFormat _timeFormat = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss");
-
+
static
{
-
- String expiryTimeString = arjPropertyManager.getPropertyManager().getProperty(RecoveryEnvironment.TRANSACTION_STATUS_MANAGER_EXPIRY_TIME);
-
- if ( expiryTimeString != null )
- {
- try
- {
- Integer expiryTimeInteger = new Integer(expiryTimeString) ;
- // convert to seconds
- _expiryTime = expiryTimeInteger.intValue() * 60 * 60 ;
-
- if (tsLogger.arjLoggerI18N.isDebugEnabled())
- {
- tsLogger.arjLoggerI18N.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PRIVATE,
- FacilityCode.FAC_CRASH_RECOVERY,
- "com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner_4", new Object[]{Integer.toString(_expiryTime)});
- }
- }
- catch ( NumberFormatException e )
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner_5", new Object[]{RecoveryEnvironment.TRANSACTION_STATUS_MANAGER_EXPIRY_TIME, expiryTimeString});
- }
- }
- }
- }
+ _expiryTime = recoveryPropertyManager.getRecoveryEnvironmentBean().getTransactionStatusManagerExpiryTime() * 60 * 60;
+ if (tsLogger.arjLoggerI18N.isDebugEnabled())
+ {
+ tsLogger.arjLoggerI18N.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PRIVATE,
+ FacilityCode.FAC_CRASH_RECOVERY,
+ "com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionStatusManagerScanner_4", new Object[]{Integer.toString(_expiryTime)});
+ }
+ }
+
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/Listener.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/Listener.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/Listener.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -269,12 +269,7 @@
static
{
- String timeoutSocket = arjPropertyManager.getPropertyManager().getProperty("com.arjuna.ats.internal.arjuna.recovery.listener.timeoutsocket", "NO");
-
- if (timeoutSocket.equals("YES"))
- {
- setTimeout = true;
- }
+ setTimeout = recoveryPropertyManager.getRecoveryEnvironmentBean().isTimeoutSocket();
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -44,6 +44,7 @@
import com.arjuna.ats.arjuna.recovery.RecoveryEnvironment;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.arjuna.logging.FacilityCode;
import com.arjuna.ats.arjuna.logging.tsLogger;
@@ -1035,68 +1036,28 @@
setStatus(Status.INACTIVE);
setMode(Mode.ENABLED);
- _recoveryPeriod = _defaultRecoveryPeriod;
+ _recoveryPeriod = recoveryPropertyManager.getRecoveryEnvironmentBean().getPeriodicRecoveryPeriod();
- String recoveryPeriodString =
- arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.PERIODIC_RECOVERY_PERIOD );
-
- if ( recoveryPeriodString != null )
+ if (_recoveryPeriod != _defaultRecoveryPeriod && tsLogger.arjLogger.isDebugEnabled())
{
- try
- {
- Integer recoveryPeriodInteger = new Integer( recoveryPeriodString );
- _recoveryPeriod = recoveryPeriodInteger.intValue();
-
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug
- ( DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PRIVATE,
- FacilityCode.FAC_CRASH_RECOVERY,
- "com.arjuna.ats.arjuna.recovery.PeriodicRecovery" +
- ": Recovery period set to " + _recoveryPeriod + " seconds" );
- }
- }
- catch (NumberFormatException e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery_6",
- new Object[]{com.arjuna.ats.arjuna.common.Environment.PERIODIC_RECOVERY_PERIOD, recoveryPeriodString});
- }
- }
+ tsLogger.arjLogger.debug
+ ( DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PRIVATE,
+ FacilityCode.FAC_CRASH_RECOVERY,
+ "com.arjuna.ats.arjuna.recovery.PeriodicRecovery" +
+ ": Recovery period set to " + _recoveryPeriod + " seconds" );
}
- _backoffPeriod = _defaultBackoffPeriod;
+ _backoffPeriod = recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryBackoffPeriod();
- String backoffPeriodString=
- arjPropertyManager.getPropertyManager().getProperty(com.arjuna.ats.arjuna.common.Environment.RECOVERY_BACKOFF_PERIOD);
-
- if (backoffPeriodString != null)
+ if (_backoffPeriod != _defaultBackoffPeriod && tsLogger.arjLogger.isDebugEnabled())
{
- try
- {
- Integer backoffPeriodInteger = new Integer(backoffPeriodString);
- _backoffPeriod = backoffPeriodInteger.intValue();
-
- if (tsLogger.arjLogger.isDebugEnabled())
- {
- tsLogger.arjLogger.debug
- ( DebugLevel.FUNCTIONS,
- VisibilityLevel.VIS_PRIVATE,
- FacilityCode.FAC_CRASH_RECOVERY,
- "PeriodicRecovery" +
- ": Backoff period set to " + _backoffPeriod + " seconds" );
- }
- }
- catch (NumberFormatException e)
- {
- if (tsLogger.arjLoggerI18N.isWarnEnabled())
- {
- tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery_7",
- new Object[]{com.arjuna.ats.arjuna.common.Environment.RECOVERY_BACKOFF_PERIOD, backoffPeriodString});
- }
- }
+ tsLogger.arjLogger.debug
+ ( DebugLevel.FUNCTIONS,
+ VisibilityLevel.VIS_PRIVATE,
+ FacilityCode.FAC_CRASH_RECOVERY,
+ "PeriodicRecovery" +
+ ": Backoff period set to " + _backoffPeriod + " seconds" );
}
}
@@ -1121,12 +1082,12 @@
/**
* default value for _backoffPeriod if not specified via property {@link com.arjuna.ats.arjuna.common.Environment#RECOVERY_BACKOFF_PERIOD}
*/
- private static final int _defaultBackoffPeriod = 10;
+ public static final int _defaultBackoffPeriod = 10;
/**
* default value for _recoveryPeriod if not specified via property {@link com.arjuna.ats.arjuna.common.Environment#PERIODIC_RECOVERY_PERIOD}
*/
- private static final int _defaultRecoveryPeriod = 120;
+ public static final int _defaultRecoveryPeriod = 120;
/**
* lock controlling access to {@link PeriodicRecovery#_currentStatus}, {@link PeriodicRecovery#_currentMode} and
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecoveryManagerImple.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecoveryManagerImple.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecoveryManagerImple.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -34,8 +34,7 @@
import java.io.IOException;
import java.util.Vector;
-import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.arjuna.exceptions.FatalError;
import com.arjuna.ats.arjuna.recovery.RecoveryModule;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
@@ -96,10 +95,7 @@
// by default we use a socket based listener, but it can be turned off if not required.
- boolean useListener = true;
- if("NO".equalsIgnoreCase(arjPropertyManager.getPropertyManager().getProperty(Environment.RECOVERY_MANAGER_LISTENER))) {
- useListener = false;
- }
+ boolean useListener = recoveryPropertyManager.getRecoveryEnvironmentBean().isRecoveryListener();
/*
* Check whether there is a recovery daemon running - only allow one per
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/FileProcessId.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/FileProcessId.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/FileProcessId.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -31,21 +31,12 @@
package com.arjuna.ats.internal.arjuna.utils;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.common.util.propertyservice.PropertyManager;
-import com.arjuna.ats.arjuna.utils.Process;
-import com.arjuna.ats.arjuna.utils.Utility;
import java.io.*;
-import java.net.InetAddress;
import com.arjuna.ats.arjuna.exceptions.FatalError;
-import java.net.UnknownHostException;
-import java.lang.NumberFormatException;
-import java.lang.StringIndexOutOfBoundsException;
import java.io.IOException;
-import java.io.FileNotFoundException;
import com.arjuna.ats.arjuna.logging.tsLogger;
@@ -91,7 +82,7 @@
* Use the "var" directory location from the property file.
* If it is not set, create "./var/tmp".
*/
- String dir = arjPropertyManager.getPropertyManager().getProperty(Environment.VAR_DIR);
+ String dir = arjPropertyManager.getCoreEnvironmentBean().getVarDir();
if (dir == null || dir.length() == 0)
dir = System.getProperty("user.dir") + File.separator + "var" + File.separator + "tmp";
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/ManualProcessId.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/ManualProcessId.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/ManualProcessId.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,7 +33,6 @@
import com.arjuna.ats.arjuna.logging.tsLogger;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.exceptions.FatalError;
@@ -104,19 +103,7 @@
{
if (_pid == -1)
{
- String pid = arjPropertyManager.getPropertyManager().getProperty(Environment.PROCESS_IDENTIFIER);
-
- if (pid == null)
- throw new FatalError(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.utils.ManualProcessId_1"));
-
- try
- {
- _pid = Integer.parseInt(pid);
- }
- catch (final Exception ex)
- {
- throw new FatalError(tsLogger.log_mesg.getString("com.arjuna.ats.internal.arjuna.utils.ManualProcessId_3")+" "+pid, ex);
- }
+ _pid = arjPropertyManager.getCoreEnvironmentBean().getPid();
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/SocketProcessId.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/SocketProcessId.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/utils/SocketProcessId.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -71,12 +71,10 @@
{
if (_theSocket == null)
{
- Integer port = Utility.lookupBoundedIntegerProperty(arjPropertyManager.getPropertyManager(), Environment.SOCKET_PROCESS_ID_PORT, _defaultPort,
- "com.arjuna.ats.internal.arjuna.utils.SocketProcessId_1",
- 0, Utility.MAX_PORT);
- Integer maxPorts = Utility.lookupBoundedIntegerProperty(arjPropertyManager.getPropertyManager(), Environment.SOCKET_PROCESS_ID_MAX_PORTS, 1,
- "com.arjuna.ats.internal.arjuna.utils.SocketProcessId_3",
- 0, Utility.MAX_PORT);
+ int port = arjPropertyManager.getCoreEnvironmentBean().getSocketProcessIdPort();
+
+ int maxPorts = arjPropertyManager.getCoreEnvironmentBean().getSocketProcessIdMaxPorts();
+
int maxPort;
if (maxPorts <= 1)
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/CheckedActionTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/CheckedActionTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/atomicaction/CheckedActionTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -21,7 +21,6 @@
package com.hp.mwtests.ts.arjuna.atomicaction;
import com.arjuna.ats.arjuna.AtomicAction;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
import org.junit.Test;
@@ -32,7 +31,7 @@
@Test
public void test()
{
- arjPropertyManager.getPropertyManager().setProperty(Environment.CHECKEDACTION_FACTORY, DummyCheckedActionFactory.class.getCanonicalName());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCheckedActionFactory(DummyCheckedActionFactory.class.getCanonicalName());
AtomicAction A = new AtomicAction();
Added: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/common/BeanPopulatorTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -0,0 +1,62 @@
+/*
+ * 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.arjuna.common;
+
+import com.arjuna.common.internal.util.propertyservice.BeanPopulator;
+import com.arjuna.common.tests.simple.DummyPropertyManager;
+import com.arjuna.ats.arjuna.common.*;
+
+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 testArjunaCorePropertiesPopulation() throws Exception {
+
+ // check that all the ArjunaCore Environment properties are looked for
+ // by the set of beans which wrap them and conversly that no undefined
+ // properties are looked for. i.e. that the Environment and Beans are in sync
+
+ DummyPropertyManager testManager = new DummyPropertyManager(null);
+
+ BeanPopulator.configureFromPropertyManager(new CoordinatorEnvironmentBean(), testManager);
+ BeanPopulator.configureFromPropertyManager(new RecoveryEnvironmentBean(), testManager);
+ BeanPopulator.configureFromPropertyManager(new CoreEnvironmentBean(), testManager);
+ BeanPopulator.configureFromPropertyManager(new ObjectStoreEnvironmentBean(), testManager);
+
+ // we expect this one to be missing - that's ok.
+ testManager.usedKeys.add("com.arjuna.ats.internal.arjuna.inventory.staticInventoryImple");
+
+ Set<String> expectedKeys = new HashSet<String>();
+ expectedKeys.addAll( DummyPropertyManager.extractKeys(Environment.class));
+
+ assertEquals(expectedKeys, testManager.usedKeys);
+ }
+}
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/JDBCInventory.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/JDBCInventory.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/JDBCInventory.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -47,7 +47,7 @@
public void test()
{
arjPropertyManager.getPropertyManager().setProperty(Environment.STATIC_INVENTORY_IMPLE + "1", "com.arjuna.ats.internal.arjuna.objectstore.JDBCStoreSetup");
- arjPropertyManager.getPropertyManager().setProperty(Environment.JDBC_USER_DB_ACCESS, "com.hp.mwtests.ts.arjuna.objectstore.MyAccess");
+ arjPropertyManager.getObjectStoreEnvironmentBean().setJdbcUserDbAccess("com.hp.mwtests.ts.arjuna.objectstore.MyAccess");
boolean passed = false;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,8 +33,8 @@
import com.arjuna.ats.arjuna.ArjunaNames;
import com.arjuna.ats.arjuna.AtomicAction;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.coordinator.ActionStatus;
import com.arjuna.ats.arjuna.recovery.RecoverAtomicAction;
import com.hp.mwtests.ts.arjuna.resources.BasicRecord;
@@ -47,10 +47,10 @@
@Test
public void test()
{
- System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
- System.setProperty(Environment.TRANSACTION_LOG_SYNC_REMOVAL, "false");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setSynchronousRemoval(false);
// the byteman script will enforce this
//System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000"); // essentially infinite
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest2.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest2.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreReactivationTest2.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,8 +33,8 @@
import com.arjuna.ats.arjuna.ArjunaNames;
import com.arjuna.ats.arjuna.AtomicAction;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.coordinator.ActionStatus;
import com.arjuna.ats.arjuna.recovery.RecoverAtomicAction;
import com.hp.mwtests.ts.arjuna.resources.BasicRecord;
@@ -47,10 +47,10 @@
@Test
public void test()
{
- System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
- System.setProperty(Environment.TRANSACTION_LOG_SYNC_REMOVAL, "true");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setSynchronousRemoval(true);
// the byteman script will enforce this
//System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000"); // essentially infinite
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -36,21 +36,29 @@
import com.arjuna.ats.arjuna.state.*;
import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.coordinator.TxControl;
import com.hp.mwtests.ts.arjuna.resources.TestBase;
import org.junit.Test;
+import org.junit.Before;
import static org.junit.Assert.*;
public class LogStoreRecoveryTest extends TestBase
{
+ @Before
+ public void setUp()
+ {
+ System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ System.setProperty(Environment.TRANSACTION_LOG, "ON");
+ System.setProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_LOG_PURGE_TIME, "100");
+
+ super.setUp();
+ }
+
@Test
public void test()
{
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
- //System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "10000");
-
ObjectStore objStore = TxControl.getStore();
final int numberOfTransactions = 1000;
final Uid[] ids = new Uid[numberOfTransactions];
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest2.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest2.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreRecoveryTest2.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -79,12 +79,12 @@
int threads = 10;
int work = 100;
- arjPropertyManager.getPropertyManager().setProperty(Environment.RECOVERY_BACKOFF_PERIOD, "1");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
- System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
- System.setProperty(Environment.TRANSACTION_LOG_SYNC_REMOVAL, "false");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setSynchronousRemoval(false);
// the byteman script will enforce this
//System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "1000000"); // essentially infinite
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -34,8 +34,8 @@
import com.arjuna.ats.arjuna.ArjunaNames;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
import com.arjuna.ats.arjuna.state.*;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.coordinator.TxControl;
import org.junit.Test;
@@ -46,8 +46,8 @@
@Test
public void test()
{
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
+ arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
ObjectStore objStore = TxControl.getStore();
final int numberOfTransactions = 1000;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest2.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest2.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStoreTest2.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -48,6 +48,7 @@
{
System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
System.setProperty(Environment.TRANSACTION_LOG, "ON");
+ System.setProperty(com.arjuna.ats.arjuna.common.Environment.TRANSACTION_LOG_PURGE_TIME, "100");
// the byteman script will manage this
//System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "10000");
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -96,9 +96,9 @@
int threads = 10;
int work = 100;
- System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
// the byteman script will manage this
//System.setProperty(Environment.TRANSACTION_LOG_PURGE_TIME, "10000");
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest2.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest2.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/LogStressTest2.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -49,10 +49,10 @@
@Test
public void test()
{
- System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
- System.setProperty(Environment.OBJECTSTORE_TYPE, ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
- System.setProperty(Environment.TRANSACTION_LOG_SIZE, "10000");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setObjectStoreType(ArjunaNames.Implementation_ObjectStore_ActionLogStore().stringForm());
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
+ arjPropertyManager.getObjectStoreEnvironmentBean().setTxLogSize(10000);
int timeLimit = 4; // hours
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/ObjectStoreTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/ObjectStoreTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/objectstore/ObjectStoreTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,6 +33,7 @@
import com.arjuna.ats.arjuna.ArjunaNames;
import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
import com.arjuna.ats.arjuna.gandiva.ObjectName;
import com.arjuna.ats.arjuna.gandiva.ClassName;
@@ -55,7 +56,7 @@
ObjectName objName = new ObjectName("JNS:myname");
objName.setClassNameAttribute(Environment.OBJECTSTORE_TYPE, imple);
- System.setProperty(Environment.TRANSACTION_LOG, "ON");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setTransactionLog(true);
objName.setStringAttribute(Environment.LOCALOSROOT, localOSRoot);
objName.setStringAttribute(Environment.OBJECTSTORE_DIR, objectStoreDir);
objName.setStringAttribute(Environment.OBJECTSTORE_SHARE, shareStatus);
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/performance/Performance2.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/performance/Performance2.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/performance/Performance2.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -82,7 +82,7 @@
int threads = 10;
int work = 100;
- System.setProperty(Environment.COMMIT_ONE_PHASE, "NO");
+ arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
number = threads;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/CallbackRecoveryTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/CallbackRecoveryTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/CallbackRecoveryTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -31,8 +31,7 @@
package com.hp.mwtests.ts.arjuna.recovery;
-import com.arjuna.ats.arjuna.common.Environment;
-import com.arjuna.ats.arjuna.common.arjPropertyManager;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.arjuna.recovery.*;
import org.junit.Test;
@@ -67,7 +66,7 @@
@Test
public void test()
{
- arjPropertyManager.getPropertyManager().setProperty(Environment.RECOVERY_BACKOFF_PERIOD, "1");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
RecoveryManager manager = RecoveryManager.manager(RecoveryManager.DIRECT_MANAGEMENT);
DummyRecoveryModule module = new DummyRecoveryModule();
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/EmbeddedRecoveryTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/EmbeddedRecoveryTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/EmbeddedRecoveryTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -32,8 +32,7 @@
package com.hp.mwtests.ts.arjuna.recovery;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
-import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -43,7 +42,7 @@
@Test
public void test()
{
- arjPropertyManager.getPropertyManager().setProperty(Environment.RECOVERY_BACKOFF_PERIOD, "1");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
RecoveryManager manager = RecoveryManager.manager(RecoveryManager.DIRECT_MANAGEMENT);
DummyRecoveryModule module = new DummyRecoveryModule();
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/LogMoveTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/LogMoveTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/LogMoveTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -32,12 +32,9 @@
package com.hp.mwtests.ts.arjuna.recovery;
import com.arjuna.ats.arjuna.AtomicAction;
-import com.arjuna.ats.arjuna.common.Environment;
import com.arjuna.ats.arjuna.common.Uid;
import com.arjuna.ats.arjuna.coordinator.TxControl;
import com.arjuna.ats.arjuna.objectstore.ObjectStore;
-import com.arjuna.ats.arjuna.recovery.RecoveryEnvironment;
-import com.arjuna.ats.arjuna.recovery.RecoveryManager;
import com.arjuna.ats.arjuna.state.OutputObjectState;
import com.arjuna.ats.internal.arjuna.recovery.ExpiredTransactionScanner;
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryLifecycleTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryLifecycleTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryLifecycleTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -32,8 +32,7 @@
package com.hp.mwtests.ts.arjuna.recovery;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
-import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -43,7 +42,7 @@
@Test
public void test()
{
- arjPropertyManager.getPropertyManager().setProperty(Environment.RECOVERY_BACKOFF_PERIOD, "1");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
RecoveryManager manager = RecoveryManager.manager(RecoveryManager.DIRECT_MANAGEMENT);
DummyRecoveryModule module = new DummyRecoveryModule();
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/RecoveryManagerStartStopTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -22,7 +22,7 @@
package com.hp.mwtests.ts.arjuna.recovery;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import java.net.Socket;
import java.net.InetAddress;
@@ -46,7 +46,7 @@
@Test
public void testStartStop() throws Exception
{
- System.setProperty(Environment.RECOVERY_MANAGER_PORT, "4712");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryPort(4712);
// check how many threads there are running
@@ -161,7 +161,7 @@
host = InetAddress.getLocalHost().getHostName();
- port = Integer.parseInt(System.getProperty(Environment.RECOVERY_MANAGER_PORT));
+ port = recoveryPropertyManager.getRecoveryEnvironmentBean().getRecoveryPort();
System.out.println("client atempting to connect to host " + host + " port " + port);
System.out.flush();
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/TestBase.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/TestBase.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/resources/TestBase.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -21,7 +21,6 @@
package com.hp.mwtests.ts.arjuna.resources;
import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.common.Environment;
import java.io.File;
@@ -47,7 +46,7 @@
private void emptyObjectStore()
{
- String objectStoreDirName = arjPropertyManager.getPropertyManager().getProperty(Environment.OBJECTSTORE_DIR, com.arjuna.ats.arjuna.common.Configuration.objectStoreRoot());
+ String objectStoreDirName = arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreDir();
System.out.println("Emptying " + objectStoreDirName);
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/perfgraph/PerformanceGraph.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/perfgraph/PerformanceGraph.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/perfgraph/PerformanceGraph.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -34,7 +34,6 @@
import com.arjuna.ats.tools.toolsframework.plugin.ToolPluginException;
import com.arjuna.ats.tools.toolsframework.panels.ATFSettingsPanel;
import com.arjuna.ats.tsmx.TransactionServiceMX;
-import com.arjuna.ats.arjuna.common.Environment;
import javax.swing.*;
import java.awt.event.ActionListener;
@@ -61,7 +60,7 @@
{
createMenu(getMenuBar());
- com.arjuna.ats.arjuna.common.arjPropertyManager.getPropertyManager().setProperty( Environment.ENABLE_STATISTICS, "YES" );
+ com.arjuna.ats.arjuna.common.arjPropertyManager.getCoordinatorEnvironmentBean().setEnableStatistics(true);
TransactionServiceMX.getTransactionServiceMX();
}
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/logging/tsmxLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -53,7 +53,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger * */
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
logger = LogFactory.getLogNoi18n("com.arjuna.ats.tsmx.logging.tsmxLogger");
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/mbeans/PerformanceStatistics.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/mbeans/PerformanceStatistics.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/classes/com/arjuna/ats/tsmx/mbeans/PerformanceStatistics.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -31,12 +31,7 @@
package com.arjuna.ats.tsmx.mbeans;
import com.arjuna.ats.arjuna.coordinator.TxStats;
-import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.common.Environment;
-import com.arjuna.ats.tsmx.mbeans.PerformanceStatisticsMBean;
-import java.util.ArrayList;
-
public class PerformanceStatistics implements PerformanceStatisticsMBean
{
private final static String ICON_FILENAME="performance-icon.gif";
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/lastresource/LastResourceAllowedTestCase.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/lastresource/LastResourceAllowedTestCase.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/lastresource/LastResourceAllowedTestCase.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -31,14 +31,14 @@
import static org.junit.Assert.*;
import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.arjPropertyManager;
public class LastResourceAllowedTestCase
{
@Before
public void setUp() throws Exception
{
- System.setProperty(Environment.ALLOW_MULTIPLE_LAST_RESOURCES, "true") ;
+ arjPropertyManager.getCoreEnvironmentBean().setAllowMultipleLastResources(true);
}
@Test
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/CrashRecovery.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/CrashRecovery.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/CrashRecovery.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -33,8 +33,7 @@
import com.hp.mwtests.ts.jta.common.*;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
-import com.arjuna.ats.arjuna.common.arjPropertyManager;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import javax.transaction.xa.*;
@@ -53,7 +52,7 @@
// set the smallest possible backoff period so we don't have to wait too long for the test to run
- arjPropertyManager.getPropertyManager().setProperty(Environment.RECOVERY_BACKOFF_PERIOD, "1");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
// start the recovery manager
Modified: labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/RecoveryManagerTest.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/RecoveryManagerTest.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/tests/classes/com/hp/mwtests/ts/jta/recovery/RecoveryManagerTest.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -32,7 +32,7 @@
package com.hp.mwtests.ts.jta.recovery;
import com.arjuna.ats.arjuna.recovery.RecoveryManager;
-import com.arjuna.ats.arjuna.common.Environment;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import org.junit.Test;
import static org.junit.Assert.*;
@@ -42,7 +42,7 @@
@Test
public void test()
{
- System.setProperty(Environment.RECOVERY_BACKOFF_PERIOD, "1");
+ recoveryPropertyManager.getRecoveryEnvironmentBean().setRecoveryBackoffPeriod(1);
System.setProperty("com.arjuna.ats.jta.xaRecoveryNode", "1");
System.setProperty("XAResourceRecovery1", "com.hp.mwtests.ts.jta.recovery.DummyXARecoveryResource");
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/contact/ExpiredContactScanner.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -146,33 +146,15 @@
static
{
+ _expiryTime = recoveryPropertyManager.getRecoveryEnvironmentBean().getTransactionStatusManagerExpiryTime() * 60 * 60;
- String expiryTimeString = jtsPropertyManager.getPropertyManager().getProperty
- ( RecoveryEnvironment.TRANSACTION_STATUS_MANAGER_EXPIRY_TIME ) ;
-
- if (expiryTimeString != null)
- {
- try
- {
- Integer expiryTimeInteger = new Integer(expiryTimeString);
- // convert to seconds
- _expiryTime = expiryTimeInteger.intValue() * 60 *60;
-
- if (jtsLogger.loggerI18N.isDebugEnabled())
- {
- jtsLogger.loggerI18N.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_CRASH_RECOVERY,
- "com.arjuna.ats.internal.jts.recovery.ExpiredContactScanner_4",
- new Object[]{Integer.toString(_expiryTime)});
- }
- }
- catch (NumberFormatException e)
- {
- jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.jts.recovery.ExpiredContactScanner_5",
- new Object[]{ RecoveryEnvironment.TRANSACTION_STATUS_MANAGER_EXPIRY_TIME ,
- expiryTimeString});
- }
- }
+ if (jtsLogger.loggerI18N.isDebugEnabled())
+ {
+ jtsLogger.loggerI18N.debug(DebugLevel.CONSTRUCTORS, VisibilityLevel.VIS_PUBLIC,
+ FacilityCode.FAC_CRASH_RECOVERY,
+ "com.arjuna.ats.internal.jts.recovery.ExpiredContactScanner_4",
+ new Object[]{Integer.toString(_expiryTime)});
+ }
}
-};
+}
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/transactions/ExpiredAssumedCompleteScanner.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/transactions/ExpiredAssumedCompleteScanner.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/classes/com/arjuna/ats/internal/jts/recovery/transactions/ExpiredAssumedCompleteScanner.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -37,6 +37,7 @@
import java.text.*;
import com.arjuna.ats.arjuna.common.Uid ;
+import com.arjuna.ats.arjuna.common.recoveryPropertyManager;
import com.arjuna.ats.jts.common.jtsPropertyManager;
import com.arjuna.ats.arjuna.objectstore.ObjectStore ;
import com.arjuna.ats.arjuna.recovery.ExpiryScanner ;
@@ -165,32 +166,14 @@
static
{
+ _expiryTime = recoveryPropertyManager.getRecoveryEnvironmentBean().getTransactionStatusManagerExpiryTime() * 60 * 60;
- String expiryTimeString = jtsPropertyManager.getPropertyManager().getProperty
- ( RecoveryEnvironment.TRANSACTION_STATUS_MANAGER_EXPIRY_TIME ) ;
-
- if (expiryTimeString != null)
- {
- try
- {
- Integer expiryTimeInteger = new Integer(expiryTimeString);
- // convert to seconds
- _expiryTime = expiryTimeInteger.intValue() * 60 *60;
-
-
- if (jtsLogger.loggerI18N.isDebugEnabled())
- {
- jtsLogger.loggerI18N.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
- FacilityCode.FAC_CRASH_RECOVERY,
- "com.arjuna.ats.internal.arjuna.recovery.ExpiredAssumedCompleteScanner_4",
- new Object[]{Integer.toString(_expiryTime)});
- }
- }
- catch (NumberFormatException e)
- {
- jtsLogger.loggerI18N.warn("com.arjuna.ats.internal.arjuna.recovery.ExpiredAssumedCompleteScanner_5", new Object[]{RecoveryEnvironment.TRANSACTION_STATUS_MANAGER_EXPIRY_TIME,expiryTimeString});
- }
- }
+ if (jtsLogger.loggerI18N.isDebugEnabled())
+ {
+ jtsLogger.loggerI18N.debug( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC,
+ FacilityCode.FAC_CRASH_RECOVERY,
+ "com.arjuna.ats.internal.arjuna.recovery.ExpiredAssumedCompleteScanner_4",
+ new Object[]{Integer.toString(_expiryTime)});
+ }
}
-
-};
+}
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src/com/arjuna/webservices/logging/WSCLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -61,7 +61,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger **/
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
arjLogger = LogFactory.getLogNoi18n("com.arjuna.wsc.logging.WSCLogger");
Modified: labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src/com/arjuna/webservices/logging/WSTLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -49,7 +49,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger **/
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
arjLogger = LogFactory.getLogNoi18n("com.arjuna.webservices.logging.WSTLogger");
Modified: labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/XTS/WSAS/classes/com/arjuna/mw/wsas/logging/wsasLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -53,7 +53,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger **/
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
arjLogger = LogFactory.getLogNoi18n("com.arjuna.mw.wsas.logging.wsasLogger");
Modified: labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/XTS/WSCF/classes/com/arjuna/mw/wscf/logging/wscfLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -53,7 +53,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger **/
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
arjLogger = LogFactory.getLogNoi18n("com.arjuna.mw.wscf.logging.wscfLogger");
Modified: labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java 2009-07-29 13:09:51 UTC (rev 28570)
+++ labs/jbosstm/trunk/XTS/WSTX/classes/com/arjuna/mw/wstx/logging/wstxLogger.java 2009-07-29 14:02:33 UTC (rev 28571)
@@ -53,7 +53,7 @@
static
{
/** Ensure the properties are loaded before initialising the logger **/
- arjPropertyManager.getPropertyManager();
+ arjPropertyManager.init();
arjLogger = LogFactory.getLogNoi18n("com.arjuna.mw.wstx.logging.wstxLogger");
More information about the jboss-svn-commits
mailing list