1 22 23 24 package com.mchange.v2.c3p0.test; 25 26 import java.sql.Connection ; 27 import com.mchange.v2.c3p0.QueryConnectionTester; 28 import com.mchange.v2.log.MLevel; 29 import com.mchange.v2.log.MLog; 30 import com.mchange.v2.log.MLogger; 31 32 public final class AlwaysFailConnectionTester implements QueryConnectionTester 33 { 34 final static MLogger logger = MLog.getLogger( AlwaysFailConnectionTester.class ); 35 36 { 37 logger.log(MLevel.WARNING, "Instantiated: " + this, new Exception ("Instantiation Stack Trace.") ); 38 } 39 40 public int activeCheckConnection(Connection c) 41 { 42 logger.warning(this + ": activeCheckConnection(Connection c)"); 43 return CONNECTION_IS_INVALID; 44 } 45 46 public int statusOnException(Connection c, Throwable t) 47 { 48 logger.warning(this + ": statusOnException(Connection c, Throwable t)"); 49 return CONNECTION_IS_INVALID; 50 } 51 52 public int activeCheckConnection(Connection c, String preferredTestQuery) 53 { 54 logger.warning(this + ": activeCheckConnection(Connection c, String preferredTestQuery)"); 55 return CONNECTION_IS_INVALID; 56 } 57 58 public boolean equals( Object o ) 59 { return (o instanceof AlwaysFailConnectionTester); } 60 61 public int hashCode() 62 { return 1; } 63 } 64 65 | Popular Tags |