| | |
| | | } |
| | | |
| | | private void notifyOffline(final ErrorResultException error) { |
| | | // Save the error in case the load-balancer is exhausted. |
| | | lastFailure = error; |
| | | |
| | | if (isOperational.getAndSet(false)) { |
| | | // Transition from online to offline. |
| | | if (DEBUG_LOG.isLoggable(Level.WARNING)) { |
| | |
| | | private final List<MonitoredConnectionFactory> monitoredFactories; |
| | | private final ReferenceCountedObject<ScheduledExecutorService>.Reference scheduler; |
| | | private final Object stateLock = new Object(); |
| | | |
| | | /** |
| | | * The last connection failure which caused a connection factory to be |
| | | * marked offline. This is used in order to help diagnose problems when the |
| | | * load-balancer has exhausted all of its factories. |
| | | */ |
| | | private volatile ErrorResultException lastFailure = null; |
| | | |
| | | /** |
| | | * Guarded by stateLock. |
| | | */ |
| | |
| | | * timeout period. |
| | | */ |
| | | throw newErrorResult(ResultCode.CLIENT_SIDE_CONNECT_ERROR, |
| | | "No operational connection factories available"); |
| | | "No operational connection factories available", lastFailure); |
| | | } |
| | | } |