[Idrs-commit] CVS: Idrs/dev/net/sourceforge/idrs/utils/pool ObjectPool.java,1.3,1.4
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2004-08-30 00:56:27
|
Update of /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/utils/pool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12162/net/sourceforge/idrs/utils/pool Modified Files: ObjectPool.java Log Message: Added log4j support. cleaned up the logs Index: ObjectPool.java =================================================================== RCS file: /cvsroot/idrs/Idrs/dev/net/sourceforge/idrs/utils/pool/ObjectPool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ObjectPool.java 5 Dec 2000 16:33:40 -0000 1.3 --- ObjectPool.java 30 Aug 2004 00:56:09 -0000 1.4 *************** *** 22,25 **** --- 22,27 ---- import java.io.*; + import org.apache.log4j.Logger; + /** *************** *** 32,36 **** */ public abstract class ObjectPool implements Serializable { ! //Added Marc Boorshtein - 8/31/00 protected PrintStream out; //Used for logging pool activity protected int maxTrys; --- 34,39 ---- */ public abstract class ObjectPool implements Serializable { ! static transient Logger logger = Logger.getLogger(ObjectPool.class.getName()); ! //Added Marc Boorshtein - 8/31/00 protected PrintStream out; //Used for logging pool activity protected int maxTrys; *************** *** 218,226 **** else { // object failed validation ! System.out.println("Object not valid"); synchronized (this) { java.util.Date dnow = new java.util.Date(System.currentTimeMillis()); ! System.out.println("Output : " + out); --- 221,229 ---- else { // object failed validation ! if (logger.isDebugEnabled()) logger.debug("Object not valid"); synchronized (this) { java.util.Date dnow = new java.util.Date(System.currentTimeMillis()); ! if (logger.isDebugEnabled()) logger.debug(("Output : " + out); *************** *** 265,278 **** } catch(InterruptedException e) { ! System.out.println("ERROR: Failed while waiting for an object:"); ! System.out.println(e); } //changed Marc Boorshtein - 8/31/00 ! out.println("---------> All Connections Exhausted, waiting in loop " + num); return checkOut(num + 1); } } else { ! System.out.println("Returning Here"); return null; } --- 268,281 ---- } catch(InterruptedException e) { ! logger.error()"ERROR: Failed while waiting for an object:",e); ! } //changed Marc Boorshtein - 8/31/00 ! logger.warn("---------> All Connections Exhausted, waiting in loop " + num); return checkOut(num + 1); } } else { ! return null; } *************** *** 324,328 **** } */ ! System.out.println("Lost Connection"); } --- 327,331 ---- } */ ! logger.warn("Lost Connection"); } |