Package org.codehaus.activemq.broker.impl

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


            }
        }
    }

    protected BrokerContainer createContainer() throws Exception {
      BrokerContainerImpl answer = new BrokerContainerImpl(brokerName, context);
      JdbmPersistenceAdapter pa = new JdbmPersistenceAdapter( serverInfo.resolve(dataDirectory) );
      answer.setPersistenceAdapter( pa );
      if( jassConfiguration != null ) {
        answer.setSecurityAdapter(new JassJaccSecurityAdapter(jassConfiguration));
      }
      if( securityRoles != null ) {
        // Install JACC configuration.
        PropertiesConfigLoader loader = new PropertiesConfigLoader(brokerName, securityRoles);
        loader.installSecurity();
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);
        ZeroconfDiscoveryAgent agent = new ZeroconfDiscoveryAgent();
        agent.setType(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

        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

        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

        container.stop();
    }

    protected void setUp() throws Exception {
        container = new BrokerContainerImpl(URL);
        BrokerConnector brokerConnector = new BrokerConnectorImpl(container, URL, new DefaultWireFormat());
        container.start();

        super.setUp();
    }
View Full Code Here

            }
        }
    }

    protected BrokerContainer createContainer() throws Exception {
      BrokerContainerImpl answer = new BrokerContainerImpl(brokerName, context);
      JdbmPersistenceAdapter pa = new JdbmPersistenceAdapter( serverInfo.resolve(dataDirectory) );
      answer.setPersistenceAdapter( pa );
      return answer;
    }
View Full Code Here

   
    protected void setUp() throws Exception{
        String URL = "reliable://" + ActiveMQConnection.DEFAULT_URL;
      

        remoteBroker = new BrokerContainerImpl("remoteBroker");
        remoteBroker.addConnector(ActiveMQConnection.DEFAULT_URL);
        remoteBroker.start();
       
        ActiveMQConnectionFactory fac = new ActiveMQConnectionFactory("remote://" + URL + "?brokerName=receiver");
        consumerConnection = fac.createConnection();
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

        ds.setDatabaseName("testdb");
        ds.setCreateDatabase("create");
        JDBCPersistenceAdapter persistenceAdapter = new JDBCPersistenceAdapter(ds, new DefaultWireFormat());
        persistenceAdapter.setDropTablesOnStartup(true);

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