Package org.springframework.jms.connection

Examples of org.springframework.jms.connection.SingleConnectionFactory


            UserCredentialsConnectionFactoryAdapter uccf = new UserCredentialsConnectionFactoryAdapter();
            uccf.setUsername(userName);
            uccf.setPassword(password);
            uccf.setTargetConnectionFactory(connectionFactory);

            SingleConnectionFactory scf = new SingleConnectionFactory();
            scf.setTargetConnectionFactory(uccf);
            return scf;
        } catch (NamingException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here


        if (wrappedConnectionFactory == null) {
            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                SingleConnectionFactory scf;
                if (useJms11) {
                    scf = new SingleConnectionFactory(connectionFactory);
                } else {
                    scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                }
                if (getDurableSubscriptionClientId() != null) {
                    scf.setClientId(getDurableSubscriptionClientId());
                }
                scf.setReconnectOnException(isReconnectOnException());
                wrappedConnectionFactory = scf;
            } else {
                wrappedConnectionFactory = connectionFactory;
            }
        }
View Full Code Here

        if (wrappedConnectionFactory == null) {
            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                SingleConnectionFactory scf;
                if (useJms11) {
                    scf = new SingleConnectionFactory(connectionFactory);
                } else {
                    scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                }
                if (getDurableSubscriptionClientId() != null) {
                    scf.setClientId(getDurableSubscriptionClientId());
                }
                scf.setReconnectOnException(isReconnectOnException());
                wrappedConnectionFactory = scf;
            } else {
                wrappedConnectionFactory = connectionFactory;
            }
        }
View Full Code Here

        if (wrappedConnectionFactory == null) {
            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                SingleConnectionFactory scf;
                if (useJms11) {
                    scf = new SingleConnectionFactory(connectionFactory);
                } else {
                    scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                }
                if (getDurableSubscriptionClientId() != null) {
                    scf.setClientId(getDurableSubscriptionClientId());
                }
                scf.setReconnectOnException(isReconnectOnException());
                wrappedConnectionFactory = scf;
            } else {
                wrappedConnectionFactory = connectionFactory;
            }
        }
View Full Code Here

        JmsEndpoint endpoint = resolveMandatoryEndpoint("activemq:test.foo?useSingleConnection=true");
        JmsProducer producer = endpoint.createProducer();

        JmsTemplate template = assertIsInstanceOf(JmsTemplate.class, producer.getInOutTemplate());
        assertEquals("pubSubDomain", false, template.isPubSubDomain());
        SingleConnectionFactory connectionFactory = assertIsInstanceOf(SingleConnectionFactory.class, template.getConnectionFactory());
        assertIsInstanceOf(ActiveMQConnectionFactory.class, connectionFactory.getTargetConnectionFactory());
    }
View Full Code Here

        if (answer.getBeanName() == null) {
            answer.setBeanName("Camel");
        }
        answer.setBrokerURL(getBrokerURL());
        if (isUseSingleConnection()) {
            SingleConnectionFactory scf = new SingleConnectionFactory(answer);
            if (activeMQComponent != null) {
                activeMQComponent.addSingleConnectionFactory(scf);
            }
            return scf;
        }
View Full Code Here

        if (wrappedConnectionFactory == null) {
            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                SingleConnectionFactory scf;
                if (useJms11) {
                    if (connectionFactory instanceof XAConnectionFactory) {
                        scf = new XASingleConnectionFactory(connectionFactory);
                    } else {
                        scf = new SingleConnectionFactory(connectionFactory);
                    }
                } else {
                    scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                }
                if (getDurableSubscriptionClientId() != null) {
                    scf.setClientId(getDurableSubscriptionClientId());
                }
                scf.setReconnectOnException(isReconnectOnException());
                wrappedConnectionFactory = scf;
            } else {
                wrappedConnectionFactory = connectionFactory;
            }
        }
View Full Code Here

        if (wrappedConnectionFactory == null) {
            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                SingleConnectionFactory scf;
                if (useJms11) {
                    if (connectionFactory instanceof XAConnectionFactory) {
                        scf = new XASingleConnectionFactory(connectionFactory);
                    } else {
                        scf = new SingleConnectionFactory(connectionFactory);
                    }
                    autoWrappedConnectionFactory = true;
                } else {
                    @SuppressWarnings("deprecation")
                    SingleConnectionFactory scf2
                        = new org.springframework.jms.connection.SingleConnectionFactory102(connectionFactory,
                                                                                            pubSubDomain);
                    scf = scf2;
                }
View Full Code Here

        if (wrappedConnectionFactory == null) {
            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                SingleConnectionFactory scf;
                if (useJms11) {
                    if (connectionFactory instanceof XAConnectionFactory) {
                        scf = new XASingleConnectionFactory(connectionFactory);
                    } else {
                        scf = new SingleConnectionFactory(connectionFactory);
                    }
                } else {
                    scf = new SingleConnectionFactory102(connectionFactory, pubSubDomain);
                }
                if (getDurableSubscriptionClientId() != null) {
                    scf.setClientId(getDurableSubscriptionClientId());
                }
                scf.setReconnectOnException(isReconnectOnException());
                wrappedConnectionFactory = scf;
            } else {
                wrappedConnectionFactory = connectionFactory;
            }
        }
View Full Code Here

            if (connectionFactory == null) {
                connectionFactory = JMSFactory.getConnectionFactoryFromJndi(this);
            }
            if (wrapInSingleConnectionFactory && !(connectionFactory instanceof SingleConnectionFactory)) {
                if (useJms11) {
                    wrappedConnectionFactory = new SingleConnectionFactory(connectionFactory);
                } else {
                    wrappedConnectionFactory = new SingleConnectionFactory102(connectionFactory,
                                                                              pubSubDomain);
                }
                if (reconnectOnException) {
View Full Code Here

TOP

Related Classes of org.springframework.jms.connection.SingleConnectionFactory

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.