[jboss-svn-commits] JBL Code SVN: r8139 - in labs/jbosstm/trunk/atsintegration: . classes/com/arjuna/ats/jbossatx/jta classes/com/arjuna/ats/jbossatx/jts

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Dec 8 09:28:14 EST 2006


Author: jhalliday
Date: 2006-12-08 09:28:11 -0500 (Fri, 08 Dec 2006)
New Revision: 8139

Modified:
   labs/jbosstm/trunk/atsintegration/build.xml
   labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java
   labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jts/TransactionManagerService.java
Log:
Added static init block to the TransactionManager MBeans to configure
the new logging plugin per JBTM-20.
Tweaked integration build script to build against the new JBossAS 5.0 jar file layout.


Modified: labs/jbosstm/trunk/atsintegration/build.xml
===================================================================
--- labs/jbosstm/trunk/atsintegration/build.xml	2006-12-08 13:26:15 UTC (rev 8138)
+++ labs/jbosstm/trunk/atsintegration/build.xml	2006-12-08 14:28:11 UTC (rev 8139)
@@ -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.
 -->
@@ -31,7 +31,7 @@
     <property file="${com.arjuna.mw.ts.properties}"/>
 
     <property environment="env"/>
-	
+
 	<!-- configure dependencies -->
 	<property name="com.arjuna.buildsystem.dir" location="${buildsystem.dir}"/>
 	<property name="com.arjuna.buildsystem.build.lib" location="${com.arjuna.buildsystem.dir}/build/lib"/>
@@ -97,7 +97,7 @@
             <fileset dir="${com.arjuna.buildsystem.build.lib}"/>
         </path>
         <property name="com.arjuna.buildsystem.classpath" refid="com.arjuna.buildsystem.classpath"/>
-    	
+
         <!-- Installation directory -->
         <property name="com.arjuna.mwlabs.installationdirectory"
             location="${com.hp.mw.installationdirectory}"/>
@@ -118,8 +118,9 @@
         <!-- Make the destination directory -->
         <mkdir dir="${com.arjuna.mwlabs.ts.jbossatx.dest}"/>
 
-        <!-- libs from JBoss App Server installation -->
-        <property name="jboss.libs" value="jboss-common.jar jboss-system.jar jboss-jmx.jar"/>
+        <!-- libs from JBoss App Server installation. Note: these jars were refactored between
+          AS 4.x and AS 5.0. The list below is a hybrid to allow building against either version. -->
+        <property name="jboss.libs" value="jboss-common.jar jboss-system.jar jboss-jmx.jar jboss-logging-spi.jar jboss-common-core.jar jboss-j2se.jar jboss-system-jmx.jar"/>
         <property name="jboss.server.jta.libs" value="jmx-adaptor-plugin.jar jboss-transaction.jar"/>
         <property name="jboss.server.jts.libs" value="jboss-iiop.jar jacorb.jar"/>
         <condition property="jboss.server.libs" value="${jboss.server.jta.libs} ${jboss.server.jts.libs}">
@@ -162,7 +163,7 @@
     </target>
 
     <!-- Jar targets -->
-    <target name="com.arjuna.mw.ts.jbossatx.jar" 
+    <target name="com.arjuna.mw.ts.jbossatx.jar"
         depends="com.arjuna.mwlabs.ts.jbossatx.service.compile">
 
         <echo message="Building jar file"/>
@@ -185,9 +186,9 @@
                 <include name="**/*.jpg"/>
             </fileset>
         </copy>
-        <style processor="trax" 
-               style="${com.arjuna.mwlabs.ts.jbossatx.docs.src}/xsl/ATL_LookAndFeel.xsl" 
-               basedir="${com.arjuna.mwlabs.ts.jbossatx.docs.src}/docs/" 
+        <style processor="trax"
+               style="${com.arjuna.mwlabs.ts.jbossatx.docs.src}/xsl/ATL_LookAndFeel.xsl"
+               basedir="${com.arjuna.mwlabs.ts.jbossatx.docs.src}/docs/"
                includes="*.xml" destdir="${com.arjuna.mwlabs.ts.jbossatx.docs.dest}" extension=".html">
            <param name="rootpath" expression="."/>
         </style>

Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java	2006-12-08 13:26:15 UTC (rev 8138)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jta/TransactionManagerService.java	2006-12-08 14:28:11 UTC (rev 8139)
@@ -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.
  */
@@ -50,6 +50,7 @@
 import com.arjuna.ats.internal.tsmx.mbeans.PropertyServiceJMXPlugin;
 import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
 import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.logging.LogFactory;
 
 import javax.management.InstanceNotFoundException;
 import javax.management.Notification;
@@ -74,8 +75,19 @@
  */
 public class TransactionManagerService extends ServiceMBeanSupport implements TransactionManagerServiceMBean, NotificationListener
 {
-    public final static String PROPAGATE_FULL_CONTEXT_PROPERTY = "com.arjuna.ats.jbossatx.jta.propagatefullcontext";
+    static {
+		/*
+		 * Override the defualt logging config, force use of the plugin that rewrites log levels to reflect app server level semantics.
+		 * This must be done before the loading of anything that uses the logging, otherwise it's too late to take effect.
+		 * Hence the static initializer block.
+		 * see also http://jira.jboss.com/jira/browse/JBTM-20
+		 */
+		com.arjuna.ats.arjuna.common.arjPropertyManager.propertyManager.setProperty(LogFactory.LOGGER_PROPERTY, "log4j_releveler");
+		//System.setProperty(LogFactory.LOGGER_PROPERTY, "log4j_releveler") ;
+	}
 
+	public final static String PROPAGATE_FULL_CONTEXT_PROPERTY = "com.arjuna.ats.jbossatx.jta.propagatefullcontext";
+
     private final static String SERVICE_NAME = "TransactionManagerService";
     private final static String PROPAGATION_CONTEXT_IMPORTER_JNDI_REFERENCE = "java:/TransactionPropagationContextImporter";
     private final static String PROPAGATION_CONTEXT_EXPORTER_JNDI_REFERENCE = "java:/TransactionPropagationContextExporter";
@@ -102,6 +114,7 @@
      */
     protected void startService() throws Exception
     {
+
         this.getLog().info("JBossTS Transaction Service (JTA version) - JBoss Inc.");
 
         this.getLog().info("Setting up property manager MBean and JMX layer");
@@ -133,7 +146,7 @@
             if (_runRM)
             {
                 registerNotification() ;
-                
+
                 this.getLog().info("Starting recovery manager");
 
                 RecoveryManager.delayRecoveryManagerThread() ;
@@ -169,7 +182,7 @@
 
         JNDIManager.bindJTATransactionManagerImplementation();
     }
-    
+
     /**
      * Handle JMX notification.
      * @param notification The JMX notification event.
@@ -290,10 +303,10 @@
     {
         return com.arjuna.ats.jta.TransactionManager.transactionManager();
     }
-    
+
     /**
      * Get the XA Terminator
-     * 
+     *
      * @return the XA Terminator
      */
     public JBossXATerminator getXATerminator()
@@ -412,12 +425,12 @@
     {
         final NotificationFilterSupport notificationFilter = new NotificationFilterSupport() ;
         notificationFilter.enableType(Server.START_NOTIFICATION_TYPE) ;
-        
+
         final ObjectName serverName = ObjectNameFactory.create("jboss.system:type=Server") ;
-        
+
         getServer().addNotificationListener(serverName, this, notificationFilter, null) ;
     }
-    
+
     private void bindRef(String jndiName, String className)
             throws Exception
     {

Modified: labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jts/TransactionManagerService.java
===================================================================
--- labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jts/TransactionManagerService.java	2006-12-08 13:26:15 UTC (rev 8138)
+++ labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/jbossatx/jts/TransactionManagerService.java	2006-12-08 14:28:11 UTC (rev 8139)
@@ -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.
  */
@@ -54,6 +54,7 @@
 import com.arjuna.ats.internal.jts.recovery.RecoveryORBManager;
 import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
 import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.logging.LogFactory;
 
 import javax.management.InstanceNotFoundException;
 import javax.management.Notification;
@@ -78,6 +79,17 @@
  */
 public class TransactionManagerService extends ServiceMBeanSupport implements TransactionManagerServiceMBean, NotificationListener
 {
+	static {
+		/*
+		 * Override the defualt logging config, force use of the plugin that rewrites log levels to reflect app server level semantics.
+		 * This must be done before the loading of anything that uses the logging, otherwise it's too late to take effect.
+		 * Hence the static initializer block.
+		 * see also http://jira.jboss.com/jira/browse/JBTM-20
+		 */
+		com.arjuna.ats.arjuna.common.arjPropertyManager.propertyManager.setProperty(LogFactory.LOGGER_PROPERTY, "log4j_releveler");
+		//System.setProperty(LogFactory.LOGGER_PROPERTY, "log4j_releveler") ;
+	}
+
     public final static String PROPAGATE_FULL_CONTEXT_PROPERTY = "com.arjuna.ats.jbossatx.jts.propagatefullcontext";
 
     private final static String SERVICE_NAME = "TransactionManagerService";
@@ -121,7 +133,7 @@
         /** Register management plugin **/
         com.arjuna.ats.arjuna.common.arjPropertyManager.propertyManager.addManagementPlugin(new PropertyServiceJMXPlugin());
 
-        /** Register propagation context manager **/
+		/** Register propagation context manager **/
         try
         {
             /** Bind the propagation context manager **/
@@ -154,7 +166,7 @@
             if (_runRM)
             {
                 registerNotification() ;
-                
+
                 this.getLog().info("Starting recovery manager");
 
                 RecoveryManager.delayRecoveryManagerThread() ;
@@ -190,7 +202,7 @@
 
         JNDIManager.bindJTATransactionManagerImplementation();
     }
-    
+
     /**
      * Handle JMX notification.
      * @param notification The JMX notification event.
@@ -310,10 +322,10 @@
     {
         return com.arjuna.ats.jta.TransactionManager.transactionManager();
     }
-    
+
     /**
      * Get the XA Terminator
-     * 
+     *
      * @return the XA Terminator
      */
     public JBossXATerminator getXATerminator()
@@ -427,15 +439,15 @@
     {
         _runRM = runRM;
     }
-    
+
     private void registerNotification()
         throws InstanceNotFoundException
     {
         final NotificationFilterSupport notificationFilter = new NotificationFilterSupport() ;
         notificationFilter.enableType(Server.START_NOTIFICATION_TYPE) ;
-        
+
         final ObjectName serverName = ObjectNameFactory.create("jboss.system:type=Server") ;
-        
+
         getServer().addNotificationListener(serverName, this, notificationFilter, null) ;
     }
 




More information about the jboss-svn-commits mailing list