@Test public void testActivateObject() throws Exception { Connection mockConnection = mock(Connection.class); poolableConnectionFactory.activateObject(PoolKeyUtils.getKey(host, credentials), mockConnection); verifyZeroInteractions(mockConnectionFactory, mockConnection); ArgumentCaptor<ConnectionPoolEvent> eventCaptor = ArgumentCaptor.forClass(ConnectionPoolEvent.class); verify(mockListener).connectionActivated(eventCaptor.capture()); assertThat(eventCaptor.getValue().getConnection(), sameInstance(mockConnection)); }
@Override public void activateObject(String key, Connection connection) throws Exception { LOG.debug("Connection pool: activating {}", RpcUriUtils.sanitize(PoolKeyUtils.keyToUriString(key), PoolKeyUtils.keyToConnectionSpec(key))); fireConnectionActivated(connection); }
PoolableConnectionFactory implements KeyedPoolableObjectFactory<String, Connection> { @Override public void activateObject(String key, Connection connection) throws Exception { LOG.debug("Connection pool: activating {}", RpcUriUtils.sanitize(PoolKeyUtils.keyToUriString(key), PoolKeyUtils.keyToConnectionSpec(key))); fireConnectionActivated(connection); } }
PoolableConnectionFactory implements KeyedPoolableObjectFactory<String, Connection> { @Override public void activateObject(String key, Connection connection) throws Exception { LOG.debug("Connection pool: activating {}", RpcUriUtils.sanitize(PoolKeyUtils.keyToUriString(key), PoolKeyUtils.keyToConnectionSpec(key))); fireConnectionActivated(connection); } PoolableConnectionFactory(ConnectionFactory connectionFactory);  PoolableConnectionFactory(ConnectionFactory connectionFactory, ConnectionPoolListener listener); }
PoolableConnectionFactory implements KeyedPoolableObjectFactory<String, Connection> { @Override public void activateObject(String key, Connection connection) throws Exception { LOG.debug("Connection pool: activating {}", RpcUriUtils.sanitize(PoolKeyUtils.keyToUriString(key), PoolKeyUtils.keyToConnectionSpec(key))); fireConnectionActivated(connection); } PoolableConnectionFactory(ConnectionFactory connectionFactory);  PoolableConnectionFactory(ConnectionFactory connectionFactory, ConnectionPoolListener listener); void addConnectionListener(final ConnectionPoolListener listener); void removeConnectionListener(final ConnectionPoolListener listener); @Override Connection makeObject(String key); @Override void destroyObject(String key, Connection connection); @Override boolean validateObject(String key, Connection connection); @Override void activateObject(String key, Connection connection); @Override void passivateObject(String key, Connection connection); }
PoolableConnectionFactory implements KeyedPoolableObjectFactory<String, Connection> { @Override public void activateObject(String key, Connection connection) throws Exception { LOG.debug("Connection pool: activating {}", RpcUriUtils.sanitize(PoolKeyUtils.keyToUriString(key), PoolKeyUtils.keyToConnectionSpec(key))); fireConnectionActivated(connection); } PoolableConnectionFactory(ConnectionFactory connectionFactory);  PoolableConnectionFactory(ConnectionFactory connectionFactory, ConnectionPoolListener listener); void addConnectionListener(final ConnectionPoolListener listener); void removeConnectionListener(final ConnectionPoolListener listener); @Override Connection makeObject(String key); @Override void destroyObject(String key, Connection connection); @Override boolean validateObject(String key, Connection connection); @Override void activateObject(String key, Connection connection); @Override void passivateObject(String key, Connection connection);  }