Add private constructor to Contexts and mark statusFromCancelled experimental. Fixes #1737 and #1736. (#1738)

This commit is contained in:
Jakob Buchgraber 2016-04-28 17:12:14 +02:00
parent 80f73a4a16
commit 645bb24c6c
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,9 @@ import java.util.concurrent.TimeoutException;
*/
public class Contexts {
private Contexts() {
}
/**
* Make the provided {@link Context} {@link Context#current()} for the creation of a listener
* to a received call and for all events received by that listener.
@ -139,6 +142,7 @@ public class Contexts {
* Returns the {@link Status} of a cancelled context or {@code null} if the context
* is not cancelled.
*/
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1737")
public static Status statusFromCancelled(Context context) {
Preconditions.checkNotNull(context, "context must not be null");
if (!context.isCancelled()) {