AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Protected 成员函数 | Protected 属性 | 静态 Protected 属性 | Private 成员函数 | 静态 Private 成员函数 | 静态 Private 属性 | 所有成员列表
com.ab.network.toolbox.BasicNetwork类 参考
类 com.ab.network.toolbox.BasicNetwork 继承关系图:
com.ab.network.toolbox.Network

Public 成员函数

 BasicNetwork (HttpStack httpStack)
 
 BasicNetwork (HttpStack httpStack, ByteArrayPool pool)
 
NetworkResponse performRequest (Request<?> request) throws VolleyError
 

Protected 成员函数

void logError (String what, String url, long start)
 

Protected 属性

final HttpStack mHttpStack
 
final ByteArrayPool mPool
 

静态 Protected 属性

static final boolean DEBUG = VolleyLog.DEBUG
 

Private 成员函数

void logSlowRequests (long requestLifetime, Request<?> request, byte[] responseContents, StatusLine statusLine)
 
void addCacheHeaders (Map< String, String > headers, Cache.Entry entry)
 
byte[] entityToBytes (HttpEntity entity) throws IOException, ServerError
 

静态 Private 成员函数

static void attemptRetryOnException (String logPrefix, Request<?> request, VolleyError exception) throws VolleyError
 
static Map< String, String > convertHeaders (Header[] headers)
 

静态 Private 属性

static int SLOW_REQUEST_THRESHOLD_MS = 3000
 
static int DEFAULT_POOL_SIZE = 4096
 

详细描述

A network performing Volley requests over an HttpStack.

构造及析构函数说明

com.ab.network.toolbox.BasicNetwork.BasicNetwork ( HttpStack  httpStack)
inline
参数
httpStackHTTP stack to be used
com.ab.network.toolbox.BasicNetwork.BasicNetwork ( HttpStack  httpStack,
ByteArrayPool  pool 
)
inline
参数
httpStackHTTP stack to be used
poola buffer pool that improves GC performance in copy operations

成员函数说明

void com.ab.network.toolbox.BasicNetwork.addCacheHeaders ( Map< String, String >  headers,
Cache.Entry  entry 
)
inlineprivate
static void com.ab.network.toolbox.BasicNetwork.attemptRetryOnException ( String  logPrefix,
Request<?>  request,
VolleyError  exception 
) throws VolleyError
inlinestaticprivate

Attempts to prepare the request for a retry. If there are no more attempts remaining in the request's retry policy, a timeout exception is thrown.

参数
requestThe request to use.
static Map<String, String> com.ab.network.toolbox.BasicNetwork.convertHeaders ( Header[]  headers)
inlinestaticprivate

Converts Headers[] to Map<String, String>.

byte [] com.ab.network.toolbox.BasicNetwork.entityToBytes ( HttpEntity  entity) throws IOException, ServerError
inlineprivate

Reads the contents of HttpEntity into a byte[].

void com.ab.network.toolbox.BasicNetwork.logError ( String  what,
String  url,
long  start 
)
inlineprotected
void com.ab.network.toolbox.BasicNetwork.logSlowRequests ( long  requestLifetime,
Request<?>  request,
byte[]  responseContents,
StatusLine  statusLine 
)
inlineprivate

Logs requests that took over SLOW_REQUEST_THRESHOLD_MS to complete.

NetworkResponse com.ab.network.toolbox.BasicNetwork.performRequest ( Request<?>  request) throws VolleyError
inline

Performs the specified request.

参数
requestRequest to process
返回
A NetworkResponse with data and caching metadata; will never be null
异常
VolleyErroron errors

实现了 com.ab.network.toolbox.Network.

类成员变量说明

final boolean com.ab.network.toolbox.BasicNetwork.DEBUG = VolleyLog.DEBUG
staticprotected
int com.ab.network.toolbox.BasicNetwork.DEFAULT_POOL_SIZE = 4096
staticprivate
final HttpStack com.ab.network.toolbox.BasicNetwork.mHttpStack
protected
final ByteArrayPool com.ab.network.toolbox.BasicNetwork.mPool
protected
int com.ab.network.toolbox.BasicNetwork.SLOW_REQUEST_THRESHOLD_MS = 3000
staticprivate

该类的文档由以下文件生成: