Examples of BrokerContainerImpl


Examples of org.activemq.broker.impl.BrokerContainerImpl

    BrokerContainer receiveBroker;
    BrokerContainer sendBroker;


    protected ActiveMQConnectionFactory createReceiverConnectionFactory() throws JMSException {
        receiveBroker = new BrokerContainerImpl("receiver");
        receiveBroker.addConnector("tcp://localhost:62002");
        receiveBroker.addNetworkConnector("reliable:tcp://localhost:62001");
        receiveBroker.start();

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(receiveBroker, "tcp://localhost:62002");
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(receiveBroker, "tcp://localhost:62002");
        return factory;
    }

    protected ActiveMQConnectionFactory createSenderConnectionFactory() throws JMSException {
        sendBroker = new BrokerContainerImpl("sender");
        sendBroker.addConnector("tcp://localhost:62001");
        sendBroker.addNetworkConnector("reliable:tcp://localhost:62002");
        sendBroker.start();

        ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(sendBroker, "tcp://localhost:62001");
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

        // have persistence messages as a default
        System.setProperty("activemq.persistenceAdapter",
                "org.activemq.store.vm.VMPersistenceAdapter");

        // configuration of container and all protocolls
        BrokerContainerImpl container = createBroker();

        // start a client
        ActiveMQConnectionFactory factory = new
                ActiveMQConnectionFactory("tcp://localhost:9100");
        factory.start();
        factory.createConnection();

        // stop activemq broker
        container.stop();

        // start activemq broker again
        container = createBroker();

        // start a client again
        factory = new
                ActiveMQConnectionFactory("tcp://localhost:9100");
        factory.start();
        factory.createConnection();

        // stop activemq broker
        container.stop();

    }
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

        container.stop();

    }

    protected BrokerContainerImpl createBroker() throws JMSException {
        BrokerContainerImpl container = new BrokerContainerImpl("DefaultBroker");

        // Start internal vm protocoll
        BrokerConnectorImpl vmConnector = new BrokerConnectorImpl(container, "vm://localhost", new DefaultWireFormat());
        BrokerConnectorImpl tcpConnector = new BrokerConnectorImpl(container, "tcp://localhost:9100", new DefaultWireFormat());

        // start activemq broker
        container.start();
        return container;
    }
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

    }

    private static BrokerContainer[] startBrokers(String[] addresses) throws JMSException {
        BrokerContainer[] containers = new BrokerContainer[addresses.length];
        for (int i = 0; i < containers.length; i++) {
            containers[i] = new BrokerContainerImpl(Integer.toString(i));
            containers[i].setPersistenceAdapter(new VMPersistenceAdapter());
            containers[i].addConnector(addresses[i]);

            for (int j = 0; j < addresses.length; j++) {
                if (i == j) {
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

    protected MessageConsumer createMessageConsumer(Session session, Destination destination) throws JMSException{
        return session.createConsumer(destination);
    }

    protected ActiveMQConnectionFactory createGenericClusterFactory(String brokerName) throws JMSException {
        BrokerContainer container = new BrokerContainerImpl(brokerName);
     
        MulticastDiscoveryAgent agent = new MulticastDiscoveryAgent(getClass().getName());
        container.setDiscoveryAgent(agent);
        String url = "tcp://localhost:0";
        container.addConnector(url);
        container.addNetworkConnector(new DiscoveryNetworkConnector(container));
        container.start();
        //embedded brokers are resolved by url - so make url unique
        //this confused me tests for a while :-)
        return new ActiveMQConnectionFactory(container,"vm://"+brokerName);
    }
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

            m_linkedURLs = linkedURLs;
        }

        public void run() {
            try {
                m_container = new BrokerContainerImpl(m_id);
                m_container.setPersistenceAdapter(new VMPersistenceAdapter());
                m_container.addConnector(m_myURL);

                for (int i = 0; i < m_linkedURLs.length; i++) {
                    if (!m_myURL.equals(m_linkedURLs[i])) {
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

            }
        }
    }

    protected BrokerContainer createContainer() throws Exception {
      BrokerContainerImpl answer = new BrokerContainerImpl(brokerName, context);
      answer.setPersistenceAdapter( persistenceAdapter );
      if( jaasConfiguration != null ) {
        answer.setSecurityAdapter(new JassJaccSecurityAdapter(jaasConfiguration));
      }
      if( securityRoles != null ) {
        // Install JACC configuration.
        PropertiesConfigLoader loader = new PropertiesConfigLoader(brokerName, securityRoles);
        loader.installSecurity();
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

public class SpringTemplateAndJCATest extends SpringTemplateAndJCAWithEmbeddedBrokerTest {
    private BrokerContainer broker;

    protected void setUp() throws Exception {
        // lets create a JMS broker
        broker = new BrokerContainerImpl();
        broker.addConnector("tcp://localhost:61616");
        broker.start();

        super.setUp();
    }
View Full Code Here

Examples of org.activemq.broker.impl.BrokerContainerImpl

    protected abstract ActiveMQConnectionFactory createConnectionFactory();

    protected void setUp() throws Exception {
        messageCount.set(0);
        broker = new BrokerContainerImpl("TestLargeMessages");
        broker.addConnector(URL);
        broker.start();
        destination = createDestination();
        largeMessageData = new byte[LARGE_MESSAGE_SIZE];
        for (int i = 0;i < LARGE_MESSAGE_SIZE;i++) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.