1 45 46 package org.exolab.jms.net.connector; 47 48 49 55 public class TestConnectionPool extends DefaultConnectionPool { 56 57 60 private int _count = 0; 61 62 63 73 public TestConnectionPool(ManagedConnectionFactory factory, 74 InvocationHandler handler, 75 ConnectionFactory resolver) 76 throws ResourceException { 77 super(factory, handler, resolver, null); 78 } 79 80 85 public int getPooledConnections() { 86 return _count; 87 } 88 89 101 protected ManagedConnection add(ManagedConnection connection, 102 boolean accepted) throws ResourceException { 103 ManagedConnection result = super.add(connection, accepted); 104 ++_count; 105 return result; 106 } 107 108 113 protected void remove(ManagedConnection connection) { 114 super.remove(connection); 115 --_count; 116 } 117 118 } 119 | Popular Tags |