CVS: beepcore-java/src/org/beepcore/beep/lib ChannelPool.java,1.6,1.7

Huston Franklin <[email protected]> Sat, 05 Oct 2002 08:31:06 -0700
Newsgroups gmane.network.beep.beepcore.java.cvs
Message-ID <[email protected]>
Update of /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib
In directory usw-pr-cvs1:/tmp/cvs-serv7354/src/org/beepcore/beep/lib

Modified Files:
	ChannelPool.java 
Log Message:
changed to use commons-logging

Index: ChannelPool.java
===================================================================
RCS file: /cvsroot/beepcore-java/beepcore-java/src/org/beepcore/beep/lib/ChannelPool.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** ChannelPool.java	7 Sep 2002 15:06:07 -0000	1.6
--- ChannelPool.java	5 Oct 2002 15:31:04 -0000	1.7
***************
*** 28,32 ****
  import java.util.Iterator;
  
! import org.beepcore.beep.util.Log;
  
  
--- 28,33 ----
  import java.util.Iterator;
  
! import org.apache.commons.logging.Log;
! import org.apache.commons.logging.LogFactory;
  
  
***************
*** 51,54 ****
--- 52,58 ----
       */
      private static final long DEFAULT_TIME_TO_LIVE = 120000;    // two minutes
+ 
+     private Log log = LogFactory.getLog(this.getClass());
+ 
      private long timeToLive = DEFAULT_TIME_TO_LIVE;
      Session session;
***************
*** 110,115 ****
  
                  if (sharedCh.getProfile().equals(profile)) {
!                     Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                                  "Found an available channel for sharing");
                      i.remove();
  
--- 114,118 ----
  
                  if (sharedCh.getProfile().equals(profile)) {
!                     log.trace("Found an available channel for sharing");
                      i.remove();
  
***************
*** 130,135 ****
          // clean up channels that have expired
          garbageCollect();
!         Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                      "Sharing channel number:" + sharedCh.getNumber());
  
          return sharedCh;
--- 133,139 ----
          // clean up channels that have expired
          garbageCollect();
!         if (log.isTraceEnabled()) {
!             log.trace("Sharing channel number:" + sharedCh.getNumber());
!         }
  
          return sharedCh;
***************
*** 169,174 ****
  
                  if (sharedCh.getProfile().equals(profile)) {
!                     Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                                  "Found an available channel for sharing");
                      i.remove();
  
--- 173,177 ----
  
                  if (sharedCh.getProfile().equals(profile)) {
!                     log.trace("Found an available channel for sharing");
                      i.remove();
  
***************
*** 189,194 ****
          // clean up channels that have expired
          garbageCollect();
!         Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                      "Sharing channel number:" + sharedCh.getNumber());
  
          return sharedCh;
--- 192,198 ----
          // clean up channels that have expired
          garbageCollect();
!         if (log.isTraceEnabled()) {
!             log.trace("Sharing channel number:" + sharedCh.getNumber());
!         }
  
          return sharedCh;
***************
*** 245,249 ****
      private void garbageCollect()
      {
!         Log.logEntry(Log.SEV_DEBUG_VERBOSE, "garbage collecting");
  
          if (availableChannels.size() != 0) {
--- 249,253 ----
      private void garbageCollect()
      {
!         log.trace("garbage collecting");
  
          if (availableChannels.size() != 0) {
***************
*** 261,274 ****
  
                          try {
!                             Log.logEntry(Log.SEV_DEBUG_VERBOSE,
!                                          "garbage collected channel number:"
!                                          + shCh.getNumber());
                              shCh.close();    // last gasp
                          } catch (BEEPException e) {
  
                              // ignore for now, we'll try again later
!                             Log.logEntry(Log.SEV_ALERT,
!                                          "unable to close channel number:"
!                                          + shCh.getNumber());
                          }
  
--- 265,278 ----
  
                          try {
!                             if (log.isTraceEnabled()) {
!                                 log.trace("garbage collected channel number:"
!                                           + shCh.getNumber());
!                             }
                              shCh.close();    // last gasp
                          } catch (BEEPException e) {
  
                              // ignore for now, we'll try again later
!                             log.error("unable to close channel number:"
!                                       + shCh.getNumber());
                          }
  



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf