Class AbstractHTTPServer
- java.lang.Object
-
- org.apache.eventmesh.runtime.boot.AbstractRemotingServer
-
- org.apache.eventmesh.runtime.boot.AbstractHTTPServer
-
- Direct Known Subclasses:
EventMeshHTTPServer
public abstract class AbstractHTTPServer extends AbstractRemotingServer
-
-
Field Summary
Fields Modifier and Type Field Description java.util.concurrent.ThreadPoolExecutorasyncContextCompleteHandlerio.netty.handler.codec.http.multipart.DefaultHttpDataFactorydefaultHttpDataFactoryprotected java.util.Map<java.lang.String,Pair<EventProcessor,java.util.concurrent.ThreadPoolExecutor>>eventProcessorTableprotected HandlerServicehandlerServiceorg.slf4j.LoggerhttpLoggerorg.slf4j.LoggerhttpServerLoggerHTTPMetricsServermetricsprotected java.util.Map<java.lang.String,Pair<HttpRequestProcessor,java.util.concurrent.ThreadPoolExecutor>>processorTablejava.lang.BooleanuseTrace-
Fields inherited from class org.apache.eventmesh.runtime.boot.AbstractRemotingServer
bossGroup, ioGroup, logger, port, workerGroup
-
-
Constructor Summary
Constructors Constructor Description AbstractHTTPServer(int port, boolean useTLS, EventMeshHTTPConfiguration eventMeshHttpConfiguration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(java.lang.String threadPrefix)voidregisterProcessor(java.lang.Integer requestCode, HttpRequestProcessor processor, java.util.concurrent.ThreadPoolExecutor executor)voidregisterProcessor(java.lang.String requestURI, EventProcessor processor, java.util.concurrent.ThreadPoolExecutor executor)voidsendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status)voidsendResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.DefaultFullHttpResponse response)voidshutdown()voidstart()
-
-
-
Field Detail
-
httpServerLogger
public org.slf4j.Logger httpServerLogger
-
httpLogger
public org.slf4j.Logger httpLogger
-
handlerService
protected HandlerService handlerService
-
metrics
public HTTPMetricsServer metrics
-
defaultHttpDataFactory
public io.netty.handler.codec.http.multipart.DefaultHttpDataFactory defaultHttpDataFactory
-
useTrace
public java.lang.Boolean useTrace
-
asyncContextCompleteHandler
public java.util.concurrent.ThreadPoolExecutor asyncContextCompleteHandler
-
processorTable
protected final java.util.Map<java.lang.String,Pair<HttpRequestProcessor,java.util.concurrent.ThreadPoolExecutor>> processorTable
-
eventProcessorTable
protected final java.util.Map<java.lang.String,Pair<EventProcessor,java.util.concurrent.ThreadPoolExecutor>> eventProcessorTable
-
-
Constructor Detail
-
AbstractHTTPServer
public AbstractHTTPServer(int port, boolean useTLS, EventMeshHTTPConfiguration eventMeshHttpConfiguration)
-
-
Method Detail
-
sendError
public void sendError(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpResponseStatus status)
-
sendResponse
public void sendResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.DefaultFullHttpResponse response)
-
start
public void start() throws java.lang.Exception- Overrides:
startin classAbstractRemotingServer- Throws:
java.lang.Exception
-
init
public void init(java.lang.String threadPrefix) throws java.lang.Exception- Overrides:
initin classAbstractRemotingServer- Throws:
java.lang.Exception
-
shutdown
public void shutdown() throws java.lang.Exception- Overrides:
shutdownin classAbstractRemotingServer- Throws:
java.lang.Exception
-
registerProcessor
public void registerProcessor(java.lang.Integer requestCode, HttpRequestProcessor processor, java.util.concurrent.ThreadPoolExecutor executor)
-
registerProcessor
public void registerProcessor(java.lang.String requestURI, EventProcessor processor, java.util.concurrent.ThreadPoolExecutor executor)
-
-