Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

LPS-24178 Source formatting

  • Loading branch information...
commit 4a73d8ef89c3e5f22345cce64c0b46cbf7006d57 1 parent f415d96
@brianchandotcom authored
View
33 ...lr-web/docroot/WEB-INF/src/com/liferay/portal/search/solr/server/BasicAuthSolrServer.java
@@ -56,9 +56,11 @@ public BasicAuthSolrServer(
_username = username;
_password = password;
- _connectionManager = new MultiThreadedHttpConnectionManager();
+ _multiThreadedHttpConnectionManager =
+ new MultiThreadedHttpConnectionManager();
- HttpClient httpClient = new HttpClient(_connectionManager);
+ HttpClient httpClient = new HttpClient(
+ _multiThreadedHttpConnectionManager);
if ((_username != null) && (_password != null)) {
if (authScope == null) {
@@ -164,38 +166,43 @@ public void setSoTimeout(int soTimeout) {
public void stop() {
_stopped = true;
- int i = 0;
+ while (true) {
+ int connectionsInPool =
+ _multiThreadedHttpConnectionManager.getConnectionsInPool();
+
+ if (connectionsInPool <= 0) {
+ break;
+ }
- while ((i = _connectionManager.getConnectionsInPool()) > 0) {
if (_log.isDebugEnabled()) {
_log.debug(
- "[" + toString() + "] Waiting on " + i +
- " connections...");
+ toString() + " waiting on " + connectionsInPool +
+ " connections");
}
- _connectionManager.closeIdleConnections(200);
+ _multiThreadedHttpConnectionManager.closeIdleConnections(200);
try {
Thread.sleep(200);
}
- catch (InterruptedException e) {
+ catch (InterruptedException ie) {
}
}
- _connectionManager.shutdown();
+ _multiThreadedHttpConnectionManager.shutdown();
if (_log.isDebugEnabled()) {
- _log.debug(
- "[" + toString() + "] I'm shutdown!");
+ _log.debug(toString() + " is shutdown");
}
}
private static Log _log = LogFactoryUtil.getLog(BasicAuthSolrServer.class);
- private MultiThreadedHttpConnectionManager _connectionManager;
+ private MultiThreadedHttpConnectionManager
+ _multiThreadedHttpConnectionManager;
private String _password;
- private boolean _stopped;
private CommonsHttpSolrServer _server;
+ private boolean _stopped;
private String _username;
}
Please sign in to comment.
Something went wrong with that request. Please try again.