New protocol wrapping transport model for Thrift Java
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@664846 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/java/src/server/TServer.java b/lib/java/src/server/TServer.java
index 3cae00b..5ef96d0 100644
--- a/lib/java/src/server/TServer.java
+++ b/lib/java/src/server/TServer.java
@@ -1,9 +1,10 @@
package com.facebook.thrift.server;
import com.facebook.thrift.TProcessor;
+import com.facebook.thrift.protocol.TBinaryProtocol;
+import com.facebook.thrift.protocol.TProtocolFactory;
import com.facebook.thrift.transport.TServerTransport;
import com.facebook.thrift.transport.TTransportFactory;
-import com.facebook.thrift.transport.TBaseTransportFactory;
/**
* Generic interface for a Thrift server.
@@ -13,24 +14,11 @@
public abstract class TServer {
/**
- * The options class should be subclassed by particular servers which have
- * specific options needs, while the general options should live here.
- */
- public static class Options {
- public Options() {}
- }
-
- /**
* Core processor
*/
protected TProcessor processor_;
/**
- * Server options
- */
- protected Options options_;
-
- /**
* Server transport
*/
protected TServerTransport serverTransport_;
@@ -41,6 +29,11 @@
protected TTransportFactory transportFactory_;
/**
+ * Protocol Factory
+ */
+ protected TProtocolFactory protocolFactory_;
+
+ /**
* Default constructors.
*/
@@ -48,8 +41,8 @@
TServerTransport serverTransport) {
this(processor,
serverTransport,
- new TBaseTransportFactory(),
- new Options());
+ new TTransportFactory(),
+ new TBinaryProtocol.Factory());
}
protected TServer(TProcessor processor,
@@ -58,31 +51,22 @@
this(processor,
serverTransport,
transportFactory,
- new Options());
- }
-
-
- protected TServer(TProcessor processor,
- TServerTransport serverTransport,
- Options options) {
- this(processor,
- serverTransport,
- new TBaseTransportFactory(),
- options);
+ new TBinaryProtocol.Factory());
}
protected TServer(TProcessor processor,
TServerTransport serverTransport,
TTransportFactory transportFactory,
- Options options) {
+ TProtocolFactory protocolFactory) {
processor_ = processor;
serverTransport_ = serverTransport;
transportFactory_ = transportFactory;
- options_ = options;
+ protocolFactory_ = protocolFactory;
}
/**
* The run method fires up the server and gets things going.
*/
public abstract void serve();
+
}