Search in sources :

Example 6 with TNonblockingServerTransport

use of org.apache.thrift.transport.TNonblockingServerTransport in project lucida by claritylab.

the class QADaemon method main.

/** 
	 * Entry point for question-answer.
	 * @param args the argument list. Provide port numbers
	 * for both sirius and qa.
	 */
public static void main(String[] args) throws TTransportException, IOException, InterruptedException {
    TProcessor proc = new LucidaService.AsyncProcessor(new QAServiceHandler.AsyncQAServiceHandler());
    TNonblockingServerTransport transport = new TNonblockingServerSocket(8083);
    TThreadedSelectorServer.Args arguments = new TThreadedSelectorServer.Args(transport).processor(proc).protocolFactory(new TBinaryProtocol.Factory()).transportFactory(new TFramedTransport.Factory());
    final TThreadedSelectorServer server = new TThreadedSelectorServer(arguments);
    System.out.println("QA at port 8083");
    server.serve();
}
Also used : AsyncQAServiceHandler(lucida.handler.QAServiceHandler.AsyncQAServiceHandler) TNonblockingServerTransport(org.apache.thrift.transport.TNonblockingServerTransport) TProcessor(org.apache.thrift.TProcessor) TFramedTransport(org.apache.thrift.transport.TFramedTransport) TNonblockingServerSocket(org.apache.thrift.transport.TNonblockingServerSocket) TThreadedSelectorServer(org.apache.thrift.server.TThreadedSelectorServer) AsyncQAServiceHandler(lucida.handler.QAServiceHandler.AsyncQAServiceHandler)

Aggregations

TNonblockingServerSocket (org.apache.thrift.transport.TNonblockingServerSocket)6 TNonblockingServerTransport (org.apache.thrift.transport.TNonblockingServerTransport)6 TThreadedSelectorServer (org.apache.thrift.server.TThreadedSelectorServer)4 ExecutorService (java.util.concurrent.ExecutorService)3 TProcessor (org.apache.thrift.TProcessor)3 TFramedTransport (org.apache.thrift.transport.TFramedTransport)3 THsHaServer (org.apache.thrift.server.THsHaServer)2 TNonblockingServer (org.apache.thrift.server.TNonblockingServer)2 InetAddress (java.net.InetAddress)1 InetSocketAddress (java.net.InetSocketAddress)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 LinkedBlockingQueue (java.util.concurrent.LinkedBlockingQueue)1 Callback (javax.security.auth.callback.Callback)1 UnsupportedCallbackException (javax.security.auth.callback.UnsupportedCallbackException)1 AuthorizeCallback (javax.security.sasl.AuthorizeCallback)1 SaslServer (javax.security.sasl.SaslServer)1 AsyncQAServiceHandler (lucida.handler.QAServiceHandler.AsyncQAServiceHandler)1 LogFactory (org.apache.commons.logging.LogFactory)1