public class ThriftServerService extends com.google.common.util.concurrent.AbstractIdleService
ThriftServer
,封装为Service
Modifier and Type | Class and Description |
---|---|
static class |
ThriftServerService.Builder |
Modifier and Type | Field and Description |
---|---|
static com.google.common.collect.ImmutableMap<java.lang.String,com.facebook.nifty.codec.ThriftFrameCodecFactory> |
DEFAULT_FRAME_CODEC_FACTORIES
在
ThriftServer.DEFAULT_FRAME_CODEC_FACTORIES 基础上增加'http'支持 |
static com.google.common.collect.ImmutableMap<java.lang.String,com.facebook.nifty.duplex.TDuplexProtocolFactory> |
DEFAULT_PROTOCOL_FACTORIES
在
ThriftServer.DEFAULT_PROTOCOL_FACTORIES 基础上增加'json'支持 |
static java.lang.String |
HTTP_TRANSPORT |
static java.lang.String |
JSON_PROTOCOL |
protected com.facebook.swift.service.ThriftServiceProcessor |
processor |
protected java.lang.String |
serviceName |
protected com.facebook.swift.service.ThriftServer |
thriftServer |
protected com.facebook.swift.service.ThriftServerConfig |
thriftServerConfig |
Constructor and Description |
---|
ThriftServerService(java.util.List<?> services,
java.util.List<com.facebook.swift.service.ThriftEventHandler> eventHandlers,
com.facebook.swift.service.ThriftServerConfig thriftServerConfig)
构造函数
|
Modifier and Type | Method and Description |
---|---|
protected void |
addCorsHandlerIfHttp()
添加CORS Handler和XHR编解码器
|
static ThriftServerService.Builder |
bulider() |
static void |
logThriftServerConfig(com.facebook.swift.service.ThriftServerConfig config)
log 输出
config 中的关键参数 |
protected java.lang.String |
serviceName() |
protected void |
shutDown() |
protected void |
startUp() |
public static final java.lang.String HTTP_TRANSPORT
public static final java.lang.String JSON_PROTOCOL
public static final com.google.common.collect.ImmutableMap<java.lang.String,com.facebook.nifty.duplex.TDuplexProtocolFactory> DEFAULT_PROTOCOL_FACTORIES
ThriftServer.DEFAULT_PROTOCOL_FACTORIES
基础上增加'json'支持public static final com.google.common.collect.ImmutableMap<java.lang.String,com.facebook.nifty.codec.ThriftFrameCodecFactory> DEFAULT_FRAME_CODEC_FACTORIES
ThriftServer.DEFAULT_FRAME_CODEC_FACTORIES
基础上增加'http'支持protected final com.facebook.swift.service.ThriftServer thriftServer
protected final com.facebook.swift.service.ThriftServiceProcessor processor
protected final com.facebook.swift.service.ThriftServerConfig thriftServerConfig
protected final java.lang.String serviceName
public ThriftServerService(java.util.List<?> services, java.util.List<com.facebook.swift.service.ThriftEventHandler> eventHandlers, com.facebook.swift.service.ThriftServerConfig thriftServerConfig)
services
- 服务对象列表eventHandlers
- 事件侦听器列表thriftServerConfig
- 服务配置对象ThriftServiceProcessor.ThriftServiceProcessor(ThriftCodecManager, List, List)
,
ThriftServer.ThriftServer(com.facebook.nifty.processor.NiftyProcessor, ThriftServerConfig)
public static final ThriftServerService.Builder bulider()
protected void addCorsHandlerIfHttp()
protected java.lang.String serviceName()
serviceName
in class com.google.common.util.concurrent.AbstractIdleService
protected final void startUp() throws java.lang.Exception
startUp
in class com.google.common.util.concurrent.AbstractIdleService
java.lang.Exception
protected final void shutDown()
shutDown
in class com.google.common.util.concurrent.AbstractIdleService
public static final void logThriftServerConfig(com.facebook.swift.service.ThriftServerConfig config)
config
中的关键参数Copyright © 2019. All rights reserved.