1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2008 Google Inc. All rights reserved. 3 // 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file or at 6 // https://developers.google.com/open-source/licenses/bsd 7 8 package com.google.protobuf; 9 10 /** 11 * Blocking equivalent to {@link Service}. 12 * 13 * @author kenton@google.com Kenton Varda 14 * @author cpovirk@google.com Chris Povirk 15 */ 16 public interface BlockingService { 17 /** Equivalent to {@link Service#getDescriptorForType}. */ getDescriptorForType()18 Descriptors.ServiceDescriptor getDescriptorForType(); 19 20 /** 21 * Equivalent to {@link Service#callMethod}, except that {@code callBlockingMethod()} returns the 22 * result of the RPC or throws a {@link ServiceException} if there is a failure, rather than 23 * passing the information to a callback. 24 */ callBlockingMethod( Descriptors.MethodDescriptor method, RpcController controller, Message request)25 Message callBlockingMethod( 26 Descriptors.MethodDescriptor method, RpcController controller, Message request) 27 throws ServiceException; 28 29 /** Equivalent to {@link Service#getRequestPrototype}. */ getRequestPrototype(Descriptors.MethodDescriptor method)30 Message getRequestPrototype(Descriptors.MethodDescriptor method); 31 32 /** Equivalent to {@link Service#getResponsePrototype}. */ getResponsePrototype(Descriptors.MethodDescriptor method)33 Message getResponsePrototype(Descriptors.MethodDescriptor method); 34 } 35