Package org.springframework.jms.listener.adapter

Examples of org.springframework.jms.listener.adapter.MessageListenerAdapter$DestinationNameHolder


   * @param profile {@code GridJobProfile} jobProfile
   */
  protected void doStartAggregator(GridJobProfile profile, SplitAggregateJobManager manager) {
   
    // Create Message Listener Adapter and Result Collector for Job
    MessageListenerAdapter adapter = new MessageListenerAdapter();
    adapter.setDefaultListenerMethod("onResult");

    // Create JMS Message Listener Container
    DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
    container.setConnectionFactory(connectionFactory);
    container.setDestinationName(JMSNamingSupport
        .getResultQueueName(profile.getJobId()));
    container.setMessageListener(adapter);
   
    //Create results collector and set it as Execution Manager
    ResultCollector collector = new ResultCollector(profile, manager, container);
    profile.setExecutionManager(manager);
    manager.addResultCollector(profile.getJobId(), collector);
   
    // Initialize Adapter and Container
    adapter.setDelegate(collector);
    container.afterPropertiesSet();
  }
View Full Code Here


   * Register's {@link #onResult(GridTaskResult)} method as the listener
   * method for ResultQueue.
   */
  private void initializeResultListener() {

    MessageListenerAdapter adapter = new MessageListenerAdapter(this);
    adapter.setDefaultListenerMethod("onResult");

    container = new DefaultMessageListenerContainer();
    container.setConnectionFactory(connectionFactory);
    container.setDestinationName(JMSNamingSupport
        .getResultQueueName(profile.getJobId()));
View Full Code Here

            defaultMessageListenerContainer
                    .setConnectionFactory(connectionFactory);
            defaultMessageListenerContainer.setDestinationName(subscribable
                    .getName());

            MessageListenerAdapter messageListenerAdapter = new MessageListenerAdapter();
            messageListenerAdapter.setDelegate(compositeSubscriber);
            defaultMessageListenerContainer
                    .setMessageListener(messageListenerAdapter);

            // defaultMessageListenerContainer.afterPropertiesSet();
            // defaultMessageListenerContainer.start();
View Full Code Here

  public void createSimpleContainer() {
    SimpleJmsListenerContainerFactory factory = new SimpleJmsListenerContainerFactory();
    setDefaultJmsConfig(factory);
    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();

    MessageListener messageListener = new MessageListenerAdapter();
    endpoint.setMessageListener(messageListener);
    endpoint.setDestination("myQueue");

    SimpleMessageListenerContainer container = factory.createListenerContainer(endpoint);
View Full Code Here

    factory.setCacheLevel(DefaultMessageListenerContainer.CACHE_CONSUMER);
    factory.setConcurrency("3-10");
    factory.setMaxMessagesPerTask(5);

    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
    MessageListener messageListener = new MessageListenerAdapter();
    endpoint.setMessageListener(messageListener);
    endpoint.setDestination("myQueue");
    DefaultMessageListenerContainer container = factory.createListenerContainer(endpoint);

    assertDefaultJmsConfig(container);
View Full Code Here

    DefaultJcaListenerContainerFactory factory = new DefaultJcaListenerContainerFactory();
    setDefaultJcaConfig(factory);
    factory.setConcurrency("10");

    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
    MessageListener messageListener = new MessageListenerAdapter();
    endpoint.setMessageListener(messageListener);
    endpoint.setDestination("myQueue");
    JmsMessageEndpointManager container = factory.createListenerContainer(endpoint);

    assertDefaultJcaConfig(container);
View Full Code Here

    DefaultJcaListenerContainerFactory factory = new DefaultJcaListenerContainerFactory();
    factory.setDestinationResolver(destinationResolver);
    factory.setActivationSpecFactory(new StubJmsActivationSpecFactory());

    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
    endpoint.setMessageListener(new MessageListenerAdapter());
    thrown.expect(IllegalStateException.class);
    factory.createListenerContainer(endpoint);
  }
View Full Code Here

    BackOff backOff = new FixedBackOff();
    factory.setBackOff(backOff);
    factory.setRecoveryInterval(2000L);

    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
    MessageListener messageListener = new MessageListenerAdapter();
    endpoint.setMessageListener(messageListener);
    endpoint.setDestination("myQueue");
    DefaultMessageListenerContainer container = factory.createListenerContainer(endpoint);

    assertSame(backOff, new DirectFieldAccessor(container).getPropertyValue("backOff"));
View Full Code Here

  public final ExpectedException thrown = ExpectedException.none();

  @Test
  public void setupJmsMessageContainerFullConfig() {
    DefaultMessageListenerContainer container = new DefaultMessageListenerContainer();
    MessageListener messageListener = new MessageListenerAdapter();
    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
    endpoint.setDestination("myQueue");
    endpoint.setSelector("foo = 'bar'");
    endpoint.setSubscription("mySubscription");
    endpoint.setConcurrency("5-10");
View Full Code Here

  }

  @Test
  public void setupJcaMessageContainerFullConfig() {
    JmsMessageEndpointManager container = new JmsMessageEndpointManager();
    MessageListener messageListener = new MessageListenerAdapter();
    SimpleJmsListenerEndpoint endpoint = new SimpleJmsListenerEndpoint();
    endpoint.setDestination("myQueue");
    endpoint.setSelector("foo = 'bar'");
    endpoint.setSubscription("mySubscription");
    endpoint.setConcurrency("10");
View Full Code Here

TOP

Related Classes of org.springframework.jms.listener.adapter.MessageListenerAdapter$DestinationNameHolder

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.