User: user57  
  Date: 02/02/14 22:15:57

  Modified:    src/main/org/jboss/test/threading/mbean Threads.java
  Log:
   o replaced most System.out usage with Log4j.  should really introduce
     some base classes to make this mess more maintainable...
  
  Revision  Changes    Path
  1.5       +10 -8     jbosstest/src/main/org/jboss/test/threading/mbean/Threads.java
  
  Index: Threads.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/threading/mbean/Threads.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Threads.java      7 Sep 2001 10:26:45 -0000       1.4
  +++ Threads.java      15 Feb 2002 06:15:57 -0000      1.5
  @@ -19,7 +19,7 @@
   *
   *   @see <related>
   *   @author  <a href="mailto:[EMAIL PROTECTED]";>Marc Fleury</a>
  -*   @version $Revision: 1.4 $
  +*   @version $Revision: 1.5 $
   *   
   *   Revisions:
   *
  @@ -29,6 +29,8 @@
   public class Threads
      implements ThreadsMBean
   {
  +   org.apache.log4j.Category log = 
org.apache.log4j.Category.getInstance(getClass());
  +   
      // Constants -----------------------------------------------------
        
      // Attributes ----------------------------------------------------
  @@ -80,7 +82,7 @@
            for (int i = 0; i < numberOfThreads ; i++) 
            {
               Thread t = new Thread(new Test());
  -            System.out.println("started new thread " +t.hashCode());
  +            log.debug("started new thread " +t.hashCode());
                                
               t.start();
                        
  @@ -90,7 +92,7 @@
        
      public void stopMe()
      {
  -      System.out.println("Stop called");
  +      log.debug("Stop called");
         runMe = false;
      };
        
  @@ -123,7 +125,7 @@
                                        
                     catch (Exception e2) 
                     {
  -                     System.out.println("****Create exception: " + e2);
  +                     log.debug("****Create exception: " + e2);
                     }
                  }
                                        
  @@ -166,14 +168,14 @@
                  catch (RemoteException ignored) {}
                  catch (Exception ex)
                  {
  -                  System.out.println("***Exception thrown: " + ex);
  +                  log.debug("***Exception thrown: " + ex);
                  }
                                
               } // while(runMe)
  -            System.out.println(Thread.currentThread() + " is finished!!!!");
  -            System.out.println("Num threads finished is: " + ++threadsFinished);
  +            log.debug(Thread.currentThread() + " is finished!!!!");
  +            log.debug("Num threads finished is: " + ++threadsFinished);
            }
  -         catch (Exception e) {System.out.println("Exception for 
thread"+Thread.currentThread()); e.printStackTrace();}
  +         catch (Exception e) {log.debug("Exception for 
thread"+Thread.currentThread()); e.printStackTrace();}
                
         }
      }
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to