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 2929import java .lang .management .*;
3030import javax .management .*;
3131
32- class DBPortPool extends SimplePool <DBPort > {
32+ public class DBPortPool extends SimplePool <DBPort > {
3333
3434 static class Holder {
3535
Original file line number Diff line number Diff line change 2525
2626import org .bson .*;
2727
28- class DBTCPConnector implements DBConnector {
28+ public class DBTCPConnector implements DBConnector {
2929
3030 static Logger _logger = Logger .getLogger ( Bytes .LOGGER .getName () + ".tcp" );
3131 static Logger _createLogger = Logger .getLogger ( _logger .getName () + ".connect" );
@@ -445,11 +445,26 @@ public void close(){
445445 _myPort = null ;
446446 }
447447
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 ) {
449455 // just remove from map, a new pool will be created lazily
450456 _portHolder ._pools .remove (addr );
451457 }
452458
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+
453468 public boolean isOpen (){
454469 return ! _closed ;
455470 }
Original file line number Diff line number Diff line change @@ -399,7 +399,7 @@ public String getConnectPoint(){
399399 * Gets the underlying TCP connector
400400 * @return
401401 */
402- DBTCPConnector getConnector () {
402+ public DBTCPConnector getConnector () {
403403 return _connector ;
404404 }
405405
You can’t perform that action at this time.
0 commit comments