Package io.helidon.grpc.server
Interface MethodDescriptor.Rules<ReqT,ResT>
-
- Type Parameters:
ReqT- request typeResT- response type
- Enclosing class:
- MethodDescriptor<ReqT,ResT>
public static interface MethodDescriptor.Rules<ReqT,ResT>Method configuration API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> MethodDescriptor.Rules<ReqT,ResT>addContextValue(io.grpc.Context.Key<T> key, T value)Add aContext.Keyand value to be added to the callContextwhen this method is invoked.MethodDescriptor.Rules<ReqT,ResT>intercept(int priority, io.grpc.ServerInterceptor... interceptors)Register one or moreinterceptorsfor the method.MethodDescriptor.Rules<ReqT,ResT>intercept(io.grpc.ServerInterceptor... interceptors)Register one or moreinterceptorsfor the method.MethodDescriptor.Rules<ReqT,ResT>marshallerSupplier(MarshallerSupplier marshallerSupplier)Register theMarshallerSupplierfor the method.<Rnew> MethodDescriptor.Rules<Rnew,ResT>requestType(Class<Rnew> requestType)Set the request type.<Rnew> MethodDescriptor.Rules<ReqT,Rnew>responseType(Class<Rnew> responseType)Set the response type.
-
-
-
Method Detail
-
addContextValue
<T> MethodDescriptor.Rules<ReqT,ResT> addContextValue(io.grpc.Context.Key<T> key, T value)
Add aContext.Keyand value to be added to the callContextwhen this method is invoked.- Type Parameters:
T- the type of theContext.Keyand value- Parameters:
key- theContext.Keyto addvalue- the value to map to theContext.Key- Returns:
- this
MethodDescriptor.Rulesinstance for fluent call chaining - Throws:
NullPointerException- if the key parameter is null
-
intercept
MethodDescriptor.Rules<ReqT,ResT> intercept(io.grpc.ServerInterceptor... interceptors)
Register one or moreinterceptorsfor the method.- Parameters:
interceptors- one or moreServerInterceptors to register- Returns:
- this builder to allow fluent method chaining
-
intercept
MethodDescriptor.Rules<ReqT,ResT> intercept(int priority, io.grpc.ServerInterceptor... interceptors)
Register one or moreinterceptorsfor the method.The added interceptors will be applied using the specified priority.
- Parameters:
priority- the priority to assign to the interceptorsinterceptors- one or moreServerInterceptors to register- Returns:
- this builder to allow fluent method chaining
-
marshallerSupplier
MethodDescriptor.Rules<ReqT,ResT> marshallerSupplier(MarshallerSupplier marshallerSupplier)
Register theMarshallerSupplierfor the method.If not set the default
MarshallerSupplierfrom the service will be used.- Parameters:
marshallerSupplier- theMarshallerSupplierfor the service- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
requestType
<Rnew> MethodDescriptor.Rules<Rnew,ResT> requestType(Class<Rnew> requestType)
Set the request type.Setting the request type is optional as it is used to obtain the correct marshaller so if the marshaller supplier being used is type agnostic, such as Java serialization then whereas some marshallers such as Protocol Buffers require a type.
- Type Parameters:
Rnew- the type of the request message- Parameters:
requestType- the type of the request message- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
responseType
<Rnew> MethodDescriptor.Rules<ReqT,Rnew> responseType(Class<Rnew> responseType)
Set the response type.Setting the response type is optional as it is used to obtain the correct marshaller so if the marshaller supplier being used is type agnostic, such as Java serialization then whereas some marshallers such as Protocol Buffers require a type.
- Type Parameters:
Rnew- the type of the request message- Parameters:
responseType- the type of the request message- Returns:
- this
ServiceDescriptor.Rulesinstance for fluent call chaining
-
-