THRIFT-928. cpp: Thrift Server Client Stats

Add the ability for Thrift servers to monitor client connections.  It is
activated by #including server/TClientInfo.h and creating 1) a
TClientInfoCallHandler passed to the processor with setEventHandler()
and 2) a TClientInforServerHandler passed to the server with
setServerEventHandler().

The result vector, showing active connections, provides client address
and the thrift call it is executing (or last executed), the time
connected, and the number of calls made since connection.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1005139 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/server/TServer.h b/lib/cpp/src/server/TServer.h
index 5c4c588..4dddfea 100644
--- a/lib/cpp/src/server/TServer.h
+++ b/lib/cpp/src/server/TServer.h
@@ -57,14 +57,33 @@
   /**
    * Called when a new client has connected and is about to being processing.
    */
-  virtual void clientBegin(boost::shared_ptr<TProtocol> /* input */,
-                           boost::shared_ptr<TProtocol> /* output */) {}
+  virtual void* createContext(boost::shared_ptr<TProtocol> input,
+                              boost::shared_ptr<TProtocol> output) {
+    (void)input;
+    (void)output;
+    return NULL;
+  }
 
   /**
-   * Called when a client has finished making requests.
+   * Called when a client has finished request-handling to delete server
+   * context.
    */
-  virtual void clientEnd(boost::shared_ptr<TProtocol> /* input */,
-                         boost::shared_ptr<TProtocol> /* output */) {}
+  virtual void deleteContext(void* serverContext,
+                             boost::shared_ptr<TProtocol>input,
+                             boost::shared_ptr<TProtocol>output) {
+    (void)serverContext;
+    (void)input;
+    (void)output;
+  }
+
+  /**
+   * Called when a client is about to call the processor.
+   */
+  virtual void processContext(void* serverContext,
+                              boost::shared_ptr<TTransport> transport) {
+    (void)serverContext;
+    (void)transport;
+}
 
  protected: