Package org.springframework.jms.support.destination

Examples of org.springframework.jms.support.destination.DestinationResolver


        if (destination != null) {
            return scheme + ":" + destination;
        } else if (destinationName != null) {
            return scheme + ":" + destinationName;
        }
        DestinationResolver resolver = getDestinationResolver();
        if (resolver != null) {
            return scheme + ":" + resolver;
        }
        return super.createEndpointUri();
    }
View Full Code Here


    // Implementation methods
    // -------------------------------------------------------------------------

    public static DestinationResolver createDestinationResolver(final DestinationEndpoint destinationEndpoint) {
        return new DestinationResolver() {
            public Destination resolveDestinationName(Session session, String destinationName, boolean pubSubDomain) throws JMSException {
                return destinationEndpoint.getJmsDestination(session);
            }
        };
    }
View Full Code Here

                    ConnectionFactory cf = (ConnectionFactory)beansOfType.values().iterator().next();
                    configuration.setConnectionFactory(cf);
                }
                beansOfType = CastUtils.cast(applicationContext.getBeansOfType(DestinationResolver.class));
                if (!beansOfType.isEmpty()) {
                    DestinationResolver destinationResolver = (DestinationResolver)beansOfType.values()
                        .iterator().next();
                    configuration.setDestinationResolver(destinationResolver);
                }
            }
        }
View Full Code Here

    protected AbstractMessageListenerContainer createListenerContainer() throws Exception {
        // Use DefaultMessageListenerContainer as it supports reconnects (see CAMEL-3193)
        DefaultMessageListenerContainer answer = new DefaultMessageListenerContainer();

        answer.setDestinationName("temporary");
        answer.setDestinationResolver(new DestinationResolver() {
            public Destination resolveDestinationName(Session session, String destinationName,
                                                      boolean pubSubDomain) throws JMSException {
                // use a temporary queue to gather the reply message
                TemporaryQueue queue = session.createTemporaryQueue();
                setReplyTo(queue);
View Full Code Here

            log.debug("Using exclusive queue:" + endpoint.getReplyTo() + " as reply listener: " + answer);
        } else {
            throw new IllegalArgumentException("ReplyToType " + type + " is not supported for persistent reply queues");
        }

        DestinationResolver resolver = endpoint.getDestinationResolver();
        if (resolver == null) {
            resolver = answer.getDestinationResolver();
        }
        answer.setDestinationResolver(new DestinationResolverDelegate(resolver));
        answer.setDestinationName(endpoint.getReplyTo());
View Full Code Here

   * @see org.springframework.jms.support.destination.CachingDestinationResolver
   */
  protected void refreshDestination() {
    String destName = getDestinationName();
    if (destName != null) {
      DestinationResolver destResolver = getDestinationResolver();
      if (destResolver instanceof CachingDestinationResolver) {
        ((CachingDestinationResolver) destResolver).removeFromCache(destName);
      }
    }
  }
View Full Code Here

   * @see org.springframework.jms.support.destination.CachingDestinationResolver
   */
  protected void refreshDestination() {
    String destName = getDestinationName();
    if (destName != null) {
      DestinationResolver destResolver = getDestinationResolver();
      if (destResolver instanceof CachingDestinationResolver) {
        ((CachingDestinationResolver) destResolver).removeFromCache(destName);
      }
    }
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    private Destination resolveDestinationName(final JmsTemplate jmsTemplate, final String name) {
        SessionCallback sc = new SessionCallback() {
            public Object doInJms(Session session) throws JMSException {
                DestinationResolver resolv = jmsTemplate.getDestinationResolver();
                return resolv.resolveDestinationName(session, name, jmsConfig.isPubSubDomain());
            }
        };
        return (Destination)jmsTemplate.execute(sc);
    }
View Full Code Here

    @SuppressWarnings("unchecked")
    private Destination resolveDestinationName(final JmsTemplate jmsTemplate, final String name) {
        SessionCallback sc = new SessionCallback() {
            public Object doInJms(Session session) throws JMSException {
                DestinationResolver resolv = jmsTemplate.getDestinationResolver();
                return resolv.resolveDestinationName(session, name, jmsConfig.isPubSubDomain());
            }
        };
        return (Destination)jmsTemplate.execute(sc);
    }
View Full Code Here

  public void testWebSphereResourceAdapterSetup() throws Exception {
    Destination destination = new StubQueue();

    MockControl control = MockControl.createControl(DestinationResolver.class);
    DestinationResolver destinationResolver = (DestinationResolver) control.getMock();

    destinationResolver.resolveDestinationName(null, "destinationname", false);
    control.setReturnValue(destination);
    control.replay();

    DefaultJmsActivationSpecFactory activationSpecFactory = new DefaultJmsActivationSpecFactory();
    activationSpecFactory.setDestinationResolver(destinationResolver);
View Full Code Here

TOP

Related Classes of org.springframework.jms.support.destination.DestinationResolver

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.