Package org.apache.activemq.apollo.broker

Examples of org.apache.activemq.apollo.broker.Broker


    public static void main(String[] args) throws Exception {

        //
        // Creating and initially configuring the broker.
        Broker broker = new Broker();
        broker.setTmp(new File("./tmp"));
        broker.setConfig(createConfig());

        //
        // The broker starts asynchronously. The runnable is invoked once
        // the broker if fully started.
        System.out.println("Starting the broker.");
        broker.start(new Runnable(){
            public void run() {
                System.out.println("The broker has now started.");
                System.out.println("Press enter to change the broker port...");
            }
        });

        System.in.read();
        System.out.println("Updating the broker configuration.");
       
        //
        // The configuration update also occurs asnyc.
        broker.update(createUpdate(), new Runnable() {
            public void run() {
                System.out.println("The configuration has been applied.");
                System.out.println("Press enter to stop the broker...");
            }
        });

        System.in.read();
        System.out.println("Stopping the broker.");
       
        //
        // The broker stops asynchronously. The runnable is invoked once
        // the broker if fully stopped.
        broker.stop(new Runnable(){
            public void run() {
                System.out.println("The broker has now stopped.");
            }
        });
       
View Full Code Here


    public void stop(Object broker) {
        ServiceControl.stop((Broker)broker, "Stopping "+broker);
    }

    public int port(Object broker) {
        Broker b = (Broker) broker;
        InetSocketAddress address = (InetSocketAddress) b.get_socket_address();
        return address.getPort();
    }
View Full Code Here

    public void stop(Object broker) {
        ServiceControl.stop((Broker)broker, "Stopping "+broker);
    }

    public int port(Object broker) {
        Broker b = (Broker) broker;
        InetSocketAddress address = (InetSocketAddress) b.get_socket_address();
        return address.getPort();
    }
View Full Code Here

    public void startBrokers() {
        for(int i=0; i < 2; i++) {

            // create a broker..
            String name = "broker" + i;
            Broker broker = createBroker(name);
            ServiceControl.start(broker);
            brokers.add(broker);

            // Add a service map entry for the broker.
            ServiceDTO details = new ServiceDTO();
View Full Code Here

    int portOfBroker(int broker) {
        return ((InetSocketAddress)brokers.get(broker).get_socket_address()).getPort();
    }

    public Broker createBroker(String hostname) {
        Broker broker = new Broker();
        BrokerDTO config = broker.config();

        // Configure the virtual host..
        VirtualHostDTO virtualHost = new VirtualHostDTO();
        virtualHost.id = hostname;
        virtualHost.host_names.add(hostname);
View Full Code Here

    public void startBrokers() {
        for(int i=0; i < 2; i++) {

            // create a broker..
            String name = "broker" + i;
            Broker broker = createBroker(name);
            ServiceControl.start(broker);
            brokers.add(broker);

            // Add a service map entry for the broker.
            ServiceDTO details = new ServiceDTO();
View Full Code Here

    int portOfBroker(int broker) {
        return ((InetSocketAddress)brokers.get(broker).get_socket_address()).getPort();
    }

    public Broker createBroker(String hostname) {
        Broker broker = new Broker();
        BrokerDTO config = broker.config();

        // Configure the virtual host..
        VirtualHostDTO virtualHost = new VirtualHostDTO();
        virtualHost.id = hostname;
        virtualHost.host_names.add(hostname);
View Full Code Here

TOP

Related Classes of org.apache.activemq.apollo.broker.Broker

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.