Package org.activemq

Examples of org.activemq.ActiveMQConnectionFactory


       
        String[] names = getConnectionFactoryNames(environment);
        for (int i = 0; i < names.length; i++) {
           
            String name = names[i];
            ActiveMQConnectionFactory factory = createConnectionFactory(name, environment);
           
            if( broker==null ) {
                try {
                    broker = factory.getEmbeddedBroker();
                }
                catch (JMSException e) {
                    log.warn("Failed to get embedded broker", e);
                }
            }
View Full Code Here


 
    /**
     * Factory method to create a new connection factory from the given environment
     */
    protected ActiveMQConnectionFactory createConnectionFactory(Hashtable environment) {
        ActiveMQConnectionFactory answer = new ActiveMQConnectionFactory();
        Properties properties = new Properties();
        properties.putAll(environment);
        answer.setProperties(properties);
        return answer;
    }
View Full Code Here

        this(connector.threadPool);
        this.brokerContainer = brokerContainer;
        this.uri = "";
        this.remoteBrokerName = remoteBrokerName;
        this.remoteClusterName = remoteclusterName;
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory();
        fac.setJ2EEcompliant(false);
        fac.setTurboBoost(true);
        remoteConnection = new ActiveMQConnection(fac, remoteUserName, remotePassword, channel);
        remoteConnection.setClientID("Boondocks:" + remoteClusterName + ":" + remoteBrokerName);
        remoteConnection.setQuickClose(true);
        remoteConnection.start();
        BrokerInfo info = new BrokerInfo();
View Full Code Here

        brokerContainer.getBroker().addConsumerInfoListener(NetworkChannel.this);
    }

    private synchronized void initializeRemote() throws JMSException {
        if (remoteConnection == null) {
            ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(remoteUserName, remotePassword, uri);
            //factory.setTurboBoost(true);
            factory.setJ2EEcompliant(false);
            factory.setQuickClose(true);
            factory.setInternalConnection(true);
            remoteConnection = (ActiveMQConnection) factory.createConnection();
            TransportChannel transportChannel = remoteConnection.getTransportChannel();
            if (transportChannel instanceof CompositeTransportChannel) {
                CompositeTransportChannel composite = (CompositeTransportChannel) transportChannel;
                composite.setMaximumRetries(maximumRetries);
                composite.setFailureSleepTime(reconnectSleepTime);
View Full Code Here

        doSetConnected();
    }

    private void initializeLocal() throws JMSException {
        String brokerName = brokerContainer.getBroker().getBrokerName();
        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory("vm://" + brokerName);
        factory.setTurboBoost(true);
        factory.setJ2EEcompliant(false);
        factory.setBrokerName(brokerName);
        factory.setQuickClose(true);
        factory.setInternalConnection(true);
        localConnection = (ActiveMQConnection) factory.createConnection();
        localConnection.start();
        BrokerInfo info = new BrokerInfo();
        info.setBrokerName(remoteBrokerName);
        info.setClusterName(remoteClusterName);
        localConnection.asyncSendPacket(info);
View Full Code Here

public class PooledConnectionFactory implements ConnectionFactory, Service {
    private ActiveMQConnectionFactory connectionFactory;
    private Map cache = new HashMap();

    public PooledConnectionFactory() {
        this(new ActiveMQConnectionFactory());
    }
View Full Code Here

    public PooledConnectionFactory() {
        this(new ActiveMQConnectionFactory());
    }

    public PooledConnectionFactory(String brokerURL) {
        this(new ActiveMQConnectionFactory(brokerURL));
    }
View Full Code Here

   
    /**
     * @see junit.framework.TestCase#setUp()
     */
    protected void setUp() throws Exception {
        factory = new ActiveMQConnectionFactory("tcp://localhost:61616");
        this.target = new ActiveMQQueue(getClass().getName());
    }
View Full Code Here

    protected void setUp() throws Exception {
        brokerUrl = "tcp://localhost:6099";
        subject = this.getClass().getName();
        String url = "peer://" + brokerUrl;
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory(url);
        brokerConnection = fac.createConnection();
        brokerConnection.start();
    }
View Full Code Here

        Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
        return session;
    }

    private ActiveMQConnectionFactory createFactory(String brokerUrl) {
        ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory();
        cf.setBrokerURL(brokerUrl);
        return cf;
    }
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.