Package org.activemq

Examples of org.activemq.ActiveMQConnectionFactory


    /**
     * @param activationSpec
     */
    public ActiveMQConnection makeConnection(ActiveMQActivationSpec activationSpec) throws JMSException {
        ActiveMQConnectionFactory connectionFactory = getConnectionFactory();
        String userName = defaultValue(activationSpec.getUserName(), info.getUserName());
        String password = defaultValue(activationSpec.getPassword(), info.getPassword());
        ActiveMQConnection physicalConnection = (ActiveMQConnection) connectionFactory.createConnection(userName, password);
        if (activationSpec.isDurableSubscription()) {
            physicalConnection.setClientID(activationSpec.getClientId());
        }
        return physicalConnection;
    }
View Full Code Here


    /**
     * @return
     */
    private ActiveMQConnectionFactory getConnectionFactory() {
        if (connectionFactory == null) {
            connectionFactory = new ActiveMQConnectionFactory(info.getServerUrl());
            connectionFactory.setCachingEnabled(false);
            connectionFactory.setCopyMessageOnSend(true);
            connectionFactory.setDoMessageCompression(false);
            connectionFactory.setDoMessageFragmentation(false);
            connectionFactory.setUseAsyncSend(false);           
View Full Code Here

    protected void setUp() throws Exception {
       
        broker = new BrokerContainerImpl("localhost");
        broker.addConnector("tcp://localhost:61616");
        broker.start();
        connectionFactory = new ActiveMQConnectionFactory(broker, "tcp://localhost:61616");
//        connectionFactory.setTurboBoost(true);
//        connectionFactory.setCachingEnabled(false);
//        connectionFactory.setCopyMessageOnSend(true);
        dest = new ActiveMQQueue("TEST");
    }
View Full Code Here

    public ActiveMQNotificationBroker() throws JMSException {
        this("vm://localhost");
    }

    public ActiveMQNotificationBroker(String url) throws JMSException {
        this(new ActiveMQConnectionFactory(url));
    }
View Full Code Here

/**
* @version $Revision$
*/
public class HttpJmsSendAndReceiveTest extends JmsTopicSendReceiveWithTwoConnectionsTest {
    protected ActiveMQConnectionFactory createConnectionFactory() {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("http://localhost:8161");
        connectionFactory.setUseEmbeddedBroker(true);
        return connectionFactory;
    }
View Full Code Here

    public boolean isMatchingConnectionFactory(ConnectionFactory connectionFactory, JMSURLHelper jmsURL, HashMap properties) {
        String brokerURL = null;
        boolean embeddedBroker = false;

        if (connectionFactory instanceof ActiveMQConnectionFactory) {
            ActiveMQConnectionFactory amqConnectionFactory =
                    (ActiveMQConnectionFactory) connectionFactory;

            // get existing queue connection factory properties
            brokerURL = amqConnectionFactory.getBrokerURL();
            embeddedBroker = amqConnectionFactory.isUseEmbeddedBroker();
        }

        // compare broker url
        String propertyBrokerURL = (String) properties.get(BROKER_URL);
        if (!brokerURL.equals(propertyBrokerURL)) {
View Full Code Here

        }
        return session;
    }

    protected Connection createConnection() throws JMSException, Exception {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user, pwd, url);
        return connectionFactory.createConnection();
    }
View Full Code Here

    private List msgRolledBack = new ArrayList();
    private List msgRedelivered = new ArrayList();

    public void testTransaction() throws Exception {

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://localhost");

        factory.setUseEmbeddedBroker(true);
        connection = factory.createConnection();
        queue = new ActiveMQQueue(getClass().getName() + "." + getName());

        producerSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        consumerSession = connection.createSession(true, 0);
View Full Code Here

        // which is either a URL or a resource on the classpath
        properties.put("brokerXmlConfig", "file:src/sample-conf/default.xml");
        properties.put(Context.PROVIDER_URL, "vm://localhost");

        InitialContext context = new InitialContext(properties);
        ActiveMQConnectionFactory connectionFactory = (ActiveMQConnectionFactory) context.lookup("ConnectionFactory");

        // END SNIPPET: example
        return connectionFactory;
    }
View Full Code Here

    protected XmlBeanFactory createBeanFactory() {
        return new XmlBeanFactory(new ClassPathResource("org/activemq/jca/spring.xml"));
    }

    protected Connection createConnection() throws Exception {
        return new ActiveMQConnectionFactory(getBrokerURL()).createConnection();
    }
View Full Code Here

TOP

Related Classes of org.activemq.ActiveMQConnectionFactory

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.