类的使用
com.dtflys.forest.config.ForestConfiguration
使用ForestConfiguration的程序包
程序包
说明
-
com.dtflys.forest中ForestConfiguration的使用
修饰符和类型方法说明static ForestConfigurationForest.config()获取或创建全局默认配置,即ForestConfiguration对象static ForestConfiguration根据配置ID获取或创建配置,即ForestConfiguration对象 -
com.dtflys.forest.backend中ForestConfiguration的使用
修饰符和类型方法说明static intAsyncHttpExecutor.getAsyncThreadSize(ForestConfiguration configuration) 获取异步线程池大小static intAsyncHttpExecutor.getMaxAsyncThreadSize(ForestConfiguration configuration) 获取最大异步线程数voidAbstractHttpBackend.init(ForestConfiguration configuration) voidForestConnectionManager.init(ForestConfiguration configuration) voidHttpBackend.init(ForestConfiguration configuration) 初始化后端框架HttpBackendSelector.select(ForestConfiguration configuration) 根据全局配置选择Forest后端框架参数类型为ForestConfiguration的com.dtflys.forest.backend中的构造器限定符构造器说明AsyncHttpExecutor(ForestConfiguration configuration, HttpExecutor syncExecutor, ResponseHandler responseHandler) -
com.dtflys.forest.backend.httpclient.conn中ForestConfiguration的使用
-
com.dtflys.forest.backend.okhttp3.conn中ForestConfiguration的使用
-
com.dtflys.forest.config中ForestConfiguration的使用
修饰符和类型方法说明ForestConfiguration.addAllVariables(Map<String, Object> variables) 设置全局变量表static ForestConfigurationForestConfiguration.configuration()实例化ForestConfiguration对象,并初始化默认值static ForestConfigurationForestConfiguration.configuration(String id) 实例化ForestConfiguration对象,并初始化默认值static ForestConfigurationForestConfiguration.createConfiguration()VariableScope.getConfiguration()static ForestConfigurationForestConfiguration.getDefaultConfiguration()ForestConfiguration.registerFilter(String name, Class filterClass) 注册全局过滤器ForestConfiguration.registerKeyStore(SSLKeyStore keyStore) 注册全局SSL的Key Store信息ForestConfiguration.setAsyncMode(ForestAsyncMode asyncMode) 设置异步模式ForestConfiguration.setAsyncRejectPolicyClass(Class<? extends RejectedExecutionHandler> asyncRejectPolicyClass) 设置异步线程池拒绝策略类型ForestConfiguration.setAutoRedirection(boolean autoRedirection) /** 设置是否打开自动重定向ForestConfiguration.setBackend(HttpBackend backend) 设置HTTP后端ForestConfiguration.setBackendClientCacheExpireTime(Duration backendClientCacheExpireTime) 设置获取后端客户端对象缓存过期时间ForestConfiguration.setBackendClientCacheMaxSize(Integer backendClientCacheMaxSize) 设置后端客户端对象缓存最大空间大小ForestConfiguration.setBackendName(String backendName) 设置HTTP后端名称ForestConfiguration.setBaseAddress(ForestAddress baseAddress) 设置全局默认地址(主机名/域名/ip地址 + 端口号)ForestConfiguration.setBaseAddressHost(String host) 设置全局地址的 hostForestConfiguration.setBaseAddressPort(Integer port) 设置全局地址的 portForestConfiguration.setBaseAddressScheme(String scheme) 设置全局地址的HTTP协议头ForestConfiguration.setBaseAddressSourceClass(Class<? extends AddressSource> baseAddressSourceClass) 设置全局默认的主机地址信息动态来源接口实现类ForestConfiguration.setCacheEnabled(boolean cacheEnabled) 设置是否缓存请求接口实例ForestConfiguration.setCharset(String charset) 设置全局的请求数据字符集ForestConfiguration.setConnectTimeout(int connectTimeout, TimeUnit timeUnit) 设置全局的请求连接超时时间ForestConfiguration.setConnectTimeout(Integer connectTimeout) 设置全局的请求连接超时时间,单位为毫秒ForestConfiguration.setConnectTimeout(Duration connectTimeout) 设置全局的请求连接超时时间ForestConfiguration.setConverterMap(Map<ForestDataType, ForestConverter> converterMap) 设置全局数据转换器表ForestConfiguration.setDefaultHeaders(List<RequestNameValue> defaultHeaders) 设置全局默认请求头信息列表ForestConfiguration.setDefaultParameters(List<RequestNameValue> defaultParameters) 设置全局默认请求参数列表ForestConfiguration.setForestObjectFactory(ForestObjectFactory forestObjectFactory) 设置Forest对象实例化工厂ForestConfiguration.setHttpBackendSelector(HttpBackendSelector httpBackendSelector) 设置HTTP后端选择器ForestConfiguration.setInterceptorFactory(InterceptorFactory interceptorFactory) 设置拦截器工厂ForestConfiguration.setInterceptors(List<Class<? extends Interceptor>> interceptors) 设置全局拦截器列表ForestConfiguration.setJsonConverter(ForestJsonConverter converter) 设置全局JSON数据转换器ForestConfiguration.setLogEnabled(boolean logEnabled) 设置是否允许打印请求日志ForestConfiguration.setLogHandler(ForestLogHandler logHandler) 设置日志处理器ForestConfiguration.setLogRequest(boolean logRequest) 设置是否允许打印请求/响应日志ForestConfiguration.setLogResponseContent(boolean logResponseContent) 设置是否允许打印响应日志ForestConfiguration.setLogResponseStatus(boolean logResponseStatus) 设置是否允许打印响应日志ForestConfiguration.setMaxAsyncQueueSize(Integer maxAsyncQueueSize) 设置最大异步线程池队列大小ForestConfiguration.setMaxAsyncThreadSize(Integer maxAsyncThreadSize) 设置最大异步线程池大小ForestConfiguration.setMaxConnections(Integer maxConnections) 设置全局的最大连接数ForestConfiguration.setMaxRequestQueueSize(Integer maxRequestQueueSize) 设置全局的最大请求等待队列大小ForestConfiguration.setMaxRetryCount(Integer maxRetryCount) 设置全局的最大请求失败重试次数ForestConfiguration.setMaxRetryInterval(long maxRetryInterval) 设置全局的最大请求重试之间的时间间隔,单位为毫秒ForestConfiguration.setMaxRouteConnections(Integer maxRouteConnections) 设置全局的最大请求路径连接数ForestConfiguration.setProperties(ForestProperties properties) 设置Properties配置属性ForestConfiguration.setProtobufConverter(ForestProtobufConverter converter) 设置全局XML数据转换器ForestConfiguration.setReadTimeout(int readTimeout, TimeUnit timeUnit) 设置全局的请求读取超时时间ForestConfiguration.setReadTimeout(Integer readTimeout) 设置全局的请求读取超时时间,单位为毫秒ForestConfiguration.setReadTimeout(Duration readTimeout) 设置全局的请求读取超时时间ForestConfiguration.setRetryCount(Integer retryCount) 已过时。ForestConfiguration.setRetryer(Class retryer) 设置全局的请求失败重试策略类ForestConfiguration.setRetryWhenClass(Class<? extends RetryWhen> retryWhenClass) 设置全局重试条件回调函数ForestConfiguration.setSslKeyStores(Map<String, SSLKeyStore> sslKeyStores) 设置全局SSL的Key Store表ForestConfiguration.setSslProtocol(String sslProtocol) 设置全局的单向HTTPS请求的SSL协议ForestConfiguration.setSuccessWhenClass(Class<? extends SuccessWhen> successWhenClass) 设置全局请求成功条件回调函数ForestConfiguration.setTimeout(Integer timeout) 已过时。ForestConfiguration.setToMergeConverterMap(Map<ForestDataType, ForestConverter> converterMap) 设置合并全局数据转换器表,但不会覆盖整个转换器表ForestConfiguration.setVariables(Map<String, Object> variables) 替换整个全局变量表ForestConfiguration.setVariableValue(String name, ForestVariableValue value) 设置全局变量ForestConfiguration.setVariableValue(String name, Object value) 设置全局变量ForestConfiguration.setXmlConverter(ForestXmlConverter converter) 设置全局XML数据转换器返回变量类型为ForestConfiguration的类型的com.dtflys.forest.config中的方法修饰符和类型方法说明static ThreadPoolExecutorAsyncThreadPools.get(ForestConfiguration configuration) static ThreadPoolExecutorAsyncThreadPools.getOrCreate(ForestConfiguration configuration) -
com.dtflys.forest.converter.auto中ForestConfiguration的使用
-
com.dtflys.forest.converter.form中ForestConfiguration的使用
修饰符和类型方法说明protected voidDefaultFormConvertor.processFormArrayItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Object array, int target) 处理Form表单中的数组项protected voidDefaultFormConvertor.processFormCollectionItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Collection collection, int target) 处理Form表单中的集合项protected voidDefaultFormConvertor.processFormItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Object value, int target) 处理Form表单中的项protected voidDefaultFormConvertor.processFormMapItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Map map, int target) 处理Form表单中的Map项protected List<RequestNameValue>DefaultFormConvertor.processFromNameValueList(ForestRequest request, List<RequestNameValue> nameValueList, ForestConfiguration configuration, ConvertOptions options) 处理Form表单中的键值对列表 -
com.dtflys.forest.filter中ForestConfiguration的使用
修饰符和类型方法说明EncodeFilter.doFilter(ForestConfiguration configuration, Object data) EncodeFormFilter.doFilter(ForestConfiguration configuration, Object data) EncodePathFilter.doFilter(ForestConfiguration configuration, Object data) EncodeQueryFilter.doFilter(ForestConfiguration configuration, Object data) EncodeUserInfoFilter.doFilter(ForestConfiguration configuration, Object data) Filter.doFilter(ForestConfiguration configuration, Object data) FilterChain.doFilter(ForestConfiguration configuration, Object data) JSONFilter.doFilter(ForestConfiguration configuration, Object data) XmlFilter.doFilter(ForestConfiguration configuration, Object data) -
com.dtflys.forest.http中ForestConfiguration的使用
参数类型为ForestConfiguration的com.dtflys.forest.http中的构造器限定符构造器说明ForestRequest(ForestConfiguration configuration) ForestRequest(ForestConfiguration configuration, ForestMethod method) ForestRequest(ForestConfiguration configuration, ForestMethod method, ForestBody body, Object[] arguments) ForestRequest(ForestConfiguration configuration, ForestMethod method, Object[] arguments) ForestRequest(ForestConfiguration configuration, Object[] arguments) -
com.dtflys.forest.mapping中ForestConfiguration的使用
-
com.dtflys.forest.pool中ForestConfiguration的使用
参数类型为ForestConfiguration的com.dtflys.forest.pool中的构造器 -
com.dtflys.forest.proxy中ForestConfiguration的使用
参数类型为ForestConfiguration的com.dtflys.forest.proxy中的构造器限定符构造器说明InterfaceProxyHandler(ForestConfiguration configuration, ProxyFactory proxyFactory, Class<T> interfaceClass) ProxyFactory(ForestConfiguration configuration, Class<T> interfaceClass) -
com.dtflys.forest.reflection中ForestConfiguration的使用
限定符构造器说明ForestMethod(InterfaceProxyHandler interfaceProxyHandler, ForestConfiguration configuration, Method method) -
com.dtflys.forest.utils中ForestConfiguration的使用
修饰符和类型方法说明static MapReflectUtils.convertObjectToMap(Object srcObj, ForestConfiguration configuration)