当前位置: 首页>>代码示例>>Java>>正文


Java DefaultMessageHandlerMethodFactory类代码示例

本文整理汇总了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;
}
 
开发者ID:kinglcc,项目名称:spring-boot-jms,代码行数:11,代码来源:MethodJmsListenerConfigurer.java

示例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);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:15,代码来源:MethodJmsListenerEndpointTests.java

示例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

}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:MethodJmsListenerEndpointTests.java

示例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);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:MethodJmsListenerEndpointTests.java

示例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;
}
 
开发者ID:michl-b,项目名称:spring-boot-docker-rabbitmq-sample,代码行数:13,代码来源:RabbitMqConfig.java

示例7: myHandlerMethodFactory

import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory myHandlerMethodFactory()
{
    DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
    factory.setMessageConverter(jackson2Converter());
    return factory;
}
 
开发者ID:osmmosques,项目名称:osm-mosques,代码行数:8,代码来源:Application.java

示例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;
}
 
开发者ID:capesonlee,项目名称:tangtang-spring-cloud,代码行数:7,代码来源:ConsumerConfig.java

示例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;
}
 
开发者ID:opentracing-contrib,项目名称:java-jms,代码行数:7,代码来源:TracingJmsListenerEndpointRegistry.java

示例10: messageHandlerMethodFactory

import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory messageHandlerMethodFactory() {
	DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
	factory.setMessageConverter(consumerJackson2MessageConverter());
	return factory;
}
 
开发者ID:TraineeSIIp,项目名称:PepSIIrup-2017,代码行数:7,代码来源:SenderSmsApplication.java

示例11: myHandlerMethodFactory

import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
@Bean
public DefaultMessageHandlerMethodFactory myHandlerMethodFactory() {
    DefaultMessageHandlerMethodFactory factory = new DefaultMessageHandlerMethodFactory();
    factory.setMessageConverter(jackson2Converter());
    return factory;
}
 
开发者ID:HumanCellAtlas,项目名称:ingest-core,代码行数:7,代码来源:QueueConfig.java

示例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;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:JmsListenerAnnotationBeanPostProcessor.java

示例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;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:7,代码来源:EnableJmsTests.java

示例14: initializeFactory

import org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory; //导入依赖的package包/类
private void initializeFactory(DefaultMessageHandlerMethodFactory factory) {
	factory.setBeanFactory(new StaticListableBeanFactory());
	factory.afterPropertiesSet();
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:5,代码来源:MessagingMessageListenerAdapterTests.java

示例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();
}
 
开发者ID:benjamin-cartereau,项目名称:w4-bpmnplus-module-jms,代码行数:9,代码来源:ApplicationConfig.java


注:本文中的org.springframework.messaging.handler.annotation.support.DefaultMessageHandlerMethodFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。