From 4fd4845481f2a2e50c83f19a086f3137e47129cf Mon Sep 17 00:00:00 2001 From: ejona Date: Wed, 11 Jun 2014 16:32:20 -0700 Subject: [PATCH] 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 --- .../com/google/net/stubby/newtransport/ClientStream.java | 2 +- .../com/google/net/stubby/newtransport/ServerStream.java | 2 +- .../java/com/google/net/stubby/newtransport/Stream.java | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) 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 7011608bea..b7b760ce03 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 @@ package com.google.net.stubby.newtransport; /** * Extension of {@link Stream} to support client-side termination semantics. */ -public interface ClientStream extends Stream { +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 2ebb239f24..1e629bbace 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 @@ import com.google.net.stubby.Status; /** * Extension of {@link Stream} to support server-side termination semantics. */ -public interface ServerStream extends Stream { +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 0f8cd1f4cf..ea97999298 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 @@ import javax.annotation.Nullable; /** * A single stream of communication between two end-points within a transport. */ -public interface Stream> { +public interface Stream { /** * Gets the current state of this stream. @@ -39,7 +39,7 @@ public interface Stream> { * @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 @@ public interface Stream> { * @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(); }