Create a TServerEventHandler interface in TServer

Summary: Such that users can supply an event handler to a server that will be used to signal various events that take place inside the server core.

Reviewed By: dreiss

Test Plan: Rebuilt all servers, work by default

Other Notes: Partially submitted and also reviewed by Dave Simpson at Powerset


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665371 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/server/TNonblockingServer.cpp
index 7735ec2..de32db5 100644
--- a/lib/cpp/src/server/TNonblockingServer.cpp
+++ b/lib/cpp/src/server/TNonblockingServer.cpp
@@ -675,9 +675,9 @@
   // Initialize libevent core
   registerEvents(static_cast<event_base*>(event_init()));
 
-  // Run pre-serve callback function if we have one
-  if (preServeCallback_) {
-    preServeCallback_(preServeCallbackArg_);
+  // Run the preServe event
+  if (eventHandler_ != NULL) {
+    eventHandler_->preServe();
   }
 
   // Run libevent engine, never returns, invokes calls to eventHandler