[jboss-svn-commits] JBL Code SVN: r22857 - in labs/jbosstm/trunk: ArjunaCore/tsmx/etc/objectstorebrowser and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Sep 17 14:22:03 EDT 2008
Author: mmusgrov
Date: 2008-09-17 14:22:03 -0400 (Wed, 17 Sep 2008)
New Revision: 22857
Added:
labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/ToolInitializer.java
Removed:
labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTAToolInitializer.java
labs/jbosstm/trunk/ArjunaJTS/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTSToolInitializer.java
Modified:
labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/PluginClassloader.java
labs/jbosstm/trunk/ArjunaCore/tsmx/etc/objectstorebrowser/tools.properties
Log:
Added fixes so that the tools sar produced by the JTA and JTS builds work with the AS irrespective of which version of JBossTS is used in the AS.
JBTM-382
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/PluginClassloader.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/PluginClassloader.java 2008-09-17 17:50:53 UTC (rev 22856)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/PluginClassloader.java 2008-09-17 18:22:03 UTC (rev 22857)
@@ -66,6 +66,7 @@
if (files == null) /* Directory not found */
return;
ArrayList urls = new ArrayList();
+ ArrayList<String> plugins = new ArrayList<String> ();
for (int count=0;count<files.length;count++)
{
@@ -90,7 +91,7 @@
/** Add the URL of the file to urls list **/
urls.add(files[count].toURL());
/** Add the classname to the list - which will later be replaced with the actual class **/
- _plugins.add(classname);
+ plugins.add(classname);
}
}
}
@@ -111,30 +112,29 @@
_urlClassloader = new URLClassLoader(jarUrls, this.getClass().getClassLoader());
/** Go through list of classnames and convert into object instances **/
- for (int count=0;count<_plugins.size();count++)
+ for (String obj : plugins)
{
- Object obj = _plugins.get(count);
-
/** if it's a string then we need to convert it into a instance of that class **/
- if ( obj instanceof String )
- {
try
{
Object instance = _urlClassloader.loadClass((String)obj).newInstance();
/** Override the classname with the instance of that class **/
- _plugins.set(count, instance);
+ _plugins.add(instance);
}
catch (ClassNotFoundException e)
{
- System.err.println("The class '"+obj+"' cannot be found");
+ System.err.println("Warning: The class '"+obj+"' cannot be found");
// Ignore - invalid configuration
}
+ catch (NoClassDefFoundError e)
+ {
+ System.err.println("Warning: The class '"+obj+"' is not defined");
+ }
catch (Exception e)
{
- System.err.println("Could not instantiate the class '"+obj+"' - " + e.getMessage());
+ System.err.println("Warning: cCould not instantiate the class '"+obj+"' - " + e.getMessage());
}
- }
}
}
Modified: labs/jbosstm/trunk/ArjunaCore/tsmx/etc/objectstorebrowser/tools.properties
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/tsmx/etc/objectstorebrowser/tools.properties 2008-09-17 17:50:53 UTC (rev 22856)
+++ labs/jbosstm/trunk/ArjunaCore/tsmx/etc/objectstorebrowser/tools.properties 2008-09-17 18:22:03 UTC (rev 22857)
@@ -25,6 +25,6 @@
# Tool Properties
com.arjuna.mwtools.objectstorebrowser.rootprovider=com.arjuna.ats.tools.objectstorebrowser.rootprovider.providers.DefaultRootProvider
-com.arjuna.mwtools.objectstorebrowser.initializer=com.arjuna.ats.tools.objectstorebrowser.JTSToolInitializer
-com.arjuna.mwtools.objectstorebrowser.altinitializer=com.arjuna.ats.tools.objectstorebrowser.JTAToolInitializer
+com.arjuna.mwtools.objectstorebrowser.initializer=com.arjuna.ats.tools.objectstorebrowser.ToolInitializer
+com.arjuna.mwtools.objectstorebrowser.altinitializer=com.arjuna.ats.tools.objectstorebrowser.ToolInitializer
com.arjuna.mwtools.objectstorebrowser.entityviewers.com.arjuna.ats.tools.objectstorebrowser.entityviewer.viewers.resource.ResourceActionHandle=com.arjuna.ats.tools.objectstorebrowser.entityviewer.viewers.resource.ResourceEntityViewer
\ No newline at end of file
Deleted: labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTAToolInitializer.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTAToolInitializer.java 2008-09-17 17:50:53 UTC (rev 22856)
+++ labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTAToolInitializer.java 2008-09-17 18:22:03 UTC (rev 22857)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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) 2008,
- * @author JBoss Inc.
- */
-package com.arjuna.ats.tools.objectstorebrowser;
-
-import com.arjuna.ats.tools.objectstorebrowser.rootprovider.InFlightTransactionPseudoStore;
-import com.arjuna.ats.tools.objectstorebrowser.stateviewers.viewers.UidInfo;
-import com.arjuna.ats.tools.toolsframework.plugin.ToolPlugin;
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.ats.internal.arjuna.utils.XATxConverter;
-import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple;
-import com.arjuna.ats.jta.xa.XidImple;
-
-import javax.transaction.xa.Xid;
-import javax.transaction.Transaction;
-import java.util.Map;
-
-public class JTAToolInitializer implements IToolInitializer
-{
- public void initialize(ToolPlugin plugin)
- {
- com.arjuna.ats.internal.jta.Implementations.initialise(); // needed for XAResourceRecord
-
- InFlightTransactionPseudoStore.setTransactionLister(new TransactionLister(){
- public Map<Uid, Transaction> getTransactions()
- {
- return TransactionImple.getTransactions();
- }
- });
-
- UidInfo.setUidConverter(new UidConverter() {
-
- public Uid toUid(Xid xid)
- {
- if (xid instanceof XidImple)
- return XATxConverter.getUid(((XidImple) xid).getXID());
-
- return null;
- }
- });
- }
-}
Added: labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/ToolInitializer.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/ToolInitializer.java (rev 0)
+++ labs/jbosstm/trunk/ArjunaJTA/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/ToolInitializer.java 2008-09-17 18:22:03 UTC (rev 22857)
@@ -0,0 +1,51 @@
+package com.arjuna.ats.tools.objectstorebrowser;
+
+import com.arjuna.ats.tools.toolsframework.plugin.ToolPlugin;
+import com.arjuna.ats.tools.objectstorebrowser.rootprovider.InFlightTransactionPseudoStore;
+import com.arjuna.ats.tools.objectstorebrowser.stateviewers.viewers.UidInfo;
+import com.arjuna.ats.arjuna.common.Uid;
+import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple;
+import com.arjuna.ats.internal.arjuna.utils.XATxConverter;
+import com.arjuna.ats.jta.xa.XidImple;
+
+import javax.transaction.Transaction;
+import javax.transaction.xa.Xid;
+import java.util.Map;
+
+public class ToolInitializer implements IToolInitializer
+{
+ public void initialize(ToolPlugin plugin)
+ {
+ com.arjuna.ats.internal.jta.Implementations.initialise(); // needed for XAResourceRecord
+
+ try
+ {
+ Class<?> c1 = Class.forName("com.arjuna.ats.internal.jts.Implementations");
+ Class<?> c2 = Class.forName("com.arjuna.ats.internal.jta.Implementationsx"); // needed for XAResourceRecord
+
+ c1.getMethod("initialise").invoke(null);
+ c2.getMethod("initialise").invoke(null);
+ }
+ catch (Exception e)
+ {
+ // not JTS
+ }
+
+ InFlightTransactionPseudoStore.setTransactionLister(new TransactionLister(){
+ public Map<Uid, Transaction> getTransactions()
+ {
+ return TransactionImple.getTransactions();
+ }
+ });
+
+ UidInfo.setUidConverter(new UidConverter() {
+
+ public Uid toUid(Xid xid)
+ {
+ if (xid instanceof XidImple)
+ return XATxConverter.getUid(((XidImple) xid).getXID());
+
+ return null;
+ }
+ }); }
+}
Deleted: labs/jbosstm/trunk/ArjunaJTS/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTSToolInitializer.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTSToolInitializer.java 2008-09-17 17:50:53 UTC (rev 22856)
+++ labs/jbosstm/trunk/ArjunaJTS/tsmx/bin/com/arjuna/ats/tools/objectstorebrowser/JTSToolInitializer.java 2008-09-17 18:22:03 UTC (rev 22857)
@@ -1,61 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, 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) 2008,
- * @author JBoss Inc.
- */
-package com.arjuna.ats.tools.objectstorebrowser;
-
-import com.arjuna.ats.tools.toolsframework.plugin.ToolPlugin;
-import com.arjuna.ats.tools.objectstorebrowser.stateviewers.viewers.UidInfo;
-import com.arjuna.ats.tools.objectstorebrowser.rootprovider.InFlightTransactionPseudoStore;
-import com.arjuna.ats.arjuna.common.Uid;
-import com.arjuna.ats.jta.xa.XidImple;
-import com.arjuna.ats.internal.arjuna.utils.XATxConverter;
-import com.arjuna.ats.internal.jta.transaction.jts.TransactionImple;
-
-import javax.transaction.xa.Xid;
-import javax.transaction.Transaction;
-import java.util.Map;
-
-public class JTSToolInitializer implements IToolInitializer
-{
- public void initialize(ToolPlugin plugin)
- {
- com.arjuna.ats.internal.jts.Implementations.initialise();
- com.arjuna.ats.internal.jta.Implementationsx.initialise(); // needed for XAResourceRecord
- com.arjuna.ats.internal.jta.Implementations.initialise(); // needed for XAResourceRecord
-
- InFlightTransactionPseudoStore.setTransactionLister(new TransactionLister(){
- public Map<Uid, Transaction> getTransactions()
- {
- return TransactionImple.getTransactions();
- }
- });
-
- UidInfo.setUidConverter(new UidConverter() {
-
- public Uid toUid(Xid xid)
- {
- if (xid instanceof XidImple)
- return XATxConverter.getUid(((XidImple) xid).getXID());
-
- return null;
- }
- });
- }
-}
More information about the jboss-svn-commits
mailing list