Getters for input/output protocol in client lib
authorMark Slee <mcslee@apache.org>
Sat, 9 Feb 2008 00:26:29 +0000 (00:26 +0000)
committerMark Slee <mcslee@apache.org>
Sat, 9 Feb 2008 00:26:29 +0000 (00:26 +0000)
Summary: Why not, nice to have. From Ted Dziuba.

Reviewed By: dreiss

Test Plan: Build Java compiler.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665471 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_java_generator.cc

index 52166bf..0440222 100644 (file)
@@ -972,6 +972,23 @@ void t_java_generator::generate_service_client(t_service* tservice) {
       endl <<
       indent() << "protected int seqid_;" << endl <<
       endl;
+
+    indent(f_service_) <<
+      "public TProtocol getInputProtocol()" << endl;
+    scope_up(f_service_);
+    indent(f_service_) <<
+      "return this.iprot_;" << endl;
+    scope_down(f_service_);
+    f_service_ << endl;
+
+    indent(f_service_) <<
+      "public TProtocol getOutputProtocol()" << endl;
+    scope_up(f_service_);
+    indent(f_service_) <<
+      "return this.oprot_;" << endl;
+    scope_down(f_service_);
+    f_service_ << endl;
+
   }
 
   // Generate client method implementations