本文整理了Java中com.mongodb.Mongo.getMongoOptions()
方法的一些代码示例,展示了Mongo.getMongoOptions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mongo.getMongoOptions()
方法的具体详情如下:
包路径:com.mongodb.Mongo
类名称:Mongo
方法名:getMongoOptions
[英]Returns the mongo options.
Changes to MongoOptions that are done after connection are not reflected.
[中]返回mongo选项。
连接后对Mongoopions所做的更改不会反映出来。
代码示例来源:origin: jmkgreen/morphia
/**
* @return
*/
public DBDecoderFactory getDecoderFact() {
return decoderFactory != null ? decoderFactory : mongo.getMongoOptions().dbDecoderFactory;
}
}
代码示例来源:origin: stackoverflow.com
public boolean mongoRunningAt(String uri) {
try {
Mongo mongo = new Mongo(new MongoURI(uri));
try {
Socket socket = mongo.getMongoOptions().socketFactory.createSocket();
socket.connect(mongo.getAddress().getSocketAddress());
socket.close();
} catch (IOException ex) {
return false;
}
mongo.close();
return true;
} catch (UnknownHostException e) {
return false;
}
}
代码示例来源:origin: Aresyi/smart-api
private void config() {
MongoOptions op = mongo.getMongoOptions();
op.setAutoConnectRetry(autoConnectRetry);
op.setConnectTimeout(connectTimeout);
op.setMaxWaitTime(maxWaitTime);
op.setMaxAutoConnectRetryTime(maxAutoConnectRetryTime);
op.setSocketKeepAlive(socketKeepAlive);
op.setSocketTimeout(socketTimeout);
}
内容来源于网络,如有侵权,请联系作者删除!