THRIFT-1316. cpp: update server classes to accept
TProcessorFactory objects
Patch: Adam Simpkins
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1164201 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/server/TThreadedServer.cpp b/lib/cpp/src/server/TThreadedServer.cpp
index 43d1df2..f40135c 100644
--- a/lib/cpp/src/server/TThreadedServer.cpp
+++ b/lib/cpp/src/server/TThreadedServer.cpp
@@ -119,24 +119,12 @@
shared_ptr<TTransport> transport_;
};
+void TThreadedServer::init() {
+ stop_ = false;
-TThreadedServer::TThreadedServer(shared_ptr<TProcessor> processor,
- shared_ptr<TServerTransport> serverTransport,
- shared_ptr<TTransportFactory> transportFactory,
- shared_ptr<TProtocolFactory> protocolFactory):
- TServer(processor, serverTransport, transportFactory, protocolFactory),
- stop_(false) {
- threadFactory_ = shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
-}
-
-TThreadedServer::TThreadedServer(boost::shared_ptr<TProcessor> processor,
- boost::shared_ptr<TServerTransport> serverTransport,
- boost::shared_ptr<TTransportFactory> transportFactory,
- boost::shared_ptr<TProtocolFactory> protocolFactory,
- boost::shared_ptr<ThreadFactory> threadFactory):
- TServer(processor, serverTransport, transportFactory, protocolFactory),
- threadFactory_(threadFactory),
- stop_(false) {
+ if (!threadFactory_) {
+ threadFactory_.reset(new PosixThreadFactory);
+ }
}
TThreadedServer::~TThreadedServer() {}