Class AnnotatedHandlerInspector<T>
java.lang.Object
org.axonframework.messaging.core.annotation.AnnotatedHandlerInspector<T>
- Type Parameters:
T- The target type.
Inspector for a message handling target of type
T that uses annotations on the target to inspect the
capabilities of the target.- Since:
- 3.0.0
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionchainedInterceptor(Class<?> type) Returns an Interceptor Chain of annotated interceptor methods defined on the giventype.Map<Class<?>, SortedSet<MessageHandlingMember<? super T>>> Gets all handlers per type for inspected entity.Returns aSetof all types which have been inspected for handlers.Map<Class<?>, SortedSet<MessageHandlingMember<? super T>>> Returns a Map of all registered interceptor methods per inspected type.SortedSet<MessageHandlingMember<? super T>> getHandlers(Class<?> type) Returns a sorted set of detected members of giventypethat are capable of handling certain messages.List<MessageHandlingMember<? super T>> getUniqueHandlers(Class<?> type, Class<? extends Message> messageType) Returns a list of detected members of giventype, that can handle messages ofmessageType.static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType) Create an inspector for givenhandlerTypethat uses aClasspathParameterResolverFactoryto resolve method parameters andClasspathHandlerDefinitionto create handlers.static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType, ParameterResolverFactory parameterResolverFactory) Create an inspector for givenhandlerTypethat uses givenparameterResolverFactoryto resolve method parameters.static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition) Create an inspector for givenhandlerTypethat uses givenparameterResolverFactoryto resolve method parameters and givenhandlerDefinitionto create handlers.static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition, Set<Class<? extends T>> declaredSubtypes) Create an inspector for givenhandlerTypeand itsdeclaredSubtypesthat uses givenparameterResolverFactoryto resolve method parameters and givenhandlerDefinitionto create handlers.
-
Method Details
-
inspectType
Create an inspector for givenhandlerTypethat uses aClasspathParameterResolverFactoryto resolve method parameters andClasspathHandlerDefinitionto create handlers.- Type Parameters:
T- the handler's type- Parameters:
handlerType- the target handler type- Returns:
- a new inspector instance for the inspected class
-
inspectType
public static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType, ParameterResolverFactory parameterResolverFactory) Create an inspector for givenhandlerTypethat uses givenparameterResolverFactoryto resolve method parameters.- Type Parameters:
T- the handler's type- Parameters:
handlerType- the target handler typeparameterResolverFactory- the resolver factory to use during detection- Returns:
- a new inspector instance for the inspected class
-
inspectType
public static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition) Create an inspector for givenhandlerTypethat uses givenparameterResolverFactoryto resolve method parameters and givenhandlerDefinitionto create handlers.- Type Parameters:
T- the handler's type- Parameters:
handlerType- the target handler typeparameterResolverFactory- the resolver factory to use during detectionhandlerDefinition- the handler definition used to create concrete handlers- Returns:
- a new inspector instance for the inspected class
-
inspectType
public static <T> AnnotatedHandlerInspector<T> inspectType(Class<T> handlerType, ParameterResolverFactory parameterResolverFactory, HandlerDefinition handlerDefinition, Set<Class<? extends T>> declaredSubtypes) Create an inspector for givenhandlerTypeand itsdeclaredSubtypesthat uses givenparameterResolverFactoryto resolve method parameters and givenhandlerDefinitionto create handlers.- Type Parameters:
T- the handler's type- Parameters:
handlerType- the target handler typeparameterResolverFactory- the resolver factory to use during detectionhandlerDefinition- the handler definition used to create concrete handlersdeclaredSubtypes- the declared subtypes of thishandlerType- Returns:
- a new inspector instance for the inspected class
-
getHandlers
Returns a sorted set of detected members of giventypethat are capable of handling certain messages.- Parameters:
type- a type of inspected entity- Returns:
- a sorted set of detected message handlers for given
type
-
getUniqueHandlers
public List<MessageHandlingMember<? super T>> getUniqueHandlers(Class<?> type, Class<? extends Message> messageType) Returns a list of detected members of giventype, that can handle messages ofmessageType. The list is further filtered to exclude any duplicate members that resolve to the sameExecutable.- Parameters:
type- a type of inspected entitymessageType- a message type the returned handlers must be able to handle- Returns:
- a list of unique detected message handlers for given
type, that can handle messages ofmessageType
-
chainedInterceptor
Returns an Interceptor Chain of annotated interceptor methods defined on the giventype. The given chain will invoke all relevant interceptors in an order defined by the handler definition.- Parameters:
type- The type containing the handler definitions- Returns:
- an interceptor chain that invokes the interceptor handlers defined on the inspected type
-
getAllHandlers
Gets all handlers per type for inspected entity. Handlers are sorted based onHandlerComparator.- Returns:
- a map of handlers per type
-
getAllInterceptors
Returns a Map of all registered interceptor methods per inspected type. Each entry contains the inspected type as key, and a SortedSet of interceptor methods defined on that type, in the order they are considered for invocation.- Returns:
- a map of interceptors per type
-
getAllInspectedTypes
Returns aSetof all types which have been inspected for handlers.- Returns:
- a
Setof all types which have been inspected for handlers
-