Package org.activemq.broker.impl

Examples of org.activemq.broker.impl.BrokerContainerImpl


        }
    }
           
    public void run() {
        try {               
            container = new BrokerContainerImpl();
            container.addConnector(brokerUrl1);
            container.setPersistenceAdapter(new VMPersistenceAdapter());
            container.start();
        } catch (Exception e) {
            e.printStackTrace();
View Full Code Here


    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

            }
        }
    }

    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

     boolean init = false;



    protected ActiveMQConnectionFactory createReceiverConnectionFactory() throws JMSException {
        receiveBroker = new BrokerContainerImpl("receiver");
        receiveBroker.addConnector("tcp://localhost:61616");
        receiveBroker.setPersistenceAdapter(createPersistenceAdapter());
        receiveBroker.start();

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

     * @throws JMSException
     */
    public BrokerConnector getEmbeddedBrokerConnector() throws JMSException {
        try {
            if (brokerConnector == null) {
                BrokerContainer container = new BrokerContainerImpl(brokerName, serviceName);
                if( !persistent ) {
                    container.setPersistenceAdapter(new VMPersistenceAdapter());
                }
                NetworkConnector networkConnector = null;
                if (doDiscovery) {
                    networkConnector = new DiscoveryNetworkConnector(container);
                    MulticastDiscoveryAgent agent = new MulticastDiscoveryAgent(serviceName);
                    container.setDiscoveryAgent(agent);
                }
                if (peerURIs != null && peerURIs.length() > 0) {
                    URIHelper peers = new URIHelper(peerURIs);
                    networkConnector = createNetworkConnector(container);
                    while (peers.hasNext()) {
                        String peerURL  = peers.getNext();
                        networkConnector.addNetworkChannel(peerURL);
                    }
                }
                container.addNetworkConnector(networkConnector);
                URIHelper helper = new URIHelper(brokerConnectorURI);
                brokerConnector = new BrokerConnectorImpl(container, helper.getNext(), wireFormat);
                while (helper.hasNext()) {
                    new BrokerConnectorImpl(container, helper.getNext(), wireFormat);
                }
                container.start();
            }
            return brokerConnector;
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

    /**
     * Sets up and starts the broker.
     */
    private void createBroker() throws Exception {
        broker = new BrokerContainerImpl("localhost");
        broker.addConnector(new BrokerConnectorImpl(broker, "vm://localhost", new DefaultWireFormat()));
        broker.setPersistenceAdapter(createPersistenceAdapter());
        broker.start();
    }
View Full Code Here

    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

        Chat chat = xmppConnection.createChat("jdoe@jabber.org");
        chat.sendMessage("Hey, how's it going?");
    }

    protected void setUp() throws Exception {
        brokerContainer = new BrokerContainerImpl();
        brokerContainer.addConnector("jabber://localhost:61606");
        //brokerContainer.addConnector("tcp://localhost:61616");
        brokerContainer.start();

        xmppConnection = new XMPPConnection("localhost", 61606);
View Full Code Here

        junit.textui.TestRunner.run(JournalBrokerBenchmark.class);
    }
   
    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);
View Full Code Here

    /**
     * Sets up and starts the broker.
     */
    private void createBroker() throws Exception {
        broker = new BrokerContainerImpl("localhost");
        broker.addConnector(new BrokerConnectorImpl(broker, "vm://localhost", new DefaultWireFormat()));
        broker.setPersistenceAdapter(createPersistenceAdapter());
        broker.start();
    }
View Full Code Here

TOP

Related Classes of org.activemq.broker.impl.BrokerContainerImpl

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.