Class AnnotatedHandlerInspector<T>
java.lang.Object
org.axonframework.messaging.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.-
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.List<MessageHandlingMember<? super T>> Deprecated.Stream<MessageHandlingMember<? super T>> getHandlers(Class<?> type) Returns a list of detected members of giventypethat are capable of handling certain messages.<C> AnnotatedHandlerInspector<C> Inspect another handler type and register the result to the inspector registry of this inspector.static <T> AnnotatedHandlerInspector<T> inspectType(Class<? extends T> handlerType) Create an inspector for givenhandlerTypethat uses aClasspathParameterResolverFactoryto resolve method parameters andClasspathHandlerDefinitionto create handlers.static <T> AnnotatedHandlerInspector<T> inspectType(Class<? extends T> handlerType, ParameterResolverFactory parameterResolverFactory) Create an inspector for givenhandlerTypethat uses givenparameterResolverFactoryto resolve method parameters.static <T> AnnotatedHandlerInspector<T> inspectType(Class<? extends 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<? extends 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<? extends 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<? extends 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<? extends 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
-
inspect
Inspect another handler type and register the result to the inspector registry of this inspector. This is used by Axon to inspect child entities of an aggregate.- Type Parameters:
C- the handler's type- Parameters:
entityType- the type of the handler to inspect- Returns:
- a new inspector for the given type
-
getHandlers
Deprecated.usegetAllHandlers()orgetHandlers(Class)insteadReturns a list of detected members of the inspected entity that are capable of handling certain messages.- Returns:
- a list of detected message handlers
-
getHandlers
Returns a list of detected members of giventypethat are capable of handling certain messages.- Parameters:
type- a type of inspected entity- Returns:
- a stream of detected message handlers for given
type
-
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
-
getAllHandlers()orgetHandlers(Class)instead