本文整理匯總了Java中org.apache.thrift.server.TServer.Args方法的典型用法代碼示例。如果您正苦於以下問題:Java TServer.Args方法的具體用法?Java TServer.Args怎麽用?Java TServer.Args使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.thrift.server.TServer
的用法示例。
在下文中一共展示了TServer.Args方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: startServer
import org.apache.thrift.server.TServer; //導入方法依賴的package包/類
public void startServer() {
try {
logger.info("TSimpleServer start ....");
// TMultiplexedProcessor
TMultiplexedProcessor processor = new TMultiplexedProcessor();
processor.registerProcessor("Algorithm",
new AlgorithmService.Processor<>(new AlgorithmServiceImpl()));
TServerSocket serverTransport = new TServerSocket(SERVER_PORT);
TServer.Args args = new TServer.Args(serverTransport);
args.processor(processor);
args.protocolFactory(new TBinaryProtocol.Factory());
// args.protocolFactory(new TJSONProtocol.Factory());
TServer server = new TSimpleServer(args);
server.serve();
} catch (Exception e) {
logger.error("Server start error!!!");
e.printStackTrace();
}
}
示例2: getServerArgs
import org.apache.thrift.server.TServer; //導入方法依賴的package包/類
@SuppressWarnings("null")
public static TServer.AbstractServerArgs<?> getServerArgs(TServerTransport transport, Properties properties) {
TServer.AbstractServerArgs<?> args = null;
ThriftConfigurationHelper thriftConfiguration = new ThriftConfigurationHelper(properties);
switch (thriftConfiguration.getServerMode()) {
case Simple:
args = new TServer.Args(transport);
break;
case ThreadedPool:
args = new TThreadPoolServer.Args(transport);
break;
case HsHa:
throw new IllegalArgumentException("Unable to create an HsHa Server Args at this time");
}
// Use the EzSecureTransport (exposes peer ssl certs) if using SSL
if (thriftConfiguration.useSSL()) {
args.inputTransportFactory(new EzSecureServerTransport.Factory(properties));
}
return args;
}
示例3: TServerArgsAspect
import org.apache.thrift.server.TServer; //導入方法依賴的package包/類
public TServer.Args TServerArgsAspect(TServer.Args args) {
return args;
}