public class HttpServerHandler extends Object implements ServerHandler
| 限定符和类型 | 字段和说明 |
|---|---|
protected ThreadPoolExecutor |
bizThreadPool
业务线程池
|
protected Map<String,Invoker> |
invokerMap
Invoker列表,接口--> Invoker
|
protected AtomicInteger |
processingCount
当前Client正在发送的调用数量
|
| 构造器和说明 |
|---|
HttpServerHandler(ThreadPoolExecutor bizThreadPool) |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
checkService(String serviceName,
String methodName)
Check service exists
|
ThreadPoolExecutor |
getBizThreadPool() |
Map<String,Invoker> |
getInvokerMap() |
protected Method |
getMethod(String serviceName,
String methodName) |
AtomicInteger |
getProcessingCount() |
void |
handleHttp1Request(SofaRequest request,
io.netty.channel.ChannelHandlerContext ctx,
boolean keepAlive)
Handle request from HTTP/1.1
|
void |
handleHttp2Request(int streamId,
SofaRequest request,
io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http2.Http2ConnectionEncoder encoder)
Handle request from HTTP/2
|
protected boolean |
isEmpty() |
void |
registerChannel(AbstractChannel nettyChannel)
Register channel.
|
void |
unRegisterChannel(AbstractChannel nettyChannel)
Un register channel.
|
protected AtomicInteger processingCount
protected ThreadPoolExecutor bizThreadPool
public HttpServerHandler(ThreadPoolExecutor bizThreadPool)
public AtomicInteger getProcessingCount()
public void registerChannel(AbstractChannel nettyChannel)
ServerHandlerregisterChannel 在接口中 ServerHandlernettyChannel - the netty channelpublic void unRegisterChannel(AbstractChannel nettyChannel)
ServerHandlerunRegisterChannel 在接口中 ServerHandlernettyChannel - the netty channelpublic void handleHttp1Request(SofaRequest request, io.netty.channel.ChannelHandlerContext ctx, boolean keepAlive)
request - SofaRequestctx - ChannelHandlerContextkeepAlive - keepAlivepublic void handleHttp2Request(int streamId,
SofaRequest request,
io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http2.Http2ConnectionEncoder encoder)
streamId - stream Idrequest - SofaRequestctx - ChannelHandlerContextencoder - Http2ConnectionEncoderprotected boolean isEmpty()
public boolean checkService(String serviceName, String methodName)
serviceName - Service NamemethodName - Method namepublic ThreadPoolExecutor getBizThreadPool()
Copyright © 2008–2018 The Ant Financial. All rights reserved.