Index: mojo/bindings/java/src/org/chromium/mojo/bindings/Router.java |
diff --git a/mojo/bindings/java/src/org/chromium/mojo/bindings/Router.java b/mojo/bindings/java/src/org/chromium/mojo/bindings/Router.java |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6a90e4663f406fe68f11c1d4ce0cf340015c817d |
--- /dev/null |
+++ b/mojo/bindings/java/src/org/chromium/mojo/bindings/Router.java |
@@ -0,0 +1,36 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package org.chromium.mojo.bindings; |
+ |
+import org.chromium.mojo.system.MessagePipeHandle; |
+ |
+/** |
+ * A {@link Router} will handle mojo message and forward those to a {@link Connector}. It handles |
rmcilroy
2014/07/10 19:03:58
/s/It handles.../It deals with parsing of headers
qsr
2014/07/11 11:42:08
Done.
|
+ * parsing headers and add request ids to be able to match response to request. |
+ */ |
+public interface Router extends MessageReceiverWithResponder, HandleOwner<MessagePipeHandle> { |
+ |
+ /** |
+ * Start listening for incoming messages. |
+ */ |
+ public void start(); |
+ |
+ /** |
+ * Set the {@link MessageReceiverWithResponder} that will deserialize and use the message |
+ * received from the pipe. |
+ */ |
+ public void setIncomingMessageReceiver(MessageReceiverWithResponder incomingMessageReceiver); |
+ |
+ /** |
+ * Set the handle that will be notified of errors on the message pipe. |
+ */ |
+ public void setErrorHandler(ConnectionErrorHandler errorHandler); |
+ |
+ /** |
+ * @see java.io.Closeable#close() |
+ */ |
+ @Override |
+ public void close(); |
+} |