From jboss-remoting-commits at lists.jboss.org Sat Feb 20 14:52:15 2010 Content-Type: multipart/mixed; boundary="===============7896254106368966315==" MIME-Version: 1.0 From: jboss-remoting-commits at lists.jboss.org To: jboss-remoting-commits at lists.jboss.org Subject: [jboss-remoting-commits] JBoss Remoting SVN: r5740 - remoting2/branches/2.2/src/main/org/jboss/remoting. Date: Sat, 20 Feb 2010 14:52:15 -0500 Message-ID: <201002201952.o1KJqFVK002609@svn01.web.mwc.hst.phx2.redhat.com> --===============7896254106368966315== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: ron.sigal(a)jboss.com Date: 2010-02-20 14:52:15 -0500 (Sat, 20 Feb 2010) New Revision: 5740 Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java Log: JBREM-1179: Now uses reflection to get logger and logs version at DEBUG lev= el. Modified: remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java 2010-02= -19 18:34:51 UTC (rev 5739) +++ remoting2/branches/2.2/src/main/org/jboss/remoting/Version.java 2010-02= -20 19:52:15 UTC (rev 5740) @@ -22,6 +22,12 @@ = package org.jboss.remoting; = +import java.lang.reflect.Method; + +import org.jboss.logging.Logger; + +//import org.jboss.logging.Logger; + /** * @author Tom Elrod */ @@ -36,11 +42,6 @@ private static final byte byteVersion =3D VERSION_2_2; private static byte defaultByteVersion =3D byteVersion; private static boolean performVersioning =3D true; - = - static - { - System.out.println("Remoting version: " + VERSION); - } = = public static final String PRE_2_0_COMPATIBLE =3D "jboss.remoting.pre_2= _0_compatible"; @@ -52,6 +53,20 @@ // have a static block to load the user defined version to use static { + try + { + ClassLoader cl =3D Version.class.getClassLoader(); + Class c =3D cl.loadClass("org.jboss.logging.Logger"); + Method getLogger =3D c.getMethod("getLogger", new Class[]{String.= class}); + Object logger =3D getLogger.invoke(null, new Object[] {"org.jboss= .remoting"}); + Method debug =3D c.getMethod("debug", new Class[]{Object.class}); + debug.invoke(logger, new Object[]{"Remoting version: " + VERSION}= ); + } + catch (Throwable t) + { + // ignore + } + = boolean precompatibleFlag =3D false; String precompatible =3D System.getProperty(PRE_2_0_COMPATIBLE); if(precompatible !=3D null && precompatible.length() > 0) --===============7896254106368966315==--