File tree Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Expand file tree Collapse file tree 3 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 29
29
import java .lang .management .*;
30
30
import javax .management .*;
31
31
32
- class DBPortPool extends SimplePool <DBPort > {
32
+ public class DBPortPool extends SimplePool <DBPort > {
33
33
34
34
static class Holder {
35
35
Original file line number Diff line number Diff line change 25
25
26
26
import org .bson .*;
27
27
28
- class DBTCPConnector implements DBConnector {
28
+ public class DBTCPConnector implements DBConnector {
29
29
30
30
static Logger _logger = Logger .getLogger ( Bytes .LOGGER .getName () + ".tcp" );
31
31
static Logger _createLogger = Logger .getLogger ( _logger .getName () + ".connect" );
@@ -445,11 +445,26 @@ public void close(){
445
445
_myPort = null ;
446
446
}
447
447
448
- void updatePortPool (ServerAddress addr ) {
448
+ /**
449
+ * Assigns a new DBPortPool for a given ServerAddress.
450
+ * This is used to obtain a new pool when the resolved IP of a host changes, for example.
451
+ * User application should not have to call this method directly.
452
+ * @param addr
453
+ */
454
+ public void updatePortPool (ServerAddress addr ) {
449
455
// just remove from map, a new pool will be created lazily
450
456
_portHolder ._pools .remove (addr );
451
457
}
452
458
459
+ /**
460
+ * Gets the DBPortPool associated with a ServerAddress.
461
+ * @param addr
462
+ * @return
463
+ */
464
+ public DBPortPool getDBPortPool (ServerAddress addr ) {
465
+ return _portHolder .get (addr );
466
+ }
467
+
453
468
public boolean isOpen (){
454
469
return ! _closed ;
455
470
}
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ public String getConnectPoint(){
399
399
* Gets the underlying TCP connector
400
400
* @return
401
401
*/
402
- DBTCPConnector getConnector () {
402
+ public DBTCPConnector getConnector () {
403
403
return _connector ;
404
404
}
405
405
You can’t perform that action at this time.
0 commit comments