Currently, when calling new Mongo() the following happen:
- default hard coded settings are used
- the driver then tries to establish a connection
When using reflection tools like cglib to build a proxy around a class, a common behaviour is to call the default constructor to wrap around it (through a subclass).
This doesn't work with the Mongo class (or could in a misleading way if there's a local mongo server listening on the defaults port, which could change, esp in production).
IMHO, the best approach here would be to have an explicit call to mongo to open the connection. However, at "worst", a way to setup the default settings could be enough, esp. if these settings can be done through java. One could also consider not providing a default constructor (since the current one isn't clean), but it would mean more work when proxying around.
thanks in advance