static <T> T withConnection(final ReadBinding binding, final CallableWithConnection<T> callable) { ConnectionSource source = binding.getReadConnectionSource(); try { return withConnectionSource(source, callable); } finally { source.release(); } }
static <T> T withConnection(final ReadBinding binding, final CallableWithConnectionAndSource<T> callable) { ConnectionSource source = binding.getReadConnectionSource(); try { return withConnectionSource(source, callable); } finally { source.release(); } }
static <D, T> T executeWrappedCommandProtocol(final ReadBinding binding, final String database, final BsonDocument command, final Decoder<D> decoder, final CommandTransformer<D, T> transformer) { ConnectionSource source = binding.getReadConnectionSource(); try { return transformer.apply(executeWrappedCommandProtocol(database, command, decoder, source, binding.getReadPreference()), source.getServerDescription().getAddress()); } finally { source.release(); } }
static <T> T withConnection(final ReadBinding binding, final CallableWithConnectionAndSource<T> callable) { ConnectionSource source = binding.getReadConnectionSource(); try { return withConnectionSource(source, callable); } finally { source.release(); } }
static <T> T withConnection(final ReadBinding binding, final CallableWithConnection<T> callable) { ConnectionSource source = binding.getReadConnectionSource(); try { return withConnectionSource(source, callable); } finally { source.release(); } }
static <D, T> T executeWrappedCommandProtocol(final ReadBinding binding, final String database, final BsonDocument command, final Decoder<D> decoder, final CommandTransformer<D, T> transformer) { ConnectionSource source = binding.getReadConnectionSource(); try { return transformer.apply(executeWrappedCommandProtocol(database, command, decoder, source, binding.getReadPreference()), source.getServerDescription().getAddress()); } finally { source.release(); } }