/** * Initialize the shared connection if {@link #getShareNativeConnection() native connection sharing} is enabled and * reset any previously existing connection. */ public void initConnection() { resetConnection(); getSharedConnection(); getSharedReactiveConnection(); }
public void destroy() { resetConnection(); if (connectionProvider instanceof DisposableBean) { try { ((DisposableBean) connectionProvider).destroy(); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn(connectionProvider + " did not shut down gracefully.", e); } } } try { Duration quietPeriod = clientConfiguration.getShutdownQuietPeriod(); Duration timeout = clientConfiguration.getShutdownTimeout(); client.shutdown(quietPeriod.toMillis(), timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn((client != null ? ClassUtils.getShortName(client.getClass()) : "LettuceClient") + " did not shut down gracefully.", e); } } if (clusterCommandExecutor != null) { try { clusterCommandExecutor.destroy(); } catch (Exception ex) { log.warn("Cannot properly close cluster command executor", ex); } } }
/** * Initialize the shared connection if {@link #getShareNativeConnection() native connection sharing} is enabled and * reset any previously existing connection. */ public void initConnection() { resetConnection(); getSharedConnection(); getSharedReactiveConnection(); }
/** * Initialize the shared connection if {@link #getShareNativeConnection() native connection sharing} is enabled and * reset any previously existing connection. */ public void initConnection() { resetConnection(); getSharedConnection(); getSharedReactiveConnection(); }
public void destroy() { resetConnection(); if (connectionProvider instanceof DisposableBean) { try { ((DisposableBean) connectionProvider).destroy(); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn(connectionProvider + " did not shut down gracefully.", e); } } } try { Duration timeout = clientConfiguration.getShutdownTimeout(); client.shutdown(timeout.toMillis(), timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn((client != null ? ClassUtils.getShortName(client.getClass()) : "LettuceClient") + " did not shut down gracefully.", e); } } if (clusterCommandExecutor != null) { try { clusterCommandExecutor.destroy(); } catch (Exception ex) { log.warn("Cannot properly close cluster command executor", ex); } } }
public void destroy() { resetConnection(); if (connectionProvider instanceof DisposableBean) { try { ((DisposableBean) connectionProvider).destroy(); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn(connectionProvider + " did not shut down gracefully.", e); } } } try { Duration timeout = clientConfiguration.getShutdownTimeout(); client.shutdown(timeout.toMillis(), timeout.toMillis(), TimeUnit.MILLISECONDS); } catch (Exception e) { if (log.isWarnEnabled()) { log.warn((client != null ? ClassUtils.getShortName(client.getClass()) : "LettuceClient") + " did not shut down gracefully.", e); } } if (clusterCommandExecutor != null) { try { clusterCommandExecutor.destroy(); } catch (Exception ex) { log.warn("Cannot properly close cluster command executor", ex); } } }