Module io.helidon.grpc.server
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
Modifier and TypeMethodDescriptionaddContextValue
(io.grpc.Context.Key<T> key, T value) Add aContext.Key
and value to be added to the callContext
when this method is invoked.intercept
(int priority, io.grpc.ServerInterceptor... interceptors) Register one or moreinterceptors
for the method.intercept
(io.grpc.ServerInterceptor... interceptors) Register one or moreinterceptors
for the method.marshallerSupplier
(MarshallerSupplier marshallerSupplier) Register theMarshallerSupplier
for 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 Details
-
addContextValue
Add aContext.Key
and value to be added to the callContext
when this method is invoked.- Type Parameters:
T
- the type of theContext.Key
and value- Parameters:
key
- theContext.Key
to addvalue
- the value to map to theContext.Key
- Returns:
- this
MethodDescriptor.Rules
instance for fluent call chaining - Throws:
NullPointerException
- if the key parameter is null
-
intercept
Register one or moreinterceptors
for the method.- Parameters:
interceptors
- one or moreServerInterceptor
s 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 moreinterceptors
for the method.The added interceptors will be applied using the specified priority.
- Parameters:
priority
- the priority to assign to the interceptorsinterceptors
- one or moreServerInterceptor
s to register- Returns:
- this builder to allow fluent method chaining
-
marshallerSupplier
Register theMarshallerSupplier
for the method.If not set the default
MarshallerSupplier
from the service will be used.- Parameters:
marshallerSupplier
- theMarshallerSupplier
for the service- Returns:
- this
ServiceDescriptor.Rules
instance for fluent call chaining
-
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.Rules
instance for fluent call chaining
-
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.Rules
instance for fluent call chaining
-