本文整理汇总了Java中org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory类的典型用法代码示例。如果您正苦于以下问题:Java DefaultMessageHandlerMethodFactory类的具体用法?Java DefaultMessageHandlerMethodFactory怎么用?Java DefaultMessageHandlerMethodFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultMessageHandlerMethodFactory类属于org.springframework.messaging.handler.annotation.support包,在下文中一共展示了DefaultMessageHandlerMethodFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDefaultJmsHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private MessageHandlerMethodFactory createDefaultJmsHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory defaultFactory = new DefaultMessageHandlerMethodFactory();
defaultFactory.setBeanFactory(beanFactory);
if (!handlerMethodArgumentResolvers.isEmpty()) {
defaultFactory.setCustomArgumentResolvers(handlerMethodArgumentResolvers);
}
defaultFactory.setMessageConverter(messageConverter);
defaultFactory.afterPropertiesSet();
return defaultFactory;
}
示例2: validatePayloadValid
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Test
public void validatePayloadValid() throws JMSException {
String methodName = "validatePayload";
DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory();
customFactory.setValidator(testValidator("invalid value"));
initializeFactory(customFactory);
Method method = getListenerMethod(methodName, String.class);
MessagingMessageListenerAdapter listener = createInstance(customFactory, method);
Session session = mock(Session.class);
listener.onMessage(createSimpleJmsTextMessage("test"), session); // test is a valid value
assertListenerMethodInvocation(sample, methodName);
}
示例3: validatePayloadInvalid
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Test
public void validatePayloadInvalid() throws JMSException {
DefaultMessageHandlerMethodFactory customFactory = new DefaultMessageHandlerMethodFactory();
customFactory.setValidator(testValidator("invalid value"));
Method method = getListenerMethod("validatePayload", String.class);
MessagingMessageListenerAdapter listener = createInstance(customFactory, method);
Session session = mock(Session.class);
thrown.expect(ListenerExecutionFailedException.class);
listener.onMessage(createSimpleJmsTextMessage("invalid value"), session); // test is an invalid value
}
示例4: createInstance
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private MessagingMessageListenerAdapter createInstance(
DefaultMessageHandlerMethodFactory factory, Method method, MessageListenerContainer container) {
MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint();
endpoint.setBean(sample);
endpoint.setMethod(method);
endpoint.setMessageHandlerMethodFactory(factory);
return endpoint.createMessageListener(container);
}
示例5: createMethodJmsEndpoint
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private MethodJmsListenerEndpoint createMethodJmsEndpoint(DefaultMessageHandlerMethodFactory factory, Method method) {
MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint();
endpoint.setBean(listener);
endpoint.setMethod(method);
endpoint.setMessageHandlerMethodFactory(factory);
return endpoint;
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:JmsListenerContainerFactoryIntegrationTests.java
示例6: jsonMessageHandlerMethod
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
/**
* give Jackson ObjetMapper to RabbitMq for JSON Mapping
*
* @return
*/
@Bean
DefaultMessageHandlerMethodFactory jsonMessageHandlerMethod() {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setMessageConverter(jackson2Converter());
return factory;
}
示例7: myHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory myHandlerMethodFactory()
{
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setMessageConverter(jackson2Converter());
return factory;
}
示例8: myHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory myHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setMessageConverter(new MappingJackson2MessageConverter());
return factory;
}
示例9: createDefaultJmsHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private MessageHandlerMethodFactory createDefaultJmsHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory defaultFactory = new DefaultMessageHandlerMethodFactory();
defaultFactory.setBeanFactory(beanFactory);
defaultFactory.afterPropertiesSet();
return defaultFactory;
}
示例10: messageHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory messageHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setMessageConverter(consumerJackson2MessageConverter());
return factory;
}
示例11: myHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory myHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setMessageConverter(jackson2Converter());
return factory;
}
示例12: createDefaultJmsHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private MessageHandlerMethodFactory createDefaultJmsHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory defaultFactory = new DefaultMessageHandlerMethodFactory();
defaultFactory.setBeanFactory(beanFactory);
defaultFactory.afterPropertiesSet();
return defaultFactory;
}
示例13: customMessageHandlerMethodFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public MessageHandlerMethodFactory customMessageHandlerMethodFactory() {
DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
factory.setValidator(new TestValidator());
return factory;
}
示例14: initializeFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) {
factory.setBeanFactory(new StaticListableBeanFactory());
factory.afterPropertiesSet();
}
示例15: initializeFactory
import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
/**
* Initialize message handler method factory
* @param factory DefaultMessageHandlerMethodFactory
*/
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) {
//factory.setBeanFactory(new StaticListableBeanFactory());
factory.afterPropertiesSet();
}