Examples of InvocableHandlerMethod


Examples of org.springframework.messaging.handler.invocation.InvocableHandlerMethod

        }
      }
    });
    instance.afterPropertiesSet();

    InvocableHandlerMethod invocableHandlerMethod =
        createInvocableHandlerMethod(instance, "payloadValidation", String.class);
    thrown.expect(MethodArgumentNotValidException.class);
    invocableHandlerMethod.invoke(MessageBuilder.withPayload("failure").build());
  }
View Full Code Here

Examples of org.springframework.messaging.handler.invocation.InvocableHandlerMethod

  @Override
  protected MessagingMessageListenerAdapter createMessageListener(MessageListenerContainer container) {
    Assert.state(this.messageHandlerMethodFactory != null,
        "Could not create message listener - MessageHandlerMethodFactory not set");
    MessagingMessageListenerAdapter messageListener = createMessageListenerInstance();
    InvocableHandlerMethod invocableHandlerMethod =
        this.messageHandlerMethodFactory.createInvocableHandlerMethod(getBean(), getMethod());
    messageListener.setHandlerMethod(invocableHandlerMethod);
    Address replyToAddress = getDefaultReplyToAddress();
    if (replyToAddress != null) {
      messageListener.setResponseExchange(replyToAddress.getExchangeName());
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

    }
    return new ModelFactory(attrMethods, binderFactory, sessionAttrHandler);
  }

  private InvocableHandlerMethod createModelAttributeMethod(WebDataBinderFactory factory, Object bean, Method method) {
    InvocableHandlerMethod attrMethod = new InvocableHandlerMethod(bean, method);
    attrMethod.setHandlerMethodArgumentResolvers(this.argumentResolvers);
    attrMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
    attrMethod.setDataBinderFactory(factory);
    return attrMethod;
  }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

    }
    return createDataBinderFactory(initBinderMethods);
  }

  private InvocableHandlerMethod createInitBinderMethod(Object bean, Method method) {
    InvocableHandlerMethod binderMethod = new InvocableHandlerMethod(bean, method);
    binderMethod.setHandlerMethodArgumentResolvers(this.initBinderArgumentResolvers);
    binderMethod.setDataBinderFactory(new DefaultDataBinderFactory(this.webBindingInitializer));
    binderMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
    return binderMethod;
  }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

      methods = HandlerMethodSelector.selectMethods(handlerType, MODEL_ATTRIBUTE_METHODS);
      this.modelFactoryCache.put(handlerType, methods);
    }
    List<InvocableHandlerMethod> attrMethods = new ArrayList<InvocableHandlerMethod>();
    for (Method method : methods) {
      InvocableHandlerMethod attrMethod = new InvocableHandlerMethod(handlerMethod.getBean(), method);
      attrMethod.setHandlerMethodArgumentResolvers(this.argumentResolvers);
      attrMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
      attrMethod.setDataBinderFactory(binderFactory);
      attrMethods.add(attrMethod);
    }
    return new ModelFactory(attrMethods, binderFactory, sessionAttrHandler);
  }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

      methods = HandlerMethodSelector.selectMethods(handlerType, INIT_BINDER_METHODS);
      this.dataBinderFactoryCache.put(handlerType, methods);
    }
    List<InvocableHandlerMethod> binderMethods = new ArrayList<InvocableHandlerMethod>();
    for (Method method : methods) {
      InvocableHandlerMethod binderMethod = new InvocableHandlerMethod(handlerMethod.getBean(), method);
      binderMethod.setHandlerMethodArgumentResolvers(this.initBinderArgumentResolvers);
      binderMethod.setDataBinderFactory(new DefaultDataBinderFactory(this.webBindingInitializer));
      binderMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
      binderMethods.add(binderMethod);
    }
    return createDataBinderFactory(binderMethods);
  }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

    }
    return new ModelFactory(attrMethods, binderFactory, sessionAttrHandler);
  }

  private InvocableHandlerMethod createModelAttributeMethod(WebDataBinderFactory factory, Object bean, Method method) {
    InvocableHandlerMethod attrMethod = new InvocableHandlerMethod(bean, method);
    attrMethod.setHandlerMethodArgumentResolvers(this.argumentResolvers);
    attrMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
    attrMethod.setDataBinderFactory(factory);
    return attrMethod;
  }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

    }
    return createDataBinderFactory(initBinderMethods);
  }

  private InvocableHandlerMethod createInitBinderMethod(Object bean, Method method) {
    InvocableHandlerMethod binderMethod = new InvocableHandlerMethod(bean, method);
    binderMethod.setHandlerMethodArgumentResolvers(this.initBinderArgumentResolvers);
    binderMethod.setDataBinderFactory(new DefaultDataBinderFactory(this.webBindingInitializer));
    binderMethod.setParameterNameDiscoverer(this.parameterNameDiscoverer);
    return binderMethod;
  }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

   */
  private void invokeModelAttributeMethods(NativeWebRequest request, ModelAndViewContainer mavContainer)
      throws Exception {

    while (!this.modelMethods.isEmpty()) {
      InvocableHandlerMethod attrMethod = getNextModelMethod(mavContainer).getHandlerMethod();
      String modelName = attrMethod.getMethodAnnotation(ModelAttribute.class).value();
      if (mavContainer.containsAttribute(modelName)) {
        continue;
      }

      Object returnValue = attrMethod.invokeForRequest(request, mavContainer);

      if (!attrMethod.isVoid()){
        String returnValueName = getNameForReturnValue(returnValue, attrMethod.getReturnType());
        if (!mavContainer.containsAttribute(returnValueName)) {
          mavContainer.addAttribute(returnValueName, returnValue);
        }
      }
    }
View Full Code Here

Examples of org.springframework.web.method.support.InvocableHandlerMethod

    String attributeName = WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE;
    appContext.getServletContext().setAttribute(attributeName, appContext);

    handler = new TestController();
    Method method = TestController.class.getMethod("testBind", Date.class, TestBean.class, BindingResult.class);
    handlerMethod = new InvocableHandlerMethod(handler, method);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.