Remove fluent-style from newtransport Stream.
The fluent-style wasn't being used, yet made it impossible to
simultaneously implement both ClientStream and ServerStream. Having a
single class that switches between client and server behavior based on a
boolean is helpful to some transports.
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=69028356
diff --git a/core/src/main/java/com/google/net/stubby/newtransport/ClientStream.java b/core/src/main/java/com/google/net/stubby/newtransport/ClientStream.java
index 7011608..b7b760c 100644
--- a/core/src/main/java/com/google/net/stubby/newtransport/ClientStream.java
+++ b/core/src/main/java/com/google/net/stubby/newtransport/ClientStream.java
@@ -4,7 +4,7 @@
/**
* Extension of {@link Stream} to support client-side termination semantics.
*/
-public interface ClientStream extends Stream<ClientStream> {
+public interface ClientStream extends Stream {
/**
* Used to abnormally terminate the stream. Any internally buffered messages are dropped. After
diff --git a/core/src/main/java/com/google/net/stubby/newtransport/ServerStream.java b/core/src/main/java/com/google/net/stubby/newtransport/ServerStream.java
index 2ebb239..1e629bb 100644
--- a/core/src/main/java/com/google/net/stubby/newtransport/ServerStream.java
+++ b/core/src/main/java/com/google/net/stubby/newtransport/ServerStream.java
@@ -6,7 +6,7 @@
/**
* Extension of {@link Stream} to support server-side termination semantics.
*/
-public interface ServerStream extends Stream<ServerStream> {
+public interface ServerStream extends Stream {
/**
* Closes the local side of this stream. A status code of
diff --git a/core/src/main/java/com/google/net/stubby/newtransport/Stream.java b/core/src/main/java/com/google/net/stubby/newtransport/Stream.java
index 0f8cd1f..ea97999 100644
--- a/core/src/main/java/com/google/net/stubby/newtransport/Stream.java
+++ b/core/src/main/java/com/google/net/stubby/newtransport/Stream.java
@@ -7,7 +7,7 @@
/**
* A single stream of communication between two end-points within a transport.
*/
-public interface Stream<T extends Stream<T>> {
+public interface Stream {
/**
* Gets the current state of this stream.
@@ -39,7 +39,7 @@
* @param accepted an optional callback for when the transport has accepted the write.
* @return this stream instance.
*/
- T writeContext(String name, InputStream value, int length, @Nullable Runnable accepted);
+ void writeContext(String name, InputStream value, int length, @Nullable Runnable accepted);
/**
* Writes a message payload to the remote end-point. The bytes from the stream are immediate read
@@ -58,10 +58,10 @@
* @param accepted an optional callback for when the transport has accepted the write.
* @return this stream instance.
*/
- T writeMessage(InputStream message, int length, @Nullable Runnable accepted);
+ void writeMessage(InputStream message, int length, @Nullable Runnable accepted);
/**
* Flushes any internally buffered messages to the remote end-point.
*/
- T flush();
+ void flush();
}