Package org.codehaus.activemq.broker.impl

Examples of org.codehaus.activemq.broker.impl.BrokerContainerImpl


        recursiveDelete(dir);
       
        JdbmPersistenceAdapter persistenceAdapter = new JdbmPersistenceAdapter();
        persistenceAdapter.setDirectory(dir);
       
        broker = new BrokerContainerImpl("localhost");
        broker.addConnector(new BrokerConnectorImpl(broker, "vm://localhost", new DefaultWireFormat()));
        broker.setPersistenceAdapter(persistenceAdapter);
        broker.start();
       
        super.setUp();
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

    /**
     * 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

        template.convertAndSend("myTopic", text);
    }

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

        applicationContext = new ClassPathXmlApplicationContext("org/codehaus/activemq/jca/spring-topic.xml");
        connectionFactory = (ConnectionFactory) applicationContext.getBean("jmsFactory");
View Full Code Here

            }
        }
    }

    protected BrokerContainer createContainer() throws Exception {
        return new BrokerContainerImpl(brokerName);
    }
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

            }
        }
    }

    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

        JournalTestHelper helper = new JournalTestHelper();
        PersistenceAdapter adapter = helper.createPersistenceAdapter(JournalPersistenceAdapter.DEFAULT_JOURNAL_TYPE);       
        SimpleCachePersistenceAdapter cacheAdapter = new SimpleCachePersistenceAdapter(adapter);
        cacheAdapter.setCacheSize(MESSAGE_COUNT);
       
        broker = new BrokerContainerImpl("localhost");
        broker.setPersistenceAdapter(cacheAdapter);
        broker.start();
        connectionFactory = new ActiveMQConnectionFactory(broker, "vm://localhost");
        connectionFactory.setTurboBoost(true);
        connectionFactory.setCachingEnabled(false);
View Full Code Here

        String url = "reliable:" + ActiveMQConnection.DEFAULT_URL;
        return new ActiveMQConnectionFactory(url);
    }

    protected void startBroker() throws JMSException {
        brokerContainer = new BrokerContainerImpl();
        String url = ActiveMQConnection.DEFAULT_URL;
        brokerContainer.addConnector(url);
        brokerContainer.start();
    }
View Full Code Here

        // have persistence messages as a default
        System.setProperty("activemq.persistenceAdapter",
                "org.codehaus.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

TOP

Related Classes of org.codehaus.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.