Package org.codehaus.activemq.broker.impl

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


   
    public static final String URL = ActiveMQConnection.DEFAULT_URL;
    protected BrokerContainer container;

    protected void setUp() throws Exception {
        container = new BrokerContainerImpl(URL);
        container.start();
        super.setUp();
    }
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

    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

        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

            }
        }
    }

    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 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");
        receiver = fac.createConnection();
View Full Code Here

     * @throws JMSException
     */
    public BrokerConnector getEmbeddedBrokerConnector() throws JMSException {
        try {
            if (brokerConnector == null) {
                BrokerContainer container = new BrokerContainerImpl(brokerName, serviceName);
                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

        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

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.