Thrift: Rename run() to serve() in java interfaces
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664797 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/compiler/cpp/src/parse/t_program.h b/compiler/cpp/src/parse/t_program.h
index 9fa4271..74b9360 100644
--- a/compiler/cpp/src/parse/t_program.h
+++ b/compiler/cpp/src/parse/t_program.h
@@ -66,7 +66,7 @@
// Accessors for global types
t_type* get_void_type() const { return type_void; }
t_type* get_string_type() const { return type_string; }
- t_type* get_bool_type() const { return type_byte; }
+ t_type* get_bool_type() const { return type_bool; }
t_type* get_byte_type() const { return type_byte; }
t_type* get_i16_type() const { return type_i16; }
t_type* get_i32_type() const { return type_i32; }
diff --git a/compiler/cpp/src/thrift.y b/compiler/cpp/src/thrift.y
index f2fd790..4b2dde7 100644
--- a/compiler/cpp/src/thrift.y
+++ b/compiler/cpp/src/thrift.y
@@ -255,10 +255,10 @@
{}
Function:
- FunctionType AsyncOptional tok_identifier '(' FieldList ')' ThrowsOptional
+ AsyncOptional FunctionType tok_identifier '(' FieldList ')' ThrowsOptional
{
$5->set_name(std::string($3) + "_args");
- $$ = new t_function($1, $3, $5, $7, $2);
+ $$ = new t_function($2, $3, $5, $7, $1);
y_field_val = -1;
}
diff --git a/lib/java/src/server/TServer.java b/lib/java/src/server/TServer.java
index dd83098..3cae00b 100644
--- a/lib/java/src/server/TServer.java
+++ b/lib/java/src/server/TServer.java
@@ -84,5 +84,5 @@
/**
* The run method fires up the server and gets things going.
*/
- public abstract void run();
+ public abstract void serve();
}
diff --git a/lib/java/src/server/TSimpleServer.java b/lib/java/src/server/TSimpleServer.java
index 05156c3..548ca09 100644
--- a/lib/java/src/server/TSimpleServer.java
+++ b/lib/java/src/server/TSimpleServer.java
@@ -18,7 +18,7 @@
super(processor, serverTransport);
}
- public void run() {
+ public void serve() {
try {
serverTransport_.listen();
} catch (TTransportException ttx) {
diff --git a/lib/java/src/server/TThreadPoolServer.java b/lib/java/src/server/TThreadPoolServer.java
index 7201cd3..c63d1e1 100644
--- a/lib/java/src/server/TThreadPoolServer.java
+++ b/lib/java/src/server/TThreadPoolServer.java
@@ -58,7 +58,7 @@
}
- public void run() {
+ public void serve() {
try {
serverTransport_.listen();
} catch (TTransportException ttx) {
@@ -67,13 +67,15 @@
}
while (true) {
+ int failureCount = 0;
try {
TTransport client = serverTransport_.accept();
WorkerProcess wp = new WorkerProcess(client);
executorService_.execute(wp);
} catch (TTransportException ttx) {
+ ++failureCount;
ttx.printStackTrace();
- }
+ }
}
}
diff --git a/test/java/src/TestServer.java b/test/java/src/TestServer.java
index ab8603a..fe70594 100644
--- a/test/java/src/TestServer.java
+++ b/test/java/src/TestServer.java
@@ -258,7 +258,7 @@
// Run it
System.out.println("Starting the server on port " + port + "...");
- serverEngine.run();
+ serverEngine.serve();
} catch (Exception x) {
x.printStackTrace();