[jboss-svn-commits] JBL Code SVN: r8433 - labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Dec 20 06:46:34 EST 2006
Author: jhalliday
Date: 2006-12-20 06:46:33 -0500 (Wed, 20 Dec 2006)
New Revision: 8433
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/RecActivatorLoader.java
Log:
Added typecast in compareTo calls to fix compilation issue.
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 2006-12-20 11:41:26 UTC (rev 8432)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/PeriodicRecovery.java 2006-12-20 11:46:33 UTC (rev 8433)
@@ -1,20 +1,20 @@
/*
* 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.
*/
@@ -59,7 +59,7 @@
* modules. These modules are dynamically loaded. The modules to load
* are specified by properties beginning with "RecoveryExtension"
* <P>
- * @author
+ * @author
* @version $Id: PeriodicRecovery.java 2342 2006-03-30 13:06:17Z $
*
* @message com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery_1 [com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery_1] - Attempt to load recovery module with null class name!
@@ -157,7 +157,7 @@
public void run ()
{
boolean finished = false;
-
+
do
{
finished = doWork(true);
@@ -180,18 +180,18 @@
public final boolean doWork (boolean periodic)
{
boolean interrupted = false;
-
- tsLogger.arjLogger.info("Periodic recovery - first pass <" +
+
+ tsLogger.arjLogger.info("Periodic recovery - first pass <" +
_theTimestamper.format(new Date()) + ">" );
-
+
Enumeration modules = _recoveryModules.elements();
-
+
while (modules.hasMoreElements())
{
RecoveryModule m = (RecoveryModule) modules.nextElement();
m.periodicWorkFirstPass();
-
+
if (tsLogger.arjLogger.isDebugEnabled())
{
tsLogger.arjLogger.debug( DebugLevel.FUNCTIONS,
@@ -207,7 +207,7 @@
_workerService.signalDone();
}
-
+
// wait for a bit to avoid catching (too many) transactions etc. that
// are really progressing quite happily
@@ -224,18 +224,18 @@
{
return true;
}
-
+
tsLogger.arjLogger.info("Periodic recovery - second pass <"+
_theTimestamper.format(new Date()) + ">" );
-
+
modules = _recoveryModules.elements();
-
+
while (modules.hasMoreElements())
{
RecoveryModule m = (RecoveryModule) modules.nextElement();
-
+
m.periodicWorkSecondPass();
-
+
if (tsLogger.arjLogger.isDebugEnabled())
{
tsLogger.arjLogger.debug ( DebugLevel.FUNCTIONS, VisibilityLevel.VIS_PUBLIC, FacilityCode.FAC_CRASH_RECOVERY, " " );
@@ -259,7 +259,7 @@
return false; // keep going
}
-
+
/**
* Add the specified module to the end of the recovery module list.
* There is no way to specify relative ordering of recovery modules
@@ -281,7 +281,7 @@
{
return _recoveryModules;
}
-
+
/**
* Load recovery modules prior to starting to recovery. The property
* name of each module is used to indicate relative ordering.
@@ -307,7 +307,7 @@
int position = 0;
while ( position < moduleNames.size() &&
- attrName.compareTo( moduleNames.elementAt(position)) > 0 )
+ attrName.compareTo( (String)moduleNames.elementAt(position)) > 0 )
{
position++;
}
@@ -336,7 +336,7 @@
"Loading recovery module "+
className );
}
-
+
if (className == null)
{
if (tsLogger.arjLoggerI18N.isWarnEnabled())
@@ -405,24 +405,24 @@
// back off period is the time between the first and second pass.
// recovery period is the time between the second pass and the start
- // of the first pass.
+ // of the first pass.
private static int _backoffPeriod = 0;
private static int _recoveryPeriod = 0;
-
+
// default values for the above
private static final int _defaultBackoffPeriod = 10;
private static final int _defaultRecoveryPeriod = 120;
// exit thread flag
private static boolean _terminate = false;
-
+
private static SimpleDateFormat _theTimestamper = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss");
private static ServerSocket _socket = null;
private static Listener _listener = null;
private static WorkerService _workerService = null;
-
+
/*
* Read the system properties to set the configurable options
*
@@ -434,7 +434,7 @@
{
_recoveryPeriod = _defaultRecoveryPeriod;
- String recoveryPeriodString =
+ String recoveryPeriodString =
arjPropertyManager.propertyManager.getProperty(com.arjuna.ats.arjuna.common.Environment.PERIODIC_RECOVERY_PERIOD );
if ( recoveryPeriodString != null )
@@ -447,7 +447,7 @@
if (tsLogger.arjLogger.isDebugEnabled())
{
tsLogger.arjLogger.debug
- ( DebugLevel.FUNCTIONS,
+ ( DebugLevel.FUNCTIONS,
VisibilityLevel.VIS_PRIVATE,
FacilityCode.FAC_CRASH_RECOVERY,
"com.arjuna.ats.arjuna.recovery.PeriodicRecovery" +
@@ -480,7 +480,7 @@
if (tsLogger.arjLogger.isDebugEnabled())
{
tsLogger.arjLogger.debug
- ( DebugLevel.FUNCTIONS,
+ ( DebugLevel.FUNCTIONS,
VisibilityLevel.VIS_PRIVATE,
FacilityCode.FAC_CRASH_RECOVERY,
"PeriodicRecovery" +
Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecActivatorLoader.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecActivatorLoader.java 2006-12-20 11:41:26 UTC (rev 8432)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/classes/com/arjuna/ats/internal/arjuna/recovery/RecActivatorLoader.java 2006-12-20 11:46:33 UTC (rev 8433)
@@ -1,20 +1,20 @@
/*
* 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.
*/
@@ -58,16 +58,16 @@
public RecActivatorLoader()
{
initialise();
-
+
// Load the Recovery Activators
loadRecoveryActivators();
-
+
startRecoveryActivators();
-
+
}
-
+
/**
- * Start the RecoveryActivator
+ * Start the RecoveryActivator
*/
public void startRecoveryActivators()
@@ -85,31 +85,31 @@
RecoveryActivator acti = (RecoveryActivator) activators.nextElement();
acti.startRCservice();
}
-
+
return;
-
+
}
-
+
private static void loadRecoveryActivators ()
{
// scan the relevant properties so as to get them into sort order
Properties properties = arjPropertyManager.propertyManager.getProperties();
-
+
if (properties != null)
{
Vector activatorNames = new Vector();
Enumeration names = properties.propertyNames();
-
+
while (names.hasMoreElements())
{
String attrName = (String) names.nextElement();
-
+
if (attrName.startsWith(RecoveryEnvironment.ACTIVATOR_PROPERTY_PREFIX) )
{
// this is one of ours - put it in the right place
int position = 0;
while ( position < activatorNames.size() &&
- attrName.compareTo( activatorNames.elementAt(position)) > 0 )
+ attrName.compareTo( (String)activatorNames.elementAt(position)) > 0 )
{
position++;
}
@@ -118,16 +118,16 @@
}
// now go through again and load them
names = activatorNames.elements();
-
+
while (names.hasMoreElements())
{
String attrName = (String) names.nextElement();
loadActivator(properties.getProperty(attrName));
}
-
+
}
}
-
+
private static void loadActivator (String className)
{
if (tsLogger.arjLogger.isDebugEnabled())
@@ -138,12 +138,12 @@
"Loading recovery activator "+
className ) ;
}
-
+
if (className == null)
{
if (tsLogger.arjLoggerI18N.isWarnEnabled())
tsLogger.arjLoggerI18N.warn("com.arjuna.ats.internal.arjuna.recovery.RecActivatorLoader_1");
-
+
return;
}
else
@@ -151,7 +151,7 @@
try
{
Class c = Thread.currentThread().getContextClassLoader().loadClass( className ) ;
-
+
try
{
RecoveryActivator ra = (RecoveryActivator) c.newInstance() ;
@@ -181,7 +181,7 @@
new Object[]{ie});
}
}
-
+
c = null;
}
catch ( ClassNotFoundException cnfe )
@@ -194,16 +194,16 @@
}
}
}
-
+
private final void initialise ()
{
_recoveryActivators = new Vector();
}
-
+
// this refers to the recovery activators specified in the recovery manager
// property file which are dynamically loaded.
private static Vector _recoveryActivators = null ;
-
+
}
More information about the jboss-svn-commits
mailing list