diff options
author | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-05 13:28:06 +0200 |
---|---|---|
committer | Kjetil Ørbekk <kjetil.orbekk@gmail.com> | 2012-04-05 13:28:06 +0200 |
commit | eb16cf212c75c81b8714308c7848887447aee33f (patch) | |
tree | a71929128d588d45b66d2e1486c442b9d852a581 | |
parent | 9c982cf3c2c83edd3fdeecf57579a3076109e73c (diff) |
Add RequestHandler.
-rw-r--r-- | src/main/java/com/orbekk/protobuf/RequestHandler.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/com/orbekk/protobuf/RequestHandler.java b/src/main/java/com/orbekk/protobuf/RequestHandler.java new file mode 100644 index 0000000..0232a2c --- /dev/null +++ b/src/main/java/com/orbekk/protobuf/RequestHandler.java @@ -0,0 +1,32 @@ +import java.util.concurrent.BlockingQueue; + +/** + * TODO: Move services to this class. + */ + +public class RequestHandler extends Thread { + private volatile boolean isStopped = false; + private final BlockingQueue<Data.Request> input; + private final BlockingQueue<Data.Response> output; + + public RequestHandler(BlockingQueue<Data.Request> input, + BlockingQueue<Data.Response> output) { + this.input = input; + this.output = output; + } + + private void handleRequest() { + + } + + @Override public void run() { + while (!isStopped) { + handleRequest(); + } + } + + @Override public void interrupt() { + super.interrupt(); + isStopped = true; + } +} |