use of com.mongodb.connection.netty.NettyStreamFactoryFactory in project mongo-java-driver by mongodb.
the class ClusterFixture method getOverriddenStreamFactoryFactory.
@Nullable
public static StreamFactoryFactory getOverriddenStreamFactoryFactory() {
String streamType = System.getProperty("org.mongodb.test.async.type", "nio2");
if (nettyStreamFactoryFactory == null && streamType.equals("netty")) {
NettyStreamFactoryFactory.Builder builder = NettyStreamFactoryFactory.builder();
String sslProvider = System.getProperty("org.mongodb.test.netty.ssl.provider");
if (sslProvider != null) {
SslContext sslContext;
try {
sslContext = SslContextBuilder.forClient().sslProvider(SslProvider.valueOf(sslProvider)).build();
} catch (SSLException e) {
throw new MongoClientException("Unable to create Netty SslContext", e);
}
builder.sslContext(sslContext);
}
nettyStreamFactoryFactory = builder.build();
}
return nettyStreamFactoryFactory;
}
Aggregations