Author: bryanduxbury
Date: Tue Oct 19 18:06:45 2010
New Revision: 1024343
URL: http://svn.apache.org/viewvc?rev=1024343&view=rev
Log:
THRIFT-957. java: THsHaServer: Change access modifier of the invoker field.
This patch adds a new overridable method to allow subclasses to specify their
own Runnable implementation.
Patch: Benjamin Coverston
Modified:
incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java
Modified:
incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java
URL:
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java?rev=1024343&r1=1024342&r2=1024343&view=diff
==============================================================================
---
incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java
(original)
+++
incubator/thrift/trunk/lib/java/src/org/apache/thrift/server/THsHaServer.java
Tue Oct 19 18:06:45 2010
@@ -57,7 +57,7 @@ public class THsHaServer extends TNonblo
TNonblockingServerTransport serverTransport) {
this(processor, serverTransport, new Options());
}
-
+
/**
* Create server with given processor, server transport, and server options
* using TBinaryProtocol for the protocol, and TFramedTransport.Factory on
@@ -296,7 +296,8 @@ public class THsHaServer extends TNonblo
@Override
protected boolean requestInvoke(FrameBuffer frameBuffer) {
try {
- invoker.execute(new Invocation(frameBuffer));
+ Runnable invocation = getRunnable(frameBuffer);
+ invoker.execute(invocation);
return true;
} catch (RejectedExecutionException rx) {
LOGGER.warn("ExecutorService rejected execution!", rx);
@@ -304,6 +305,10 @@ public class THsHaServer extends TNonblo
}
}
+ protected Runnable getRunnable(FrameBuffer frameBuffer){
+ return new Invocation(frameBuffer);
+ }
+
/**
* An Invocation represents a method call that is prepared to execute, given
* an idle worker thread. It contains the input and output protocols the