當前位置: 首頁>>代碼示例>>Java>>正文


Java TThreadPoolServer類代碼示例

本文整理匯總了Java中org.apache.thrift7.server.TThreadPoolServer的典型用法代碼示例。如果您正苦於以下問題:Java TThreadPoolServer類的具體用法?Java TThreadPoolServer怎麽用?Java TThreadPoolServer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


TThreadPoolServer類屬於org.apache.thrift7.server包,在下文中一共展示了TThreadPoolServer類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getServer

import org.apache.thrift7.server.TThreadPoolServer; //導入依賴的package包/類
@Override
public TServer getServer(int port, TProcessor processor)
		throws IOException, TTransportException {
	TTransportFactory serverTransportFactory = getServerTransportFactory();

	// define THsHaServer args
	// original: THsHaServer + TNonblockingServerSocket
	// option: TThreadPoolServer + TServerSocket
	TServerSocket serverTransport = new TServerSocket(port);
	TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
			serverTransport).processor(new TUGIWrapProcessor(processor))
			.minWorkerThreads(64).maxWorkerThreads(64)
			.protocolFactory(new TBinaryProtocol.Factory());
	if (serverTransportFactory != null)
		server_args.transportFactory(serverTransportFactory);

	// construct THsHaServer
	return new TThreadPoolServer(server_args);
}
 
開發者ID:zhangjunfang,項目名稱:jstorm-0.9.6.3-,代碼行數:20,代碼來源:SaslTransportPlugin.java

示例2: getServer

import org.apache.thrift7.server.TThreadPoolServer; //導入依賴的package包/類
public TServer getServer(int port, TProcessor processor)
		throws IOException, TTransportException {
	TTransportFactory serverTransportFactory = getServerTransportFactory();

	// define THsHaServer args
	// original: THsHaServer + TNonblockingServerSocket
	// option: TThreadPoolServer + TServerSocket
	TServerSocket serverTransport = new TServerSocket(port);
	TThreadPoolServer.Args server_args = new TThreadPoolServer.Args(
			serverTransport).processor(new TUGIWrapProcessor(processor))
			.minWorkerThreads(64).maxWorkerThreads(64)
			.protocolFactory(new TBinaryProtocol.Factory());
	if (serverTransportFactory != null)
		server_args.transportFactory(serverTransportFactory);

	// construct THsHaServer
	return new TThreadPoolServer(server_args);
}
 
開發者ID:songtk,項目名稱:learn_jstorm,代碼行數:19,代碼來源:SaslTransportPlugin.java


注:本文中的org.apache.thrift7.server.TThreadPoolServer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。