blob: 702ba6940e7dea06b179086a6298a517d6666d27 [file] [log] [blame]
Mark Slee83c52a82006-06-07 06:51:18 +00001package com.facebook.thrift.server;
2
3import com.facebook.thrift.TProcessor;
4
5/**
6 * Generic interface for a Thrift server.
7 *
8 * @author Mark Slee <mcslee@facebook.com>
9 */
10public abstract class TServer {
11
12 /**
13 * The options class should be subclassed by particular servers which have
14 * specific options needs, while the general options should live here.
15 */
16 public static class Options {
17 public Options() {}
18 }
19
20 /** Core processor */
21 protected TProcessor processor_;
22
23 /** Server options */
24 protected Options options_;
25
26 /**
Mark Sleeffcddd62006-09-06 20:37:03 +000027 * Default options constructor
28 */
29 protected TServer(TProcessor processor) {
30 this(processor, new Options());
31 }
32
33 /**
Mark Slee83c52a82006-06-07 06:51:18 +000034 * Default constructor, all servers take a processor and some options.
35 */
36 protected TServer(TProcessor processor, Options options) {
37 processor_ = processor;
38 options_ = options;
39 }
40
41 /**
42 * The run method fires up the server and gets things going.
43 */
44 public abstract void run();
45}