[jboss-svn-commits] JBL Code SVN: r12709 - in labs/jbosstm/trunk: ArjunaCore/arjuna/etc and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Jun 20 08:17:46 EDT 2007
Author: jhalliday
Date: 2007-06-20 08:17:46 -0400 (Wed, 20 Jun 2007)
New Revision: 12709
Modified:
labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java
labs/jbosstm/trunk/ArjunaCore/arjuna/etc/default-arjuna-properties.xml
labs/jbosstm/trunk/ArjunaCore/docs/user_guide/ProgrammersGuide.doc
labs/jbosstm/trunk/ArjunaJTS/jts/etc/jts.properties_default
Log:
Merged JBTM-236 and JBTM-237 reaper changes from branch to trunk.
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 2007-06-20 11:57:11 UTC (rev 12708)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/arjuna/coordinator/TransactionReaper.java 2007-06-20 12:17:46 UTC (rev 12709)
@@ -123,12 +123,15 @@
{
if (_dynamic)
{
- try
- {
- final ReaperElement head = (ReaperElement) _transactions.first(); //_list.peak();
- return head._absoluteTimeout - System.currentTimeMillis();
- }
- catch (final NoSuchElementException nsee) {} // fall through
+ try
+ {
+ final ReaperElement head = (ReaperElement) _transactions.first(); //_list.peak();
+ return head._absoluteTimeout - System.currentTimeMillis();
+ }
+ catch (final NoSuchElementException nsee)
+ {
+ return Long.MAX_VALUE; // list is empty, so we can sleep until something is inserted.
+ }
}
return _checkPeriod;
}
@@ -332,40 +335,26 @@
* Ignore if it's already in the list with a different timeout.
* (This should never happen)
*/
- if (_timeouts.containsKey(control)) {
+ if (_timeouts.containsKey(control)) {
return false;
}
- ReaperElement e = new ReaperElement(control, timeout);
+ ReaperElement e = new ReaperElement(control, timeout);
synchronized (this)
{
TransactionReaper._lifetime += timeout;
- /*
- * If the timeout for this transaction is less than the current
- * timeout for the reaper thread (or one is not set for the reaper
- * thread) then use that timeout and interrupt the thread to get it
- * to recheck.
- */
+ _timeouts.put(control, e);
+ boolean rtn = _transactions.add(e);
- final long timeoutms = timeout * 1000;
- if ((timeoutms < _checkPeriod) || (_checkPeriod == Long.MAX_VALUE))
+ if(_dynamic)
{
- _checkPeriod = timeoutms; // convert to milliseconds!
- notify();
+ notify(); // force recalc of next wakeup time, taking into account the newly inserted element
}
- }
- /*
- * Can release the lock because the collection is internally synchronized.
- */
-
- synchronized (this)
- {
- _timeouts.put(control, e);
- return _transactions.add(e);
- }
+ return rtn;
+ }
}
public final boolean remove(java.lang.Object control)
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/etc/default-arjuna-properties.xml
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/etc/default-arjuna-properties.xml 2007-06-20 11:57:11 UTC (rev 12708)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/etc/default-arjuna-properties.xml 2007-06-20 12:17:46 UTC (rev 12709)
@@ -1,21 +1,21 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
JBoss, Home of Professional Open Source
- Copyright 2006, Red Hat Middleware LLC, and individual contributors
- as indicated by the @author tags.
+ Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ as indicated by the @author tags.
See the copyright.txt in the distribution for a
- full listing of individual contributors.
+ 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
+ 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,
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
-
+
(C) 2005-2006,
@author JBoss Inc.
-->
@@ -23,7 +23,7 @@
<!--
These options are described in the ArjunaJTS manual.
Defaults are provided here for convenience only.
-
+
Please read through this file prior to using the system, and consider
updating the specified entries.
-->
@@ -32,7 +32,7 @@
xsi:noNamespaceSchemaLocation="transaction-service-2_0.xsd">
<properties name="arjuna" depends="common">
<!--
- Transaction Reaper Timeout (default is 120000 microseconds).
+ Transaction Reaper Timeout (default is 120000 ms).
-->
<property
name="com.arjuna.ats.arjuna.coordinator.txReaperTimeout"
Modified: labs/jbosstm/trunk/ArjunaCore/docs/user_guide/ProgrammersGuide.doc
===================================================================
(Binary files differ)
Modified: labs/jbosstm/trunk/ArjunaJTS/jts/etc/jts.properties_default
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jts/etc/jts.properties_default 2007-06-20 11:57:11 UTC (rev 12708)
+++ labs/jbosstm/trunk/ArjunaJTS/jts/etc/jts.properties_default 2007-06-20 12:17:46 UTC (rev 12709)
@@ -1,24 +1,24 @@
#
# JBoss, Home of Professional Open Source
# Copyright 2006, Red Hat Middleware LLC, and individual contributors
-# as indicated by the @author tags.
-# See the copyright.txt in the distribution for a full listing
+# 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 General Public License, v. 2.0.
-# 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
+# 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 General Public License for more details.
# You should have received a copy of the GNU General Public License,
# v. 2.0 along with this distribution; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
-#
+#
# (C) 2005-2006,
# @author JBoss Inc.
#
-#
+#
# Copyright (C) 1999-2001 by HP Bluestone Software, Inc. All rights Reserved.
#
# HP Arjuna Labs,
@@ -37,7 +37,7 @@
# updating the specified entries.
#
-# Transaction Reaper Timeout (default is 120000 microseconds)
+# Transaction Reaper Timeout (default is 120000 ms)
com.arjuna.ats.jts.txReaperTimeout=120000
# Transaction Reaper Mode, can be: NORMAL or DYNAMIC (default is NORMAL)
More information about the jboss-svn-commits
mailing list