Package org.axonframework.common.annotation

Examples of org.axonframework.common.annotation.MethodMessageHandlerInspector


     */
    @Deprecated
    public AnnotationCommandHandlerAdapter(Object target, CommandBus commandBus) {
        Assert.notNull(target, "target may not be null");
        this.parameterResolverFactory = ClasspathParameterResolverFactory.forClass(target.getClass());
        MethodMessageHandlerInspector inspector = MethodMessageHandlerInspector.getInstance(target.getClass(),
                                                                                            CommandHandler.class,
                                                                                            parameterResolverFactory,
                                                                                            true);
        for (MethodMessageHandler handler : inspector.getHandlers()) {
            String commandName = CommandMessageHandlerUtils.resolveAcceptedCommandName(handler);
            handlers.put(commandName, handler);
        }
        this.target = target;
        this.commandBus = commandBus;
View Full Code Here


     * @param parameterResolverFactory The strategy for resolving handler method parameter values
     */
    public AnnotationCommandHandlerAdapter(Object annotatedCommandHandler,
                                           ParameterResolverFactory parameterResolverFactory) {
        Assert.notNull(annotatedCommandHandler, "annotatedCommandHandler may not be null");
        MethodMessageHandlerInspector inspector = MethodMessageHandlerInspector.getInstance(annotatedCommandHandler
                                                                                                    .getClass(),
                                                                                            CommandHandler.class,
                                                                                            parameterResolverFactory,
                                                                                            true);
        for (MethodMessageHandler handler : inspector.getHandlers()) {
            String commandName = CommandMessageHandlerUtils.resolveAcceptedCommandName(handler);
            handlers.put(commandName, handler);
        }
        this.parameterResolverFactory = parameterResolverFactory;
        this.target = annotatedCommandHandler;
View Full Code Here

     * @param parameterResolverFactory The factory for parameter resolvers that resolve parameters for the annotated
     *                                 methods
     */
    protected SagaMethodMessageHandlerInspector(Class<T> sagaType, ParameterResolverFactory parameterResolverFactory) {
        this.parameterResolverFactory = parameterResolverFactory;
        MethodMessageHandlerInspector inspector = MethodMessageHandlerInspector.getInstance(
                sagaType, parameterResolverFactory, true,
                AnnotatedHandlerDefinition.INSTANCE);
        for (MethodMessageHandler handler : inspector.getHandlers()) {
            handlers.add(SagaMethodMessageHandler.getInstance(handler));
        }
        this.sagaType = sagaType;
    }
View Full Code Here

     * @param targetType               The targetType to inspect methods on
     * @param parameterResolverFactory The strategy for resolving parameter values
     */
    @SuppressWarnings({"unchecked"})
    protected AggregateCommandHandlerInspector(Class<T> targetType, ParameterResolverFactory parameterResolverFactory) {
        MethodMessageHandlerInspector inspector = MethodMessageHandlerInspector.getInstance(targetType,
                                                                                            CommandHandler.class,
                                                                                            parameterResolverFactory,
                                                                                            true);
        handlers = new ArrayList<AbstractMessageHandler>(inspector.getHandlers());
        processNestedEntityCommandHandlers(targetType, parameterResolverFactory, new RootEntityAccessor(targetType));
        for (Constructor constructor : targetType.getConstructors()) {
            if (constructor.isAnnotationPresent(CommandHandler.class)) {
                constructorCommandHandlers.add(
                        ConstructorCommandMessageHandler.forConstructor(constructor, parameterResolverFactory));
View Full Code Here

                }
                newEntityAccessor = new EntityCollectionFieldAccessor(entityType, annotation, entityAccessor, field);
            }

            if (newEntityAccessor != null) {
                MethodMessageHandlerInspector fieldInspector = MethodMessageHandlerInspector
                        .getInstance(newEntityAccessor.entityType(),
                                     CommandHandler.class,
                                     parameterResolverFactory,
                                     true);
                for (MethodMessageHandler fieldHandler : fieldInspector.getHandlers()) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Found a Command Handler in {} on field {}.{}",
                                     field.getType().getSimpleName(),
                                     entityAccessor.entityType().getName(),
                                     field.getName());
View Full Code Here

TOP

Related Classes of org.axonframework.common.annotation.MethodMessageHandlerInspector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.