| | |
| | | // TODO: handle password policy response controls? AD? |
| | | // TODO: custom aliveness pings |
| | | // TODO: cache password |
| | | // TODO: handle idle timeouts (connection resets): implement retry logic in |
| | | // connection pools. |
| | | |
| | | /** |
| | | * A simplistic load-balancer connection factory implementation using |
| | |
| | | incrementNextIndex(); |
| | | return; |
| | | } |
| | | else if (lastException == null) |
| | | { |
| | | lastException = factory.lastException; |
| | | } |
| | | } |
| | | catch (final DirectoryException e) |
| | | { |
| | |
| | | private final class MonitoredConnectionFactory implements ConnectionFactory |
| | | { |
| | | private final ConnectionFactory factory; |
| | | |
| | | // isAvailable acts as memory barrier for lastException. |
| | | private volatile boolean isAvailable = true; |
| | | private DirectoryException lastException = null; |
| | | |
| | | |
| | | |
| | |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | isAvailable = false; |
| | | lastException = e; |
| | | isAvailable = false; // publish lastException |
| | | throw e; |
| | | } |
| | | } |