| | |
| | | { |
| | | this.startIndex = nextIndex = startIndex; |
| | | |
| | | DirectoryException lastException = null; |
| | | DirectoryException lastException; |
| | | do |
| | | { |
| | | factory = factories[nextIndex]; |
| | | if (factory.isAvailable()) |
| | | if (factory.isAvailable) |
| | | { |
| | | try |
| | | { |
| | | if (factory.isAvailable) |
| | | { |
| | | connection = factory.getConnection(); |
| | | incrementNextIndex(); |
| | | return; |
| | | } |
| | | else if (lastException == null) |
| | | { |
| | | lastException = factory.lastException; |
| | | } |
| | | connection = factory.getConnection(); |
| | | incrementNextIndex(); |
| | | return; |
| | | } |
| | | catch (final DirectoryException e) |
| | | { |
| | |
| | | lastException = e; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | lastException = factory.lastException; |
| | | } |
| | | incrementNextIndex(); |
| | | } |
| | | while (nextIndex != startIndex); |
| | |
| | | while (nextIndex != startIndex) |
| | | { |
| | | factory = factories[nextIndex]; |
| | | if (factory.isAvailable()) |
| | | if (factory.isAvailable) |
| | | { |
| | | try |
| | | { |
| | | if (factory.isAvailable) |
| | | { |
| | | connection = factory.getConnection(); |
| | | incrementNextIndex(); |
| | | return; |
| | | } |
| | | connection = factory.getConnection(); |
| | | incrementNextIndex(); |
| | | return; |
| | | } |
| | | catch (final DirectoryException de) |
| | | { |
| | |
| | | throw e; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | private boolean isAvailable() |
| | | { |
| | | return isAvailable; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | { |
| | | for (final MonitoredConnectionFactory factory : factories) |
| | | { |
| | | if (!factory.isAvailable()) |
| | | if (!factory.isAvailable) |
| | | { |
| | | try |
| | | { |