[JAVA-2163] MongoClient user should have ability to use non default factory implementations Created: 01/Apr/16  Updated: 08/Dec/17  Resolved: 08/Dec/17

Status: Closed
Project: Java Driver
Component/s: API, Configuration
Affects Version/s: 3.2.2
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Dzmitry Stsiapanau Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to JAVA-2162 DefaultServerMonitor loses security c... Closed

 Description   

There is number of public Interfaces with default implementations used in driver code. But there is no ability to change the desired implementation (to inject users extended versions).
For example:
DefaultClusterFactory implements ClusterFactory
is directly instantiating by name at Mongo.java line 682.

But as mongo-java-driver user I want to have ability to specify my own ClusterFatory implementation (may be providing class name in MongoClientOptions, or using java SPI, or etc).

Some of the desired interfaces:
ClusterFactory -> DefaultClusterFactory
ClusterableServerFactory -> DefaultClusterableServerFactory
ServerMonitorFactory -> DefaultServerMonitorFactory
ConnectionPool -> DefaultConnectionPool
ServerMonitor -> DefaultServerMonitor

To have ability to integrate with your code and to override some unnecessary behavior.



 Comments   
Comment by Jeffrey Yemin [ 08/Dec/17 ]

We don't yet have a good use case for exposing this in the MongoClient API. Closing as Won't Fix for now.

Comment by Jeffrey Yemin [ 17/Oct/16 ]

Now that JAVA-2162 has been addressed do you still have a need for this feature?

Comment by Dzmitry Stsiapanau [ 01/Apr/16 ]

Is need in case of not fixing JAVA-2162 or to simplify for the users way to extend java-driver.

Generated at Thu Feb 08 08:56:30 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.