/** * {@inheritDoc} */ public void invalidateObject(final T obj) { synchronized (lock) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } }
/** * {@inheritDoc} */ public void invalidateObject(final T obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed } }
/** * Invalidate and object, ignoring the key * * @param obj object to invalidate * @param key ignored */ public void invalidateObject(final K key, final V obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } }
/** * Invalidates an object from the pool, verifying that it is of the expected type. * * @param obj object to invalidate * @throws ClassCastException if obj is not of the expected type */ public void invalidateObject(final T obj) { if (type.isInstance(obj)) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } else { throw new ClassCastException("Invalidated object is not of type: " + type.getName() + " was: " + obj); } }
pool.invalidateObject(obj); } else { pool.returnObject(obj);
@Test public void releaseInvalidConnection() throws Exception { when(connectionProvider.validate(connection)).thenReturn(failure("Connection is invalid", new IOException())); managedConnection.release(); verify(pool).invalidateObject(connection); verify(pool, never()).returnObject(connection); verify(poolingListener, never()).onReturn(connection); }
@Test public void invalidate() throws Exception { managedConnection.invalidate(); verify(pool).invalidateObject(connection); assertDisconnected(); }
/** * {@inheritDoc} */ public void invalidateObject(final T obj) { synchronized (lock) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } }
public void invalidateObject(final Object obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed } }
public void invalidateObject(final Object key, final Object obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } }
public void invalidateObject(final Object obj) { synchronized (lock) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } }
public void invalidateObject(final Object obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed } }
public void invalidateObject(final Object obj) { synchronized (lock) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } }
/** * {@inheritDoc} */ public void invalidateObject(final T obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed } }
/** * {@inheritDoc} */ public void invalidateObject(final T obj) { synchronized (lock) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } }
/** * {@inheritDoc} */ public void invalidateObject(final T obj) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed } }
/** * If the Session goes into an unstable (unusable) state, then we want to * close it down and permanently remove it from the pool. */ public void destroyAndRemoveFromPool() { try { sessionPool.invalidateObject(this); } catch (Throwable t) { log.warn("Unable to remove invalidated JMS Session from the pool due to the following exception. Will ignore the exception and continue.", t); } }
public void invalidateObject(SbbObject obj) throws Exception { pool.invalidateObject(obj); if (logger.isTraceEnabled()) { logger.trace("invalidated object "+obj + " to " + this); } } }
public void invalidateObject(final Object obj) { if (type.isInstance(obj)) { try { pool.invalidateObject(obj); } catch (Exception e) { // swallowed as of Pool 2 } } else { throw new ClassCastException("Invalidated object is not of type: " + type.getName() + " was: " + obj); } }
@Override public void destroy(Connection connection) { LOG.debug("destroying connection {}", connection.getId()); try { pool.get(connection.getRouteHost()).invalidateObject(connection.getChannelFuture()); } catch (Exception e) { throw new RuntimeException(e); } }