Examples of BrokerContainer


Examples of org.codehaus.activemq.broker.BrokerContainer

        }
    }

    public synchronized void doFail() {
        if (container != null) {
            BrokerContainer temp = container;
            container = null;
            try {
                temp.stop();
            }
            catch (JMSException e) {
                log.info("Caught while closing due to failure: " + e, e);
            }
        }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

    /**
     * Factory method to create a new broker
     */
    protected BrokerContainer createBroker() {
        BrokerContainer answer = new BrokerContainerImpl();
        String url = getConnectorURL();
        transportConnector = new ServletConnector(url);
        answer.addConnector(transportConnector);

        String brokerURL = getServletContext().getInitParameter("org.codehaus.activemq.brokerURL");
        if (brokerURL != null) {
            log("Listening for internal communication on: " + brokerURL);
        }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

        }
    }

    public synchronized void doStop() throws WaitingException, Exception {
        if (container != null) {
            BrokerContainer temp = container;
            container = null;
            temp.stop();
        }
    }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

        }
    }

    public synchronized void doFail() {
        if (container != null) {
            BrokerContainer temp = container;
            container = null;
            try {
                temp.stop();
            }
            catch (JMSException e) {
                log.info("Caught while closing due to failure: " + e, e);
            }
        }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

        Object value = factory.getBean("broker");

        assertTrue("Should have created a broker!", value != null);
        assertTrue("Should be a broker container: " + value, value instanceof BrokerContainer);

        BrokerContainer container = (BrokerContainer) value;
        Broker broker = container.getBroker();
        assertTrue("Should have a broker!", broker != null);

        assertEquals("Broker name not set!", "localhost", broker.getBrokerName());

        Object transport = factory.getBean("transport");
        assertTrue("Made transport", transport != null);

        List connectors = container.getConnectors();
        assertEquals("Should have created more connectors", 3, connectors.size());

        BrokerConnectorImpl connector1 = (BrokerConnectorImpl) connectors.get(0);
        TransportServerChannel serverChannel1 = connector1.getServerChannel();
        assertTrue(serverChannel1 instanceof VmTransportServerChannel);
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

    protected BrokerContainer createBroker(Resource resource) throws JMSException {
        String brokerName = getName();
        SpringBrokerContainerFactory factory = new SpringBrokerContainerFactory();
        factory.setResource(resource);
        BrokerContainer container = factory.createBrokerContainer(brokerName);

        assertTrue("Should have a broker container!", container != null);

        Broker broker = container.getBroker();
        assertTrue("Should have a broker!", broker != null);

        assertEquals("Broker name not set!", brokerName, broker.getBrokerName());

        container.start();
        container.stop();
        return container;

    }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

            String file = args[0];

            System.out.println("Loading Message Broker from file: " + file);
            factory.setResource(new FileSystemResource(file));

            BrokerContainer container = factory.createBrokerContainer("DefaultBroker");
            container.start();

            // lets wait until we're killed.
            Object lock = new Object();
            synchronized (lock) {
                lock.wait();
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

      }
    }

    public synchronized void doStop() throws Exception {
        if (container != null) {
            BrokerContainer temp = container;
            container = null;
            temp.stop();
        }
    }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

        }
    }

    public synchronized void doFail() {
        if (container != null) {
            BrokerContainer temp = container;
            container = null;
            try {
                temp.stop();
            }
            catch (JMSException e) {
                log.info("Caught while closing due to failure: " + e, e);
            }
        }
View Full Code Here

Examples of org.codehaus.activemq.broker.BrokerContainer

            String url = ActiveMQConnection.DEFAULT_URL;
            if (args.length > 0) {
                url = args[0];
            }

            BrokerContainer container = new BrokerContainerImpl();
            container.addConnector(url);

            if (args.length > 1) {
                container.addNetworkConnector(args[1]);
            }

            container.start();

            // lets wait until we're killed.
            Object lock = new Object();
            synchronized (lock) {
                lock.wait();
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.