Package org.springframework.jms.config

Examples of org.springframework.jms.config.MethodJmsListenerEndpoint


            "proxies by setting proxy-target-class/proxyTargetClass " +
            "attribute to 'true'", method.getName(), method.getDeclaringClass().getSimpleName()));
      }
    }

    MethodJmsListenerEndpoint endpoint = new MethodJmsListenerEndpoint();
    endpoint.setBean(bean);
    endpoint.setMethod(method);
    endpoint.setMessageHandlerMethodFactory(this.messageHandlerMethodFactory);
    endpoint.setId(getEndpointId(jmsListener));
    endpoint.setDestination(resolve(jmsListener.destination()));
    if (StringUtils.hasText(jmsListener.selector())) {
      endpoint.setSelector(resolve(jmsListener.selector()));
    }
    if (StringUtils.hasText(jmsListener.subscription())) {
      endpoint.setSubscription(resolve(jmsListener.subscription()));
    }
    if (StringUtils.hasText(jmsListener.concurrency())) {
      endpoint.setConcurrency(resolve(jmsListener.concurrency()));
    }

    JmsListenerContainerFactory<?> factory = null;
    String containerFactoryBeanName = resolve(jmsListener.containerFactory());
    if (StringUtils.hasText(containerFactoryBeanName)) {
View Full Code Here


    assertEquals("One container should have been registered", 1, factory.getListenerContainers().size());
    MessageListenerTestContainer container = factory.getListenerContainers().get(0);

    JmsListenerEndpoint endpoint = container.getEndpoint();
    assertEquals("Wrong endpoint type", MethodJmsListenerEndpoint.class, endpoint.getClass());
    MethodJmsListenerEndpoint methodEndpoint = (MethodJmsListenerEndpoint) endpoint;
    assertNotNull(methodEndpoint.getBean());
    assertNotNull(methodEndpoint.getMethod());

    SimpleMessageListenerContainer listenerContainer = new SimpleMessageListenerContainer();
    methodEndpoint.setupListenerContainer(listenerContainer);
    assertNotNull(listenerContainer.getMessageListener());

    assertTrue("Should have been started " + container, container.isStarted());
    context.close(); // Close and stop the listeners
    assertTrue("Should have been stopped " + container, container.isStopped());
View Full Code Here

   */
  public void testFullConfiguration(ApplicationContext context) {
    JmsListenerContainerTestFactory simpleFactory =
        context.getBean("simpleFactory", JmsListenerContainerTestFactory.class);
    assertEquals(1, simpleFactory.getListenerContainers().size());
    MethodJmsListenerEndpoint endpoint = (MethodJmsListenerEndpoint)
        simpleFactory.getListenerContainers().get(0).getEndpoint();
    assertEquals("listener1", endpoint.getId());
    assertEquals("queueIn", endpoint.getDestination());
    assertEquals("mySelector", endpoint.getSelector());
    assertEquals("mySubscription", endpoint.getSubscription());
    assertEquals("1-10", endpoint.getConcurrency());
  }
View Full Code Here

   */
  public void testJmsHandlerMethodFactoryConfiguration(ApplicationContext context) throws JMSException {
    JmsListenerContainerTestFactory simpleFactory =
        context.getBean("defaultFactory", JmsListenerContainerTestFactory.class);
    assertEquals(1, simpleFactory.getListenerContainers().size());
    MethodJmsListenerEndpoint endpoint = (MethodJmsListenerEndpoint)
        simpleFactory.getListenerContainers().get(0).getEndpoint();

    SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
    endpoint.setupListenerContainer(container);
    MessagingMessageListenerAdapter listener = (MessagingMessageListenerAdapter) container.getMessageListener();
    listener.onMessage(new StubTextMessage("failValidation"), mock(Session.class));
  }
View Full Code Here

TOP

Related Classes of org.springframework.jms.config.MethodJmsListenerEndpoint

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.