@Override public ConnectionValidator getValue() throws IllegalStateException { return ConnectionValidator.getInstance(); }
@Override public void stop(StopContext context) { try { ConnectionValidator.getInstance().stop(); } catch (Throwable t) { // Ignore } } }
@Override public void start(StartContext context) throws StartException { try { ConnectionValidator.getInstance().start(); } catch (Throwable t) { throw new StartException(t); } }
@Override public ConnectionValidator getValue() throws IllegalStateException { return ConnectionValidator.getInstance(); }
@Override public ConnectionValidator getValue() throws IllegalStateException { return ConnectionValidator.getInstance(); }
@Override public void stop(StopContext context) { try { ConnectionValidator.getInstance().stop(); } catch (Throwable t) { // Ignore } } }
@Override public void stop(StopContext context) { try { ConnectionValidator.getInstance().stop(); } catch (Throwable t) { // Ignore } } }
@Override public void start(StartContext context) throws StartException { try { ConnectionValidator.getInstance().start(); } catch (Throwable t) { throw new StartException(t); } }
@Override public void start(StartContext context) throws StartException { try { ConnectionValidator.getInstance().start(); } catch (Throwable t) { throw new StartException(t); } }
/** * {@inheritDoc} */ public void shutdown() { if (log.isTraceEnabled()) log.tracef("Shutdown - Pool: %s MCP: %s", pool.getName(), Integer.toHexString(System.identityHashCode(this))); IdleRemover.getInstance().unregisterPool(this); ConnectionValidator.getInstance().unregisterPool(this); if (checkedOutSize.get() > 0) { for (Entry<ConnectionListener, ConnectionListenerWrapper> entry : cls.entrySet()) { if (entry.getValue().isCheckedOut()) log.destroyingActiveConnection(pool.getName(), entry.getKey().getManagedConnection()); if (Tracer.isEnabled()) Tracer.clearConnectionListener(pool.getName(), this, entry.getKey()); } } final Collection<ConnectionListener> toDestroy = new ArrayList<ConnectionListener>(); flush(FlushMode.ALL, toDestroy); for (ConnectionListener cl : toDestroy) { cl.destroy(); } }
/** * {@inheritDoc} */ public void shutdown() { final Collection<ConnectionListener> toDestroy; synchronized (this) { if (log.isTraceEnabled()) log.tracef("Shutdown - Pool: %s MCP: %s", pool.getName(), Integer.toHexString(System.identityHashCode( this))); IdleRemover.getInstance().unregisterPool(this); ConnectionValidator.getInstance().unregisterPool(this); if (checkedOut.size() > 0) { for (ConnectionListener cl : checkedOut) { log.destroyingActiveConnection(pool.getName(), cl.getManagedConnection()); if (Tracer.isEnabled()) Tracer.clearConnectionListener(pool.getName(), this, cl); } } toDestroy = new ArrayList<ConnectionListener>(); flush(FlushMode.ALL, toDestroy); } for (ConnectionListener cl : toDestroy) { cl.destroy(); } }
ConnectionValidator.getInstance().registerPool(this, poolConfiguration.getBackgroundValidationMillis());
ConnectionValidator.getInstance().registerPool(this, poolConfiguration.getBackgroundValidationMillis());