[jboss-svn-commits] JBL Code SVN: r37745 - in labs/jbosstm/trunk: ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jts and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 30 05:30:11 EST 2011


Author: mmusgrov
Date: 2011-11-30 05:30:11 -0500 (Wed, 30 Nov 2011)
New Revision: 37745

Modified:
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceMBean.java
   labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceRecordBean.java
   labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jts/XAResourceRecordBean.java
Log:
[JBTM-967] Expose JNDI name of XA resources

Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceMBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceMBean.java	2011-11-30 10:17:48 UTC (rev 37744)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceMBean.java	2011-11-30 10:30:11 UTC (rev 37745)
@@ -10,6 +10,8 @@
 	String getClassName();
 	@MXBeanPropertyDescription("JNDI name of the JCA resource")
 	String getEisProductName();
+	@MXBeanPropertyDescription("JNDI Name of the datasource")
+	String getJndiName();
 	@MXBeanPropertyDescription("JCA product version")
 	String getEisProductVersion();
 	@MXBeanPropertyDescription("The number of seconds before the resource can rollback the branch")

Modified: labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceRecordBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceRecordBean.java	2011-11-30 10:17:48 UTC (rev 37744)
+++ labs/jbosstm/trunk/ArjunaJTA/jta/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jta/XAResourceRecordBean.java	2011-11-30 10:30:11 UTC (rev 37745)
@@ -5,6 +5,7 @@
 import com.arjuna.ats.arjuna.tools.osb.mbean.ParticipantStatus;
 import com.arjuna.ats.arjuna.tools.osb.mbean.LogRecordWrapper;
 import com.arjuna.ats.arjuna.tools.osb.mbean.UidWrapper;
+import com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord;
 
 import javax.transaction.xa.XAResource;
 
@@ -15,6 +16,7 @@
     String className = "unavailable";
     String eisProductName = "unavailable";
     String eisProductVersion = "unavailable";
+    String jndiName = "unavailable";
     int timeout = 0;
 
     public XAResourceRecordBean(UidWrapper w) {
@@ -29,10 +31,18 @@
         boolean ok = super.activate();
         XAResource xares = (XAResource) rec.value();
 
+        className = rec.getClass().getName();
+
+        if (rec instanceof XAResourceRecord) {
+            XAResourceRecord xarec = (XAResourceRecord) rec;
+
+            eisProductName = xarec.getProductName();
+            eisProductVersion = xarec.getProductVersion();
+            jndiName = xarec.getJndiName();
+        }
+
         if (xares != null) {
             className = xares.getClass().getName();
-            eisProductName = callMethod(xares, "getEisProductName");
-            this.eisProductVersion = callMethod(xares, "getEisProductVersion");
 
             try {
                 timeout = xares.getTransactionTimeout();
@@ -46,5 +56,6 @@
     public String getClassName() { return className; }
     public String getEisProductName() { return eisProductName; }
     public String getEisProductVersion() { return eisProductVersion; }
+    public String getJndiName() { return jndiName; }
     public int getTimeout() { return timeout; }
 }

Modified: labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jts/XAResourceRecordBean.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jts/XAResourceRecordBean.java	2011-11-30 10:17:48 UTC (rev 37744)
+++ labs/jbosstm/trunk/ArjunaJTS/jtax/classes/com/arjuna/ats/internal/jta/tools/osb/mbean/jts/XAResourceRecordBean.java	2011-11-30 10:30:11 UTC (rev 37745)
@@ -6,6 +6,7 @@
 import com.arjuna.ats.arjuna.tools.osb.mbean.ParticipantStatus;
 import com.arjuna.ats.arjuna.tools.osb.mbean.LogRecordWrapper;
 import com.arjuna.ats.arjuna.tools.osb.mbean.UidWrapper;
+import com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord;
 
 /**
  * MBean implementation of a transaction participant corresponding to a JTA XAResource
@@ -15,6 +16,7 @@
     String className = "unavailable";
     String eisProductName = "unavailable";
     String eisProductVersion = "unavailable";
+    String jndiName = "unavailable";
     int timeout = 0;
 
     public XAResourceRecordBean(UidWrapper w) {
@@ -29,6 +31,8 @@
     public String getClassName() { return className; }
     public String getEisProductName() { return eisProductName; }
     public String getEisProductVersion() { return eisProductVersion; }
+    public String getJndiName() {
+        return jndiName; }
     public int getTimeout() { return timeout; }
 
     /**
@@ -40,7 +44,7 @@
 
             if (_theXAResource != null) {
                 XAResourceRecordBean.this.className = _theXAResource.getClass().getName();
-                XAResourceRecordBean.this.eisProductName = callMethod(_theXAResource, "getEisProductName");
+                XAResourceRecordBean.this.eisProductName =  callMethod(_theXAResource, "getEisProductName");
                 XAResourceRecordBean.this.eisProductVersion = callMethod(_theXAResource, "getEisProductVersion");
 
                 try {



More information about the jboss-svn-commits mailing list