Package org.apache.cxf.transport.jms

Examples of org.apache.cxf.transport.jms.JMSConfiguration


    public void testNonAopTransaction() throws Exception {
        JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
        factory.setServiceClass(Greeter.class);
        factory.setAddress("jms://");

        JMSConfiguration jmsConfig = new JMSConfiguration();
        ConnectionFactory connectionFactory
            = new PooledConnectionFactory(broker.getBrokerURL());
        jmsConfig.setConnectionFactory(connectionFactory);
        jmsConfig.setTargetDestination("greeter.queue.noaop");
        jmsConfig.setPubSubDomain(false);
        jmsConfig.setUseJms11(true);

        JMSConfigFeature jmsConfigFeature = new JMSConfigFeature();
        jmsConfigFeature.setJmsConfig(jmsConfig);
        factory.getFeatures().add(jmsConfigFeature);
View Full Code Here


    }

    public static JMSConfiguration getInitJMSConfiguration(String address) throws Exception {
        JMSEndpoint endpoint = JMSEndpointParser.createEndpoint(address);

        JMSConfiguration jmsConfig = new JMSConfiguration();

        if (endpoint.isSetDeliveryMode()) {
            int deliveryMode = endpoint.getDeliveryMode()
                .equals(JMSURIConstants.DELIVERYMODE_PERSISTENT)
                ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
            jmsConfig.setDeliveryMode(deliveryMode);
        }

        if (endpoint.isSetPriority()) {
            int priority = endpoint.getPriority();
            jmsConfig.setPriority(priority);
        }

        if (endpoint.isSetTimeToLive()) {
            long timeToLive = endpoint.getTimeToLive();
            jmsConfig.setTimeToLive(timeToLive);
        }

        if (jmsConfig.isUsingEndpointInfo()) {
            JndiTemplate jt = new JndiTemplate();
            jt.setEnvironment(JMSOldConfigHolder.getInitialContextEnv(endpoint));
            boolean pubSubDomain = false;
            pubSubDomain = endpoint.getJmsVariant().equals(JMSURIConstants.TOPIC);
            JNDIConfiguration jndiConfig = new JNDIConfiguration();
            jndiConfig.setJndiConnectionFactoryName(endpoint.getJndiConnectionFactoryName());
            jmsConfig.setJndiTemplate(jt);
            jmsConfig.setJndiConfig(jndiConfig);
            jmsConfig.setExplicitQosEnabled(true);
            jmsConfig.setPubSubDomain(pubSubDomain);
            jmsConfig.setPubSubNoLocal(true);
            boolean useJndi = endpoint.getJmsVariant().equals(JMSURIConstants.JNDI);
            if (useJndi) {
                // Setup Destination jndi destination resolver
                final JndiDestinationResolver jndiDestinationResolver = new JndiDestinationResolver();
                jndiDestinationResolver.setJndiTemplate(jt);
                jmsConfig.setDestinationResolver(jndiDestinationResolver);
                jmsConfig.setTargetDestination(endpoint.getDestinationName());
                jmsConfig.setReplyDestination(endpoint.getReplyToName());
            } else {
                // Use the default dynamic destination resolver
                jmsConfig.setTargetDestination(endpoint.getDestinationName());
                jmsConfig.setReplyDestination(endpoint.getReplyToName());
            }
        }
        return jmsConfig;
    }
View Full Code Here

    }
   
    @Test
    public void testSuspendResume() {
        TestJMSContinuationWrapper cw =
            new TestJMSContinuationWrapper(b, m, observer, continuations, null, new JMSConfiguration());
        try {
            cw.suspend(5000);
            fail("SuspendInvocation exception expected");
        } catch (SuspendedInvocationException ex) {
            // ignore
View Full Code Here

    @Test
    public void testThrottleWithMessageSelector() {
       
        DefaultMessageListenerContainer springContainer = new DefaultMessageListenerContainer();
        springContainer.setCacheLevel(2);
        JMSConfiguration config = new JMSConfiguration();
        config.setMaxSuspendedContinuations(1);
       
        TestJMSContinuationWrapper cw =
            new TestJMSContinuationWrapper(b, m, observer, continuations,
                                           springContainer, config);
       
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Conduit getConduit(EndpointInfo endpointInfo, EndpointReferenceType target) throws IOException {
        JMSOldConfigHolder old = new JMSOldConfigHolder();
        JMSConfiguration jmsConf = old.createJMSConfigurationFromEndpointInfo(bus,
                                                                              endpointInfo,
                                                                              target,
                                                                              true);
        return new JMSConduit(endpointInfo, target, jmsConf, bus);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public Destination getDestination(EndpointInfo endpointInfo) throws IOException {
        JMSOldConfigHolder old = new JMSOldConfigHolder();
        JMSConfiguration jmsConf = old.createJMSConfigurationFromEndpointInfo(bus, endpointInfo, null, false);
        return new JMSDestination(bus, endpointInfo, jmsConf);
    }
View Full Code Here

 
    @Override
    public void initialize(Client client, Bus bus) {
        Conduit conduit = client.getConduit();
        if (conduit instanceof JMSConduit) {
          JMSConfiguration jmsConfig = ((JMSConduit) conduit).getJmsConfig();
          updateJMSConfig(jmsConfig);
        }
    }
View Full Code Here

    @Override
    public void initialize(Server server, Bus bus) {
        Destination destination = server.getDestination();
        if (destination instanceof JMSDestination) {
          JMSConfiguration jmsConfig = ((JMSDestination) destination).getJmsConfig();
          updateJMSConfig(jmsConfig);
        }
    }
View Full Code Here

    protected JMSConfiguration configureEndpoint(boolean isConduit, JMSEndpoint endpoint) {
        if (address != null) {
            mapAddressToEndpoint(address, endpoint);
        }
        if (jmsConfig == null) {
            jmsConfig = new JMSConfiguration();
        }

        if (endpoint.isSetDeliveryMode()) {
            int deliveryMode = endpoint.getDeliveryMode()
                .equals(JMSURIConstants.DELIVERYMODE_PERSISTENT)
View Full Code Here

    final QName endpointName = ep.getEndpointName();
    final String portName = endpointName == null
        ? null : endpointName.getLocalPart();
    JmsConfigurator result = new JmsConfigurator();
    result.setConfigurationPrefix(portName);
    result.setJmsConfiguration(new JMSConfiguration());
    result.setServiceName(serviceName);
    return result;
  }
View Full Code Here

TOP

Related Classes of org.apache.cxf.transport.jms.JMSConfiguration

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.