Class GrpcExceptionHandlerMethodResolver
java.lang.Object
org.springframework.grpc.server.advice.GrpcExceptionHandlerMethodResolver
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
public class GrpcExceptionHandlerMethodResolver
extends Object
implements org.springframework.beans.factory.InitializingBean
Maps exception types to
@GrpcExceptionHandler methods.- Author:
- Oleksandr Shevchenko
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGrpcExceptionHandlerMethodResolver(GrpcAdviceDiscoverer grpcAdviceDiscoverer) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid<E extends Throwable>
booleanisMethodMappedForException(Class<E> exception) Check if a handler method exists for the given exception type.resolveMethodWithInstance(Class<E> exceptionType) Resolve the handler method and bean instance for the given exception type.
-
Constructor Details
-
GrpcExceptionHandlerMethodResolver
Create a new instance.- Parameters:
grpcAdviceDiscoverer- the advice discoverer to use
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
resolveMethodWithInstance
public <E extends Throwable> Map.Entry<@Nullable Object, @Nullable Method> resolveMethodWithInstance(Class<E> exceptionType) Resolve the handler method and bean instance for the given exception type.- Type Parameters:
E- the exception type- Parameters:
exceptionType- the exception type to resolve- Returns:
- entry with bean and method, or nulls if no mapping exists
-
isMethodMappedForException
-